Blame SOURCES/0019-tests-shell-NFT-needs-to-be-invoked-unquoted.patch

ea236d
From 4bd60613ea60da4bf9da226be352dd47f585e8d0 Mon Sep 17 00:00:00 2001
ea236d
From: =?UTF-8?q?=C5=A0t=C4=9Bp=C3=A1n=20N=C4=9Bmec?= <snemec@redhat.com>
ea236d
Date: Fri, 5 Nov 2021 12:39:11 +0100
ea236d
Subject: [PATCH] tests: shell: $NFT needs to be invoked unquoted
ea236d
MIME-Version: 1.0
ea236d
Content-Type: text/plain; charset=UTF-8
ea236d
Content-Transfer-Encoding: 8bit
ea236d
ea236d
The variable has to undergo word splitting, otherwise the shell tries
ea236d
to find the variable value as an executable, which breaks in cases that
ea236d
7c8a44b25c22 ("tests: shell: Allow wrappers to be passed as nft command")
ea236d
intends to support.
ea236d
ea236d
Mention this in the shell tests README.
ea236d
ea236d
Fixes: d8ccad2a2b73 ("tests: cover baecd1cf2685 ("segtree: Fix segfault when restoring a huge interval set")")
ea236d
Signed-off-by: Štěpán Němec <snemec@redhat.com>
ea236d
Signed-off-by: Phil Sutter <phil@nwl.cc>
ea236d
(cherry picked from commit dad3338f1f76a4a5bd782bae9c6b48941dfb1e31)
ea236d
ea236d
Conflicts:
ea236d
	tests/shell/README
ea236d
-> Context change due to missing other patches.
ea236d
---
ea236d
 tests/shell/README                                       | 3 +++
ea236d
 tests/shell/testcases/sets/0068interval_stack_overflow_0 | 2 +-
ea236d
 2 files changed, 4 insertions(+), 1 deletion(-)
ea236d
ea236d
diff --git a/tests/shell/README b/tests/shell/README
ea236d
index e0279bbdc30c3..aee50e3d668b1 100644
ea236d
--- a/tests/shell/README
ea236d
+++ b/tests/shell/README
ea236d
@@ -25,4 +25,7 @@ path to the nftables binary being tested.
ea236d
 You can pass an arbitrary $NFT value as well:
ea236d
  # NFT=/usr/local/sbin/nft ./run-tests.sh
ea236d
 
ea236d
+Note that, to support usage such as NFT='valgrind nft', tests must
ea236d
+invoke $NFT unquoted.
ea236d
+
ea236d
 By default the tests are run with the nft binary at '../../src/nft'
ea236d
diff --git a/tests/shell/testcases/sets/0068interval_stack_overflow_0 b/tests/shell/testcases/sets/0068interval_stack_overflow_0
ea236d
index 134282de28268..6620572449c3c 100755
ea236d
--- a/tests/shell/testcases/sets/0068interval_stack_overflow_0
ea236d
+++ b/tests/shell/testcases/sets/0068interval_stack_overflow_0
ea236d
@@ -26,4 +26,4 @@ table inet test68_table {
ea236d
 }
ea236d
 EOF
ea236d
 
ea236d
-( ulimit -s 128 && "$NFT" -f "$ruleset_file" )
ea236d
+( ulimit -s 128 && $NFT -f "$ruleset_file" )
ea236d
-- 
ea236d
2.33.0
ea236d