From b878cb7d83855f4420791561b63aa4b96d73663a Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Fri, 8 Jun 2018 14:41:08 +0200 Subject: tests: shell: add quotes when using <<<-style here document bash 4.3.30 removes newlines in RULESET when "" are omitted, which then causes nft -f to complain about invalid syntax. As a result, all test cases that use this here-doc style fail. Signed-off-by: Florian Westphal --- tests/shell/testcases/cache/0001_cache_handling_0 | 4 ++-- tests/shell/testcases/cache/0002_interval_0 | 4 ++-- tests/shell/testcases/import/vm_json_import_0 | 4 ++-- tests/shell/testcases/maps/0006interval_map_overlap_0 | 2 +- tests/shell/testcases/netns/0001nft-f_0 | 2 +- tests/shell/testcases/netns/0003many_0 | 2 +- tests/shell/testcases/nft-f/0001define_slash_0 | 2 +- tests/shell/testcases/nft-f/0006action_object_0 | 2 +- tests/shell/testcases/nft-f/0007action_object_set_segfault_1 | 2 +- tests/shell/testcases/nft-f/0008split_tables_0 | 2 +- tests/shell/testcases/nft-f/0009variable_0 | 2 +- tests/shell/testcases/nft-f/0010variable_0 | 2 +- tests/shell/testcases/nft-f/0012different_defines_0 | 2 +- tests/shell/testcases/nft-f/0013defines_1 | 2 +- tests/shell/testcases/nft-f/0014defines_1 | 2 +- tests/shell/testcases/nft-f/0015defines_1 | 2 +- tests/shell/testcases/nft-f/0016redefines_1 | 2 +- tests/shell/testcases/sets/0001named_interval_0 | 2 +- tests/shell/testcases/sets/0008create_verdict_map_0 | 2 +- tests/shell/testcases/sets/0014malformed_set_is_not_defined_0 | 2 +- tests/shell/testcases/sets/0015rulesetflush_0 | 4 ++-- tests/shell/testcases/sets/0021nesting_0 | 2 +- tests/shell/testcases/sets/0022type_selective_flush_0 | 2 +- tests/shell/testcases/sets/0024named_objects_0 | 2 +- tests/shell/testcases/sets/0026named_limit_0 | 2 +- tests/shell/testcases/sets/0027ipv6_maps_ipv4_0 | 2 +- tests/shell/testcases/sets/0031set_timeout_size_0 | 2 +- tests/shell/testcases/transactions/0001table_0 | 2 +- tests/shell/testcases/transactions/0002table_0 | 2 +- tests/shell/testcases/transactions/0003table_0 | 2 +- tests/shell/testcases/transactions/0010chain_0 | 2 +- tests/shell/testcases/transactions/0011chain_0 | 2 +- tests/shell/testcases/transactions/0012chain_0 | 2 +- tests/shell/testcases/transactions/0013chain_0 | 2 +- tests/shell/testcases/transactions/0014chain_1 | 2 +- tests/shell/testcases/transactions/0015chain_0 | 4 ++-- tests/shell/testcases/transactions/0020rule_0 | 2 +- tests/shell/testcases/transactions/0021rule_0 | 2 +- tests/shell/testcases/transactions/0022rule_1 | 2 +- tests/shell/testcases/transactions/0023rule_1 | 2 +- tests/shell/testcases/transactions/0030set_0 | 2 +- tests/shell/testcases/transactions/0031set_0 | 2 +- tests/shell/testcases/transactions/0032set_0 | 2 +- tests/shell/testcases/transactions/0033set_0 | 2 +- tests/shell/testcases/transactions/0034set_0 | 2 +- tests/shell/testcases/transactions/0035set_0 | 2 +- tests/shell/testcases/transactions/0036set_1 | 2 +- tests/shell/testcases/transactions/0037set_0 | 2 +- tests/shell/testcases/transactions/0038set_0 | 2 +- tests/shell/testcases/transactions/0039set_0 | 2 +- tests/shell/testcases/transactions/0040set_0 | 4 ++-- tests/shell/testcases/transactions/0041nat_restore_0 | 4 ++-- 52 files changed, 59 insertions(+), 59 deletions(-) (limited to 'tests/shell') diff --git a/tests/shell/testcases/cache/0001_cache_handling_0 b/tests/shell/testcases/cache/0001_cache_handling_0 index 77afdf8d..f3dc9a34 100755 --- a/tests/shell/testcases/cache/0001_cache_handling_0 +++ b/tests/shell/testcases/cache/0001_cache_handling_0 @@ -15,7 +15,7 @@ table inet test { set -e -$NFT -f - <<< $RULESET +$NFT -f - <<< "$RULESET" TMP=$(mktemp) echo "$RULESET" >> "$TMP" $NFT "flush ruleset;include \"$TMP\"" @@ -23,4 +23,4 @@ rm -f "$TMP" 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 - <<< $RULESET +$NFT -f - <<< "$RULESET" diff --git a/tests/shell/testcases/cache/0002_interval_0 b/tests/shell/testcases/cache/0002_interval_0 index 0c010c1f..506a6c8a 100755 --- a/tests/shell/testcases/cache/0002_interval_0 +++ b/tests/shell/testcases/cache/0002_interval_0 @@ -14,5 +14,5 @@ add element inet t s { 192.168.0.1/24, }" -$NFT -f - <<< $RULESET -$NFT -f - <<< $RULESET +$NFT -f - <<< "$RULESET" +$NFT -f - <<< "$RULESET" diff --git a/tests/shell/testcases/import/vm_json_import_0 b/tests/shell/testcases/import/vm_json_import_0 index a8d546ff..546ccf7a 100755 --- a/tests/shell/testcases/import/vm_json_import_0 +++ b/tests/shell/testcases/import/vm_json_import_0 @@ -47,7 +47,7 @@ table ip6 x { } }" -$NFT -f - <<< $RULESET +$NFT -f - <<< "$RULESET" RULESET_JSON=$($NFT export vm json) $NFT flush ruleset -$NFT import vm json <<< $RULESET_JSON +$NFT import vm json <<< "$RULESET_JSON" diff --git a/tests/shell/testcases/maps/0006interval_map_overlap_0 b/tests/shell/testcases/maps/0006interval_map_overlap_0 index d63a396d..4606ce3e 100755 --- a/tests/shell/testcases/maps/0006interval_map_overlap_0 +++ b/tests/shell/testcases/maps/0006interval_map_overlap_0 @@ -10,7 +10,7 @@ add map x y { type ipv4_addr : ipv4_addr; flags interval; } add element x y { 10.0.${n}.0/24 : 10.0.0.${n} }" set -e -$NFT -f - <<< $RULESET +$NFT -f - <<< "$RULESET" n=2 $NFT "add element x y { 10.0.${n}.0/24 : 10.0.0.${n} }" diff --git a/tests/shell/testcases/netns/0001nft-f_0 b/tests/shell/testcases/netns/0001nft-f_0 index a6c854d2..64249826 100755 --- a/tests/shell/testcases/netns/0001nft-f_0 +++ b/tests/shell/testcases/netns/0001nft-f_0 @@ -83,7 +83,7 @@ if [ $? -ne 0 ] ; then exit 1 fi -$IP netns exec $NETNS_NAME $NFT -f - <<< $RULESET +$IP netns exec $NETNS_NAME $NFT -f - <<< "$RULESET" if [ $? -ne 0 ] ; then echo "E: unable to load ruleset in netns" >&2 $IP netns del $NETNS_NAME diff --git a/tests/shell/testcases/netns/0003many_0 b/tests/shell/testcases/netns/0003many_0 index c3595de8..5ec4b2e4 100755 --- a/tests/shell/testcases/netns/0003many_0 +++ b/tests/shell/testcases/netns/0003many_0 @@ -87,7 +87,7 @@ function test_netns() exit 1 fi - $IP netns exec $NETNS_NAME $NFT -f - <<< $RULESET + $IP netns exec $NETNS_NAME $NFT -f - <<< "$RULESET" if [ $? -ne 0 ] ; then echo "E: unable to load ruleset in netns" >&2 $IP netns del $NETNS_NAME diff --git a/tests/shell/testcases/nft-f/0001define_slash_0 b/tests/shell/testcases/nft-f/0001define_slash_0 index 8712fbf8..93c48115 100755 --- a/tests/shell/testcases/nft-f/0001define_slash_0 +++ b/tests/shell/testcases/nft-f/0001define_slash_0 @@ -8,4 +8,4 @@ define net = 1.1.1.1/24 set -e -$NFT -f - <<< $RULESET +$NFT -f - <<< "$RULESET" diff --git a/tests/shell/testcases/nft-f/0006action_object_0 b/tests/shell/testcases/nft-f/0006action_object_0 index 6e3b0b2e..b9766f2d 100755 --- a/tests/shell/testcases/nft-f/0006action_object_0 +++ b/tests/shell/testcases/nft-f/0006action_object_0 @@ -50,7 +50,7 @@ RULESET=$(for family in $FAMILIES ; do generate2 $family done) -$NFT -f - <<< $RULESET +$NFT -f - <<< "$RULESET" if [ $? -ne 0 ] ; then echo "E: unable to load ruleset 2" >&2 exit 1 diff --git a/tests/shell/testcases/nft-f/0007action_object_set_segfault_1 b/tests/shell/testcases/nft-f/0007action_object_set_segfault_1 index 7649a496..933a2f62 100755 --- a/tests/shell/testcases/nft-f/0007action_object_set_segfault_1 +++ b/tests/shell/testcases/nft-f/0007action_object_set_segfault_1 @@ -10,4 +10,4 @@ add set t s {type ipv4_addr\;} add rule t c ip saddr @s " -$NFT -f - <<< $RULESET 2>/dev/null +$NFT -f - <<< "$RULESET" 2>/dev/null diff --git a/tests/shell/testcases/nft-f/0008split_tables_0 b/tests/shell/testcases/nft-f/0008split_tables_0 index 14cdd499..c4ca717f 100755 --- a/tests/shell/testcases/nft-f/0008split_tables_0 +++ b/tests/shell/testcases/nft-f/0008split_tables_0 @@ -15,7 +15,7 @@ table inet filter { } }" -$NFT -f - <<< $RULESET +$NFT -f - <<< "$RULESET" if [ $? -ne 0 ] ; then echo "E: unable to load good ruleset" >&2 exit 1 diff --git a/tests/shell/testcases/nft-f/0009variable_0 b/tests/shell/testcases/nft-f/0009variable_0 index 8ff6b7cf..e073d86c 100755 --- a/tests/shell/testcases/nft-f/0009variable_0 +++ b/tests/shell/testcases/nft-f/0009variable_0 @@ -11,4 +11,4 @@ table inet forward { } }" -$NFT -f - <<< $RULESET +$NFT -f - <<< "$RULESET" diff --git a/tests/shell/testcases/nft-f/0010variable_0 b/tests/shell/testcases/nft-f/0010variable_0 index be02c6bf..69c80c79 100755 --- a/tests/shell/testcases/nft-f/0010variable_0 +++ b/tests/shell/testcases/nft-f/0010variable_0 @@ -10,4 +10,4 @@ table inet filter { add element inet filter whitelist_v4 \$whitelist_v4 " -$NFT -f - <<< $RULESET +$NFT -f - <<< "$RULESET" diff --git a/tests/shell/testcases/nft-f/0012different_defines_0 b/tests/shell/testcases/nft-f/0012different_defines_0 index c17b06b1..0bdbd1b5 100755 --- a/tests/shell/testcases/nft-f/0012different_defines_0 +++ b/tests/shell/testcases/nft-f/0012different_defines_0 @@ -33,4 +33,4 @@ table inet t { }" set -e -$NFT -f - <<< $RULESET +$NFT -f - <<< "$RULESET" diff --git a/tests/shell/testcases/nft-f/0013defines_1 b/tests/shell/testcases/nft-f/0013defines_1 index b6d575c9..1dd5b569 100755 --- a/tests/shell/testcases/nft-f/0013defines_1 +++ b/tests/shell/testcases/nft-f/0013defines_1 @@ -14,4 +14,4 @@ table ip t { } }" -$NFT -f - <<< $RULESET +$NFT -f - <<< "$RULESET" diff --git a/tests/shell/testcases/nft-f/0014defines_1 b/tests/shell/testcases/nft-f/0014defines_1 index 77d766ec..c8e73c24 100755 --- a/tests/shell/testcases/nft-f/0014defines_1 +++ b/tests/shell/testcases/nft-f/0014defines_1 @@ -14,4 +14,4 @@ table ip t { } }" -$NFT -f - <<< $RULESET +$NFT -f - <<< "$RULESET" diff --git a/tests/shell/testcases/nft-f/0015defines_1 b/tests/shell/testcases/nft-f/0015defines_1 index 8aaa7bb1..489c65b5 100755 --- a/tests/shell/testcases/nft-f/0015defines_1 +++ b/tests/shell/testcases/nft-f/0015defines_1 @@ -13,4 +13,4 @@ table ip t { } }" -$NFT -f - <<< $RULESET +$NFT -f - <<< "$RULESET" diff --git a/tests/shell/testcases/nft-f/0016redefines_1 b/tests/shell/testcases/nft-f/0016redefines_1 index 9a6a764a..ed702c90 100755 --- a/tests/shell/testcases/nft-f/0016redefines_1 +++ b/tests/shell/testcases/nft-f/0016redefines_1 @@ -21,7 +21,7 @@ EXPECTED="table ip x { } }" -$NFT -f - <<< $RULESET +$NFT -f - <<< "$RULESET" GET="$($NFT list ruleset)" diff --git a/tests/shell/testcases/sets/0001named_interval_0 b/tests/shell/testcases/sets/0001named_interval_0 index 74098125..612eee0c 100755 --- a/tests/shell/testcases/sets/0001named_interval_0 +++ b/tests/shell/testcases/sets/0001named_interval_0 @@ -36,4 +36,4 @@ table inet t { }" set -e -$NFT -f - <<< $RULESET +$NFT -f - <<< "$RULESET" diff --git a/tests/shell/testcases/sets/0008create_verdict_map_0 b/tests/shell/testcases/sets/0008create_verdict_map_0 index 1188e977..e5010496 100755 --- a/tests/shell/testcases/sets/0008create_verdict_map_0 +++ b/tests/shell/testcases/sets/0008create_verdict_map_0 @@ -14,4 +14,4 @@ add element t sourcemap { 100.123.10.2 : jump c } " set -e -$NFT -f - <<< $RULESET +$NFT -f - <<< "$RULESET" diff --git a/tests/shell/testcases/sets/0014malformed_set_is_not_defined_0 b/tests/shell/testcases/sets/0014malformed_set_is_not_defined_0 index 61d6b49c..b34d71fd 100755 --- a/tests/shell/testcases/sets/0014malformed_set_is_not_defined_0 +++ b/tests/shell/testcases/sets/0014malformed_set_is_not_defined_0 @@ -14,7 +14,7 @@ add set t s {type ipv4_addr\;} add rule t c ip saddr @s " -$NFT -f - <<< $RULESET +$NFT -f - <<< "$RULESET" ret=$? trap - EXIT diff --git a/tests/shell/testcases/sets/0015rulesetflush_0 b/tests/shell/testcases/sets/0015rulesetflush_0 index 3bfab97c..855d289a 100755 --- a/tests/shell/testcases/sets/0015rulesetflush_0 +++ b/tests/shell/testcases/sets/0015rulesetflush_0 @@ -12,7 +12,7 @@ add element inet filter blacklist_v4 { 192.168.0.1/24, }" -$NFT -f - <<< $RULESET +$NFT -f - <<< "$RULESET" # make sure flush ruleset works right -$NFT -f - <<< $RULESET +$NFT -f - <<< "$RULESET" diff --git a/tests/shell/testcases/sets/0021nesting_0 b/tests/shell/testcases/sets/0021nesting_0 index c0ac396f..c8d8f057 100755 --- a/tests/shell/testcases/sets/0021nesting_0 +++ b/tests/shell/testcases/sets/0021nesting_0 @@ -16,7 +16,7 @@ table ip x { } }' -$NFT -f - <<< $RULESET +$NFT -f - <<< "$RULESET" if [ $? -ne 0 ] ; then echo "E: unable to load ruleset" >&2 exit 1 diff --git a/tests/shell/testcases/sets/0022type_selective_flush_0 b/tests/shell/testcases/sets/0022type_selective_flush_0 index a20a863a..6062913b 100755 --- a/tests/shell/testcases/sets/0022type_selective_flush_0 +++ b/tests/shell/testcases/sets/0022type_selective_flush_0 @@ -11,7 +11,7 @@ add map t m {type ipv4_addr : inet_service;} add rule t c tcp dport 80 meter f size 1024 {ip saddr limit rate 10/second} " -$NFT -f - <<< $RULESET +$NFT -f - <<< "$RULESET" # Commands that should be invalid diff --git a/tests/shell/testcases/sets/0024named_objects_0 b/tests/shell/testcases/sets/0024named_objects_0 index 772247e0..10f99b62 100755 --- a/tests/shell/testcases/sets/0024named_objects_0 +++ b/tests/shell/testcases/sets/0024named_objects_0 @@ -30,4 +30,4 @@ table inet x { }" set -e -$NFT -f - <<< $RULESET +$NFT -f - <<< "$RULESET" diff --git a/tests/shell/testcases/sets/0026named_limit_0 b/tests/shell/testcases/sets/0026named_limit_0 index 23bc0b02..11f1f5d9 100755 --- a/tests/shell/testcases/sets/0026named_limit_0 +++ b/tests/shell/testcases/sets/0026named_limit_0 @@ -16,4 +16,4 @@ table ip filter { }" set -e -$NFT -f - <<< $RULESET +$NFT -f - <<< "$RULESET" diff --git a/tests/shell/testcases/sets/0027ipv6_maps_ipv4_0 b/tests/shell/testcases/sets/0027ipv6_maps_ipv4_0 index 846e3226..87603c5e 100755 --- a/tests/shell/testcases/sets/0027ipv6_maps_ipv4_0 +++ b/tests/shell/testcases/sets/0027ipv6_maps_ipv4_0 @@ -14,4 +14,4 @@ table inet t { } " -$NFT -f - <<< $RULESET +$NFT -f - <<< "$RULESET" diff --git a/tests/shell/testcases/sets/0031set_timeout_size_0 b/tests/shell/testcases/sets/0031set_timeout_size_0 index 747d7dc7..514c503b 100755 --- a/tests/shell/testcases/sets/0031set_timeout_size_0 +++ b/tests/shell/testcases/sets/0031set_timeout_size_0 @@ -7,6 +7,6 @@ add rule x test set update ip saddr timeout 1d2h3m4s5ms @y add rule x test set update ip daddr timeout 100ms @y" set -e -$NFT -f - <<< $RULESET +$NFT -f - <<< "$RULESET" $NFT list chain x test | grep -q 'update @y { ip saddr timeout 1d2h3m4s5ms }' $NFT list chain x test | grep -q 'update @y { ip daddr timeout 100ms }' diff --git a/tests/shell/testcases/transactions/0001table_0 b/tests/shell/testcases/transactions/0001table_0 index 1a8ecb86..99298244 100755 --- a/tests/shell/testcases/transactions/0001table_0 +++ b/tests/shell/testcases/transactions/0001table_0 @@ -7,7 +7,7 @@ delete table x add table x add table y" -$NFT -f - <<< $RULESET +$NFT -f - <<< "$RULESET" if [ $? -ne 0 ] ; then echo "E: unable to load good ruleset" >&2 exit 1 diff --git a/tests/shell/testcases/transactions/0002table_0 b/tests/shell/testcases/transactions/0002table_0 index 290ea436..246b1092 100755 --- a/tests/shell/testcases/transactions/0002table_0 +++ b/tests/shell/testcases/transactions/0002table_0 @@ -7,7 +7,7 @@ delete table x add table x add table x { flags dormant; }" -$NFT -f - <<< $RULESET +$NFT -f - <<< "$RULESET" if [ $? -ne 0 ] ; then echo "E: unable to load good ruleset" >&2 exit 1 diff --git a/tests/shell/testcases/transactions/0003table_0 b/tests/shell/testcases/transactions/0003table_0 index c5a87d3f..6e508fc2 100755 --- a/tests/shell/testcases/transactions/0003table_0 +++ b/tests/shell/testcases/transactions/0003table_0 @@ -6,7 +6,7 @@ RULESET="add table x add table y flush ruleset" -$NFT -f - <<< $RULESET +$NFT -f - <<< "$RULESET" if [ $? -ne 0 ] ; then echo "E: unable to load good ruleset" >&2 exit 1 diff --git a/tests/shell/testcases/transactions/0010chain_0 b/tests/shell/testcases/transactions/0010chain_0 index 39a5fe9e..ce66bd64 100755 --- a/tests/shell/testcases/transactions/0010chain_0 +++ b/tests/shell/testcases/transactions/0010chain_0 @@ -8,7 +8,7 @@ flush ruleset add table w add chain w y" -$NFT -f - <<< $RULESET +$NFT -f - <<< "$RULESET" if [ $? -ne 0 ] ; then echo "E: unable to load good ruleset" >&2 exit 1 diff --git a/tests/shell/testcases/transactions/0011chain_0 b/tests/shell/testcases/transactions/0011chain_0 index 7dca1287..3bed16dd 100755 --- a/tests/shell/testcases/transactions/0011chain_0 +++ b/tests/shell/testcases/transactions/0011chain_0 @@ -8,7 +8,7 @@ delete chain x y add chain x y { type filter hook input priority 0; } add chain x y { policy drop; }" -$NFT -f - <<< $RULESET +$NFT -f - <<< "$RULESET" if [ $? -ne 0 ] ; then echo "E: unable to load good ruleset" >&2 exit 1 diff --git a/tests/shell/testcases/transactions/0012chain_0 b/tests/shell/testcases/transactions/0012chain_0 index 7ebfad42..0d80ef4e 100755 --- a/tests/shell/testcases/transactions/0012chain_0 +++ b/tests/shell/testcases/transactions/0012chain_0 @@ -12,7 +12,7 @@ flush ruleset add table w add chain w y { type filter hook output priority 0; }" -$NFT -f - <<< $RULESET +$NFT -f - <<< "$RULESET" if [ $? -ne 0 ] ; then echo "E: unable to load good ruleset" >&2 exit 1 diff --git a/tests/shell/testcases/transactions/0013chain_0 b/tests/shell/testcases/transactions/0013chain_0 index 383e8347..2756dd60 100755 --- a/tests/shell/testcases/transactions/0013chain_0 +++ b/tests/shell/testcases/transactions/0013chain_0 @@ -13,7 +13,7 @@ flush ruleset add table w add chain w y { type filter hook output priority 0; }" -$NFT -f - <<< $RULESET +$NFT -f - <<< "$RULESET" if [ $? -ne 0 ] ; then echo "E: unable to load good ruleset" >&2 exit 1 diff --git a/tests/shell/testcases/transactions/0014chain_1 b/tests/shell/testcases/transactions/0014chain_1 index 40cea8b2..802a7e63 100755 --- a/tests/shell/testcases/transactions/0014chain_1 +++ b/tests/shell/testcases/transactions/0014chain_1 @@ -7,5 +7,5 @@ add chain x y delete chain x y delete chain x y" -$NFT -f - <<< $RULESET 2>/dev/null +$NFT -f - <<< "$RULESET" 2>/dev/null echo "E: allowing double-removal of chain" >&2 diff --git a/tests/shell/testcases/transactions/0015chain_0 b/tests/shell/testcases/transactions/0015chain_0 index 90f87182..42950b37 100755 --- a/tests/shell/testcases/transactions/0015chain_0 +++ b/tests/shell/testcases/transactions/0015chain_0 @@ -7,7 +7,7 @@ add chain x y add chain x z add rule x z jump y" -$NFT -f - <<< $RULESET +$NFT -f - <<< "$RULESET" if [ $? -ne 0 ] ; then echo "E: unable to load good ruleset" >&2 exit 1 @@ -18,7 +18,7 @@ delete chain x z delete chain x y delete table x" -$NFT -f - <<< $RULESET +$NFT -f - <<< "$RULESET" if [ $? -ne 0 ] ; then echo "E: unable to load good ruleset" >&2 exit 1 diff --git a/tests/shell/testcases/transactions/0020rule_0 b/tests/shell/testcases/transactions/0020rule_0 index b8e4cff5..f8d2d377 100755 --- a/tests/shell/testcases/transactions/0020rule_0 +++ b/tests/shell/testcases/transactions/0020rule_0 @@ -7,7 +7,7 @@ add chain x y add rule x y ip saddr 1.1.1.1 counter flush ruleset" -$NFT -f - <<< $RULESET +$NFT -f - <<< "$RULESET" if [ $? -ne 0 ] ; then echo "E: unable to load good ruleset" >&2 exit 1 diff --git a/tests/shell/testcases/transactions/0021rule_0 b/tests/shell/testcases/transactions/0021rule_0 index f5f6eb8b..ee265abd 100755 --- a/tests/shell/testcases/transactions/0021rule_0 +++ b/tests/shell/testcases/transactions/0021rule_0 @@ -10,7 +10,7 @@ add table x add chain x y add rule x y ip saddr 2.2.2.2 counter" -$NFT -f - <<< $RULESET +$NFT -f - <<< "$RULESET" if [ $? -ne 0 ] ; then echo "E: unable to load good ruleset" >&2 exit 1 diff --git a/tests/shell/testcases/transactions/0022rule_1 b/tests/shell/testcases/transactions/0022rule_1 index 83c72af1..0e7c9a6f 100755 --- a/tests/shell/testcases/transactions/0022rule_1 +++ b/tests/shell/testcases/transactions/0022rule_1 @@ -8,5 +8,5 @@ delete chain x y add rule x y jump y" # kernel must return ENOENT -$NFT -f - <<< $RULESET 2>/dev/null +$NFT -f - <<< "$RULESET" 2>/dev/null echo "E: allowing jump loop to unexisting chain" diff --git a/tests/shell/testcases/transactions/0023rule_1 b/tests/shell/testcases/transactions/0023rule_1 index b43a0cce..edc4e8d2 100755 --- a/tests/shell/testcases/transactions/0023rule_1 +++ b/tests/shell/testcases/transactions/0023rule_1 @@ -7,5 +7,5 @@ add chain x y add rule x y jump y" # kernel must return ELOOP -$NFT -f - <<< $RULESET 2>/dev/null +$NFT -f - <<< "$RULESET" 2>/dev/null echo "E: allowing jump to chain loop" diff --git a/tests/shell/testcases/transactions/0030set_0 b/tests/shell/testcases/transactions/0030set_0 index 464bc2b3..e17b42f3 100755 --- a/tests/shell/testcases/transactions/0030set_0 +++ b/tests/shell/testcases/transactions/0030set_0 @@ -7,7 +7,7 @@ add set x y { type ipv4_addr; } flush ruleset add table x" -$NFT -f - <<< $RULESET +$NFT -f - <<< "$RULESET" if [ $? -ne 0 ] ; then echo "E: unable to load good ruleset" >&2 exit 1 diff --git a/tests/shell/testcases/transactions/0031set_0 b/tests/shell/testcases/transactions/0031set_0 index 0bab4993..b2133cfe 100755 --- a/tests/shell/testcases/transactions/0031set_0 +++ b/tests/shell/testcases/transactions/0031set_0 @@ -7,7 +7,7 @@ add set x y { type ipv4_addr; } delete set x y add set x y { type ipv4_addr; }" -$NFT -f - <<< $RULESET +$NFT -f - <<< "$RULESET" if [ $? -ne 0 ] ; then echo "E: unable to load good ruleset" >&2 exit 1 diff --git a/tests/shell/testcases/transactions/0032set_0 b/tests/shell/testcases/transactions/0032set_0 index 126f37e5..5882518b 100755 --- a/tests/shell/testcases/transactions/0032set_0 +++ b/tests/shell/testcases/transactions/0032set_0 @@ -8,7 +8,7 @@ flush ruleset add table w add set w y { type ipv4_addr; }" -$NFT -f - <<< $RULESET +$NFT -f - <<< "$RULESET" if [ $? -ne 0 ] ; then echo "E: unable to load good ruleset" >&2 exit 1 diff --git a/tests/shell/testcases/transactions/0033set_0 b/tests/shell/testcases/transactions/0033set_0 index f7a31e8c..6bd5893a 100755 --- a/tests/shell/testcases/transactions/0033set_0 +++ b/tests/shell/testcases/transactions/0033set_0 @@ -6,7 +6,7 @@ RULESET="add table x add set x y { type ipv4_addr; } delete set x y" -$NFT -f - <<< $RULESET +$NFT -f - <<< "$RULESET" if [ $? -ne 0 ] ; then echo "E: unable to load good ruleset" >&2 exit 1 diff --git a/tests/shell/testcases/transactions/0034set_0 b/tests/shell/testcases/transactions/0034set_0 index 88261032..1580c321 100755 --- a/tests/shell/testcases/transactions/0034set_0 +++ b/tests/shell/testcases/transactions/0034set_0 @@ -7,7 +7,7 @@ add set x y { type ipv4_addr; } add element x y { 1.1.1.1 } delete element x y { 1.1.1.1 }" -$NFT -f - <<< $RULESET +$NFT -f - <<< "$RULESET" if [ $? -ne 0 ] ; then echo "E: unable to load good ruleset" >&2 exit 1 diff --git a/tests/shell/testcases/transactions/0035set_0 b/tests/shell/testcases/transactions/0035set_0 index d442b68e..0967fd42 100755 --- a/tests/shell/testcases/transactions/0035set_0 +++ b/tests/shell/testcases/transactions/0035set_0 @@ -9,7 +9,7 @@ delete element x y { 1.1.1.1 } delete element x y { 2.2.2.2 } add element x y { 3.3.3.3 }" -$NFT -f - <<< $RULESET +$NFT -f - <<< "$RULESET" if [ $? -ne 0 ] ; then echo "E: unable to load good ruleset" >&2 exit 1 diff --git a/tests/shell/testcases/transactions/0036set_1 b/tests/shell/testcases/transactions/0036set_1 index a0deb7a0..e691fa7f 100755 --- a/tests/shell/testcases/transactions/0036set_1 +++ b/tests/shell/testcases/transactions/0036set_1 @@ -8,6 +8,6 @@ add element x y { 1.1.1.1, 2.2.2.2 } delete element x y { 1.1.1.1 } delete element x y { 1.1.1.1 }" -$NFT -f - <<< $RULESET 2> /dev/null +$NFT -f - <<< "$RULESET" 2> /dev/null # Kernel must return ENOENT echo "E: allowing double-removal of element" diff --git a/tests/shell/testcases/transactions/0037set_0 b/tests/shell/testcases/transactions/0037set_0 index 4aef63f1..2882863d 100755 --- a/tests/shell/testcases/transactions/0037set_0 +++ b/tests/shell/testcases/transactions/0037set_0 @@ -7,7 +7,7 @@ add set x y { type ipv4_addr; flags interval;} add element x y { 1.1.1.0/24 } delete element x y { 1.1.1.0/24 }" -$NFT -f - <<< $RULESET +$NFT -f - <<< "$RULESET" if [ $? -ne 0 ] ; then echo "E: unable to load good ruleset" >&2 exit 1 diff --git a/tests/shell/testcases/transactions/0038set_0 b/tests/shell/testcases/transactions/0038set_0 index fc9f1ca4..d7c2ba3d 100755 --- a/tests/shell/testcases/transactions/0038set_0 +++ b/tests/shell/testcases/transactions/0038set_0 @@ -9,7 +9,7 @@ delete element x y { 192.168.0.0/24 } delete element x y { 192.168.2.0/24 } add element x y { 192.168.4.0/24 }" -$NFT -f - <<< $RULESET +$NFT -f - <<< "$RULESET" if [ $? -ne 0 ] ; then echo "E: unable to load good ruleset" >&2 exit 1 diff --git a/tests/shell/testcases/transactions/0039set_0 b/tests/shell/testcases/transactions/0039set_0 index fc9f1ca4..d7c2ba3d 100755 --- a/tests/shell/testcases/transactions/0039set_0 +++ b/tests/shell/testcases/transactions/0039set_0 @@ -9,7 +9,7 @@ delete element x y { 192.168.0.0/24 } delete element x y { 192.168.2.0/24 } add element x y { 192.168.4.0/24 }" -$NFT -f - <<< $RULESET +$NFT -f - <<< "$RULESET" if [ $? -ne 0 ] ; then echo "E: unable to load good ruleset" >&2 exit 1 diff --git a/tests/shell/testcases/transactions/0040set_0 b/tests/shell/testcases/transactions/0040set_0 index 7386ecfb..c991b84e 100755 --- a/tests/shell/testcases/transactions/0040set_0 +++ b/tests/shell/testcases/transactions/0040set_0 @@ -20,7 +20,7 @@ RULESET="table ip filter { chain CIn_1 { } }" -$NFT -f - <<< $RULESET +$NFT -f - <<< "$RULESET" if [ $? -ne 0 ] ; then echo "E: unable to load good ruleset" >&2 exit 1 @@ -36,7 +36,7 @@ fi RULESET="delete element ip filter client_to_any { 1.2.3.4 : goto CIn_1 } delete chain ip filter CIn_1" -$NFT -f - <<< $RULESET +$NFT -f - <<< "$RULESET" if [ $? -ne 0 ] ; then echo "E: unable to load good ruleset" >&2 exit 1 diff --git a/tests/shell/testcases/transactions/0041nat_restore_0 b/tests/shell/testcases/transactions/0041nat_restore_0 index 62971852..9e1d6c96 100755 --- a/tests/shell/testcases/transactions/0041nat_restore_0 +++ b/tests/shell/testcases/transactions/0041nat_restore_0 @@ -7,11 +7,11 @@ add table ip t add chain ip t c { type nat hook postrouting priority 0; } " -$NFT -f - <<< $RULESET +$NFT -f - <<< "$RULESET" RULESET=" flush ruleset $RULESET " -$NFT -f - <<< $RULESET +$NFT -f - <<< "$RULESET" -- cgit v1.2.3