From b878cb7d83855f4420791561b63aa4b96d73663a Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Fri, 8 Jun 2018 14:41:08 +0200 Subject: [PATCH] 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(-) diff --git a/tests/shell/testcases/cache/0001_cache_handling_0 b/tests/shell/testcases/cache/0001_cache_handling_0 index 77afdf8d9..f3dc9a347 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 0c010c1f5..506a6c8ad 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 a8d546ff9..546ccf7ab 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 d63a396d3..4606ce3e3 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 a6c854d25..642498260 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 c3595de8e..5ec4b2e43 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 8712fbf88..93c48115b 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 6e3b0b2e5..b9766f2db 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 7649a4960..933a2f62a 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 14cdd4997..c4ca717fe 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 8ff6b7cf2..e073d86c5 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 be02c6bf4..69c80c79a 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 c17b06b18..0bdbd1b5f 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 b6d575c93..1dd5b569c 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 77d766ec5..c8e73c243 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 8aaa7bb10..489c65b5c 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 9a6a764a3..ed702c90a 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 740981252..612eee0ca 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 1188e977c..e5010496f 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 61d6b49ce..b34d71fdd 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 3bfab97cf..855d289a9 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 c0ac396f8..c8d8f0579 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 a20a863a6..6062913b5 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 772247e09..10f99b62a 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 23bc0b02b..11f1f5d96 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 846e3226a..87603c5e1 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 747d7dc7a..514c503b3 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 1a8ecb866..99298244a 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 290ea436d..246b10924 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 c5a87d3f0..6e508fc2a 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 39a5fe9eb..ce66bd64b 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 7dca12874..3bed16ddd 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 7ebfad42b..0d80ef4e7 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 383e83477..2756dd608 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 40cea8b21..802a7e63a 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 90f87182e..42950b37f 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 b8e4cff56..f8d2d377f 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 f5f6eb8bb..ee265abd6 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 83c72af13..0e7c9a6f9 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 b43a0cce8..edc4e8d29 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 464bc2b32..e17b42f3f 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 0bab49933..b2133cfee 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 126f37e5a..5882518bd 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 f7a31e8c4..6bd5893a8 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 882610322..1580c3214 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 d442b68ef..0967fd42f 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 a0deb7a03..e691fa7f8 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 4aef63f17..2882863d9 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 fc9f1ca4d..d7c2ba3df 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 fc9f1ca4d..d7c2ba3df 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 7386ecfb9..c991b84e1 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 62971852d..9e1d6c96e 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" -- 2.47.3