Skip to contentSkip to conversation

tests: shell: fetch rule handle with '-a' option and then delete rule

PATCH Applied Harsha Sharma 2 participants 2 messages Jan 23, 2018 – Jan 25, 2018 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 tests: shell: fetch rule handle with '-a' option and then delete rule

Fetch rule handle and then delete rule via that rule handle.

---
Changes in v2:
- No need to use grep

 tests/shell/testcases/cache/0001_cache_handling_0 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tests/shell/testcases/cache/0001_cache_handling_0 +2 -1
index 9a73769..3693f15 100755
@@ -24,6 +24,7 @@ table inet test {
 set -e
 
 $NFT -f $tmpfile
-$NFT delete rule inet test test handle 2
+rule_handle=$($NFT list ruleset -a | awk '/saddr/{print $NF}')
+$NFT delete rule inet test test handle $rule_handle
 $NFT delete set inet test test
 $NFT -f $tmpfile
Signature · 1 line
2.11.0
maintainer Applied
#1 lore raw
Quoted 1 line · Harsha Sharma

Fetch rule handle and then delete rule via that rule handle.

Applied, thanks Harsha.