diff options
Diffstat (limited to 'tests/shell/testcases/sets/0022type_selective_flush_0')
-rwxr-xr-x | tests/shell/testcases/sets/0022type_selective_flush_0 | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/tests/shell/testcases/sets/0022type_selective_flush_0 b/tests/shell/testcases/sets/0022type_selective_flush_0 index 659bf70c..0c39cbad 100755 --- a/tests/shell/testcases/sets/0022type_selective_flush_0 +++ b/tests/shell/testcases/sets/0022type_selective_flush_0 @@ -3,23 +3,15 @@ # This tests the selectiveness of flush command on structures that use the # generic set infrastructure (sets, maps and meters). -tmpfile=$(mktemp) -if [ ! -w $tmpfile ] ; then - echo "Failed to create tmp file" >&2 - exit 0 -fi - -trap "rm -rf $tmpfile" EXIT # cleanup if aborted - -echo " +RULESET=" add table t add chain t c add set t s {type ipv4_addr;} add map t m {type ipv4_addr : inet_service;} add rule t c tcp dport 80 meter f {ip saddr limit rate 10/second} -" >$tmpfile +" -$NFT -f $tmpfile +$NFT -f - <<< $RULESET # Commands that should be invalid @@ -31,8 +23,7 @@ declare -a cmds=( for i in "${cmds[@]}" do - echo "$i" >$tmpfile - $NFT -f $tmpfile &>/dev/null + $NFT "$i" &>/dev/null ret=$? if [ $ret -eq 0 ]; then |