summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYi Chen <yiche@redhat.com>2025-06-22 20:55:51 +0800
committerPablo Neira Ayuso <pablo@netfilter.org>2025-08-13 20:09:16 +0200
commitb41162e54ee57aafd7fc5dfb19a4f977905abe11 (patch)
treed5766dbdf36baa6156ee1a69f7bc1275996a4e0e
parent39197149002b8197b327d93aff808c1152b7960c (diff)
test: shell: Don't use system nft binary
commit c73eadca05c781ebad631331a6864fa8c54a5024 upstream. Use the defined $NFT variable instead of calling the system nft binary directly. Add a nat_ftp.nodump file to avoid the following check-tree.sh error: ERR: "tests/shell/testcases/packetpath/nat_ftp" has no "tests/shell/testcases/packetpath/dumps/nat_ftp.{nft,nodump}" file. Signed-off-by: Yi Chen <yiche@redhat.com> Signed-off-by: Florian Westphal <fw@strlen.de>
-rw-r--r--tests/shell/testcases/packetpath/dumps/nat_ftp.nodump0
-rwxr-xr-xtests/shell/testcases/packetpath/flowtables4
-rwxr-xr-xtests/shell/testcases/packetpath/nat_ftp4
3 files changed, 4 insertions, 4 deletions
diff --git a/tests/shell/testcases/packetpath/dumps/nat_ftp.nodump b/tests/shell/testcases/packetpath/dumps/nat_ftp.nodump
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/tests/shell/testcases/packetpath/dumps/nat_ftp.nodump
diff --git a/tests/shell/testcases/packetpath/flowtables b/tests/shell/testcases/packetpath/flowtables
index b68c5dd4..ab11431f 100755
--- a/tests/shell/testcases/packetpath/flowtables
+++ b/tests/shell/testcases/packetpath/flowtables
@@ -67,7 +67,7 @@ sleep 3
ip netns exec $C ping -q -6 2001:db8:ffff:22::1 -c1
assert_pass "topo initialization"
-ip netns exec $R nft -f - <<EOF
+ip netns exec $R $NFT -f - <<EOF
table ip6 filter {
flowtable f1 {
hook ingress priority -100
@@ -88,7 +88,7 @@ assert_pass "apply nft ruleset"
if [ ! -r /proc/net/nf_conntrack ]
then
- echo "E: nf_conntrack unreadable, skipping" >&2
+ echo "E: nf_conntrack unreadable, skipping" >&2
exit 77
fi
diff --git a/tests/shell/testcases/packetpath/nat_ftp b/tests/shell/testcases/packetpath/nat_ftp
index 327047b8..738bcb98 100755
--- a/tests/shell/testcases/packetpath/nat_ftp
+++ b/tests/shell/testcases/packetpath/nat_ftp
@@ -20,7 +20,7 @@ assert_pass()
if [ $ret != 0 ]
then
echo "FAIL: ${@}"
- ip netns exec $R nft list ruleset
+ ip netns exec $R $NFT list ruleset
tcpdump -nnr ${PCAP}
test -r /proc/net/nf_conntrack && ip netns exec $R cat /proc/net/nf_conntrack
ip netns exec $R conntrack -S
@@ -82,7 +82,7 @@ assert_pass "topo initialization"
reload_ruleset()
{
ip netns exec $R conntrack -F 2> /dev/null
- ip netns exec $R nft -f - <<-EOF
+ ip netns exec $R $NFT -f - <<-EOF
flush ruleset
table ip6 ftp_helper_nat_test {
ct helper ftp-standard {