All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Jallot <ejallot@gmail.com>
To: netfilter-devel@vger.kernel.org
Cc: Eric Jallot <ejallot@gmail.com>
Subject: [PATCH nft] tests: shell: fix failed tests due to missing quotes
Date: Tue,  8 Oct 2019 20:06:32 +0200	[thread overview]
Message-ID: <20191008180632.28583-1-ejallot@gmail.com> (raw)

Add double quotes to protect newlines when using <<< redirection.

See also commit b878cb7d83855.

Signed-off-by: Eric Jallot <ejallot@gmail.com>
---
 tests/shell/testcases/flowtable/0001flowtable_0      | 2 +-
 tests/shell/testcases/listing/0015dynamic_0          | 2 +-
 tests/shell/testcases/listing/0017objects_0          | 2 +-
 tests/shell/testcases/listing/0018data_0             | 2 +-
 tests/shell/testcases/listing/0019set_0              | 2 +-
 tests/shell/testcases/maps/0007named_ifname_dtype_0  | 3 +--
 tests/shell/testcases/nft-f/0002rollback_rule_0      | 4 ++--
 tests/shell/testcases/nft-f/0003rollback_jump_0      | 4 ++--
 tests/shell/testcases/nft-f/0004rollback_set_0       | 4 ++--
 tests/shell/testcases/nft-f/0005rollback_map_0       | 4 ++--
 tests/shell/testcases/nft-f/0006action_object_0      | 2 +-
 tests/shell/testcases/nft-f/0017ct_timeout_obj_0     | 2 +-
 tests/shell/testcases/nft-f/0018ct_expectation_obj_0 | 2 +-
 tests/shell/testcases/sets/0029named_ifname_dtype_0  | 2 +-
 14 files changed, 18 insertions(+), 19 deletions(-)

diff --git a/tests/shell/testcases/flowtable/0001flowtable_0 b/tests/shell/testcases/flowtable/0001flowtable_0
index 8336ec5a8f37..2e18099452a0 100755
--- a/tests/shell/testcases/flowtable/0001flowtable_0
+++ b/tests/shell/testcases/flowtable/0001flowtable_0
@@ -12,4 +12,4 @@ EXPECTED='table inet t {
 }'
 
 set -e
-$NFT -f - <<< $EXPECTED
+$NFT -f - <<< "$EXPECTED"
diff --git a/tests/shell/testcases/listing/0015dynamic_0 b/tests/shell/testcases/listing/0015dynamic_0
index 5ddc4ad83a50..4ff74e321b8c 100755
--- a/tests/shell/testcases/listing/0015dynamic_0
+++ b/tests/shell/testcases/listing/0015dynamic_0
@@ -12,7 +12,7 @@ EXPECTED="table ip filter {
 
 set -e
 
-$NFT -f - <<< $EXPECTED
+$NFT -f - <<< "$EXPECTED"
 
 GET="$($NFT list set ip filter test_set)"
 if [ "$EXPECTED" != "$GET" ] ; then
diff --git a/tests/shell/testcases/listing/0017objects_0 b/tests/shell/testcases/listing/0017objects_0
index 14d614382e1b..8a586e8034f9 100755
--- a/tests/shell/testcases/listing/0017objects_0
+++ b/tests/shell/testcases/listing/0017objects_0
@@ -8,7 +8,7 @@ EXPECTED="table inet filter {
 
 set -e
 
-$NFT -f - <<< $EXPECTED
+$NFT -f - <<< "$EXPECTED"
 $NFT flush map inet filter countermap
 
 GET="$($NFT list map inet filter countermap)"
diff --git a/tests/shell/testcases/listing/0018data_0 b/tests/shell/testcases/listing/0018data_0
index 767fe13ae65a..544b6bf588e2 100755
--- a/tests/shell/testcases/listing/0018data_0
+++ b/tests/shell/testcases/listing/0018data_0
@@ -8,7 +8,7 @@ EXPECTED="table inet filter {
 
 set -e
 
-$NFT -f - <<< $EXPECTED
+$NFT -f - <<< "$EXPECTED"
 $NFT flush map inet filter ipmap
 
 GET="$($NFT list map inet filter ipmap)"
diff --git a/tests/shell/testcases/listing/0019set_0 b/tests/shell/testcases/listing/0019set_0
index 04eb0faf74af..54a8a0644079 100755
--- a/tests/shell/testcases/listing/0019set_0
+++ b/tests/shell/testcases/listing/0019set_0
@@ -8,7 +8,7 @@ EXPECTED="table inet filter {
 
 set -e
 
-$NFT -f - <<< $EXPECTED
+$NFT -f - <<< "$EXPECTED"
 $NFT flush set inet filter ipset
 
 GET="$($NFT list set inet filter ipset)"
diff --git a/tests/shell/testcases/maps/0007named_ifname_dtype_0 b/tests/shell/testcases/maps/0007named_ifname_dtype_0
index 4c7e7895a5ce..b5c5116b5660 100755
--- a/tests/shell/testcases/maps/0007named_ifname_dtype_0
+++ b/tests/shell/testcases/maps/0007named_ifname_dtype_0
@@ -15,5 +15,4 @@ EXPECTED="table inet t {
 }"
 
 set -e
-$NFT -f - <<< $EXPECTED
-
+$NFT -f - <<< "$EXPECTED"
diff --git a/tests/shell/testcases/nft-f/0002rollback_rule_0 b/tests/shell/testcases/nft-f/0002rollback_rule_0
index 33e1212d94fb..8a9ca84a54e0 100755
--- a/tests/shell/testcases/nft-f/0002rollback_rule_0
+++ b/tests/shell/testcases/nft-f/0002rollback_rule_0
@@ -27,13 +27,13 @@ table ip t2 {
 	}
 }"
 
-$NFT -f - <<< $GOOD_RULESET
+$NFT -f - <<< "$GOOD_RULESET"
 if [ $? -ne 0 ] ; then
 	echo "E: unable to load good ruleset" >&2
 	exit 1
 fi
 
-$NFT -f - <<< $BAD_RULESET 2>/dev/null
+$NFT -f - <<< "$BAD_RULESET" 2>/dev/null
 if [ $? -eq 0 ]	; then
 	echo "E: bogus ruleset loaded?" >&2
 	exit 1
diff --git a/tests/shell/testcases/nft-f/0003rollback_jump_0 b/tests/shell/testcases/nft-f/0003rollback_jump_0
index 294a234eef97..6fb6f4e854b1 100755
--- a/tests/shell/testcases/nft-f/0003rollback_jump_0
+++ b/tests/shell/testcases/nft-f/0003rollback_jump_0
@@ -27,13 +27,13 @@ table ip t2 {
 	}
 }"
 
-$NFT -f - <<< $GOOD_RULESET
+$NFT -f - <<< "$GOOD_RULESET"
 if [ $? -ne 0 ] ; then
 	echo "E: unable to load good ruleset" >&2
 	exit 1
 fi
 
-$NFT -f - <<< $BAD_RULESET 2>/dev/null
+$NFT -f - <<< "$BAD_RULESET" 2>/dev/null
 if [ $? -eq 0 ]	; then
 	echo "E: bogus ruleset loaded?" >&2
 	exit 1
diff --git a/tests/shell/testcases/nft-f/0004rollback_set_0 b/tests/shell/testcases/nft-f/0004rollback_set_0
index 512840efb97b..bcc55df99061 100755
--- a/tests/shell/testcases/nft-f/0004rollback_set_0
+++ b/tests/shell/testcases/nft-f/0004rollback_set_0
@@ -27,13 +27,13 @@ table ip t2 {
 	}
 }"
 
-$NFT -f - <<< $GOOD_RULESET
+$NFT -f - <<< "$GOOD_RULESET"
 if [ $? -ne 0 ] ; then
 	echo "E: unable to load good ruleset" >&2
 	exit 1
 fi
 
-$NFT -f - <<< $BAD_RULESET 2>/dev/null
+$NFT -f - <<< "$BAD_RULESET" 2>/dev/null
 if [ $? -eq 0 ]	; then
 	echo "E: bogus ruleset loaded?" >&2
 	exit 1
diff --git a/tests/shell/testcases/nft-f/0005rollback_map_0 b/tests/shell/testcases/nft-f/0005rollback_map_0
index b1eb3dd37471..913595d7cd98 100755
--- a/tests/shell/testcases/nft-f/0005rollback_map_0
+++ b/tests/shell/testcases/nft-f/0005rollback_map_0
@@ -30,13 +30,13 @@ table ip t2 {
 	}
 }"
 
-$NFT -f - <<< $GOOD_RULESET
+$NFT -f - <<< "$GOOD_RULESET"
 if [ $? -ne 0 ] ; then
 	echo "E: unable to load good ruleset" >&2
 	exit 1
 fi
 
-$NFT -f - <<< $BAD_RULESET 2>/dev/null
+$NFT -f - <<< "$BAD_RULESET" 2>/dev/null
 if [ $? -eq 0 ]	; then
 	echo "E: bogus ruleset loaded?" >&2
 	exit 1
diff --git a/tests/shell/testcases/nft-f/0006action_object_0 b/tests/shell/testcases/nft-f/0006action_object_0
index fab3070f493f..ddee661dd65c 100755
--- a/tests/shell/testcases/nft-f/0006action_object_0
+++ b/tests/shell/testcases/nft-f/0006action_object_0
@@ -40,7 +40,7 @@ RULESET=$(for family in $FAMILIES ; do
 	generate1 $family
 done)
 
-$NFT -f - <<< $RULESET
+$NFT -f - <<< "$RULESET"
 if [ $? -ne 0 ] ; then
 	echo "E: unable to load ruleset 1" >&2
 	exit 1
diff --git a/tests/shell/testcases/nft-f/0017ct_timeout_obj_0 b/tests/shell/testcases/nft-f/0017ct_timeout_obj_0
index 1d6a0f7c84cf..4f407793b23b 100755
--- a/tests/shell/testcases/nft-f/0017ct_timeout_obj_0
+++ b/tests/shell/testcases/nft-f/0017ct_timeout_obj_0
@@ -13,4 +13,4 @@ EXPECTED='table ip filter {
 }'
 
 set -e
-$NFT -f - <<< $EXPECTED
+$NFT -f - <<< "$EXPECTED"
diff --git a/tests/shell/testcases/nft-f/0018ct_expectation_obj_0 b/tests/shell/testcases/nft-f/0018ct_expectation_obj_0
index eb9df3ceb121..4f9872f63130 100755
--- a/tests/shell/testcases/nft-f/0018ct_expectation_obj_0
+++ b/tests/shell/testcases/nft-f/0018ct_expectation_obj_0
@@ -15,4 +15,4 @@ EXPECTED='table ip filter {
 }'
 
 set -e
-$NFT -f - <<< $EXPECTED
+$NFT -f - <<< "$EXPECTED"
diff --git a/tests/shell/testcases/sets/0029named_ifname_dtype_0 b/tests/shell/testcases/sets/0029named_ifname_dtype_0
index 724f16676c2e..39b3c90cf8dc 100755
--- a/tests/shell/testcases/sets/0029named_ifname_dtype_0
+++ b/tests/shell/testcases/sets/0029named_ifname_dtype_0
@@ -21,4 +21,4 @@ EXPECTED="table inet t {
 }"
 
 set -e
-$NFT -f - <<< $EXPECTED
+$NFT -f - <<< "$EXPECTED"
-- 
2.11.0


             reply	other threads:[~2019-10-08 18:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-08 18:06 Eric Jallot [this message]
2019-10-08 18:47 ` [PATCH nft] tests: shell: fix failed tests due to missing quotes Phil Sutter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191008180632.28583-1-ejallot@gmail.com \
    --to=ejallot@gmail.com \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.