Netfilter-Devel Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH nft] tests: shell: fix failed tests due to missing quotes
@ 2019-10-08 18:06 Eric Jallot
  2019-10-08 18:47 ` Phil Sutter
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Jallot @ 2019-10-08 18:06 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Eric Jallot

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH nft] tests: shell: fix failed tests due to missing quotes
  2019-10-08 18:06 [PATCH nft] tests: shell: fix failed tests due to missing quotes Eric Jallot
@ 2019-10-08 18:47 ` Phil Sutter
  0 siblings, 0 replies; 2+ messages in thread
From: Phil Sutter @ 2019-10-08 18:47 UTC (permalink / raw)
  To: Eric Jallot; +Cc: netfilter-devel

On Tue, Oct 08, 2019 at 08:06:32PM +0200, Eric Jallot wrote:
> Add double quotes to protect newlines when using <<< redirection.
> 
> See also commit b878cb7d83855.
> 
> Signed-off-by: Eric Jallot <ejallot@gmail.com>

Applied, thanks!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-08 18:06 [PATCH nft] tests: shell: fix failed tests due to missing quotes Eric Jallot
2019-10-08 18:47 ` Phil Sutter

Netfilter-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/netfilter-devel/0 netfilter-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 netfilter-devel netfilter-devel/ https://lore.kernel.org/netfilter-devel \
		netfilter-devel@vger.kernel.org netfilter-devel@archiver.kernel.org
	public-inbox-index netfilter-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.netfilter-devel


AGPL code for this site: git clone https://public-inbox.org/ public-inbox