tests: shell: fetch rule handle with '-a' option and then delete
PATCH 1/1 tests: shell: fetch rule handle with '-a' option and then delete
Fetch rule handle and then delete rule via that rule handle.
Signed-off-by Harsha Sharma <[email protected]>
--- 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
@@ -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 | grep "saddr" | awk '{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
Quoted 12 lines · Harsha Sharma
Fetch rule handle and then delete rule via that rule handle.
Signed-off-by Harsha Sharma <[email protected]>--- tests/shell/testcases/cache/0001_cache_handling_0 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)tests/shell/testcases/cache/0001_cache_handling_0 +0
-0
tests/shell/testcases/cache/0001_cache_handling_0 table inet test { · line 28
Quoted 6 lines
tests/shell/testcases/cache/0001_cache_handling_0 +2
-1@@ -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 | grep "saddr" | awk '{print $NF}') +$NFT delete rule inet test test handle $rule_handle
No need to use both grep and awk in the same pipeline.
If you prefer awk, then
awk '/saddr/ {print $NF}'
would do the same thing.
Signature · 1 line
ldv