All of lore.kernel.org
 help / color / mirror / Atom feed
From: Phil Sutter <phil@nwl.cc>
To: netfilter-devel@vger.kernel.org
Subject: [nft PATCH] tests: shell: Add missing feature tests to packetpath tests
Date: Tue, 20 Oct 2026 16:04:03 +0200	[thread overview]
Message-ID: <20261020140403.75708-1-phil@nwl.cc> (raw)

Test system may lack conntrack-tools, add a feature test covering it.
Also add missing socat requirement where needed.

Fixes: e1c4f734eae7c ("tests: shell: add packetpath test for nft ct expectation support")
Fixes: cbb928d3307c4 ("tests: shell: add packetpath test for timeout policy overrides")
Fixes: fcef13a358a07 ("tests: shell: add 'nft ct set zone' test case")
Fixes: 3d4ed753c1231 ("tests: shell: Add a test case for FTP helper combined with NAT.")
Fixes: 9d8c7bbe82504 ("tests: shell: add packetpath test for nat on loopback")
Signed-off-by: Phil Sutter <phil@nwl.cc>
---
 tests/shell/features/conntrack.sh                  | 4 ++++
 tests/shell/testcases/packetpath/ct_expect         | 1 +
 tests/shell/testcases/packetpath/ct_timeout_policy | 3 +++
 tests/shell/testcases/packetpath/ct_zone_template  | 2 ++
 tests/shell/testcases/packetpath/nat_ftp           | 1 +
 tests/shell/testcases/packetpath/nat_lo            | 2 ++
 6 files changed, 13 insertions(+)
 create mode 100644 tests/shell/features/conntrack.sh

diff --git a/tests/shell/features/conntrack.sh b/tests/shell/features/conntrack.sh
new file mode 100644
index 0000000000000..5454c6b0cf0aa
--- /dev/null
+++ b/tests/shell/features/conntrack.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+# check whether conntrack command is available
+conntrack --help >/dev/null 2>&1
diff --git a/tests/shell/testcases/packetpath/ct_expect b/tests/shell/testcases/packetpath/ct_expect
index cc8f52678cc5f..8b8981bb0b9fe 100755
--- a/tests/shell/testcases/packetpath/ct_expect
+++ b/tests/shell/testcases/packetpath/ct_expect
@@ -1,6 +1,7 @@
 #!/bin/bash
 
 # NFT_TEST_REQUIRES(NFT_TEST_HAVE_socat)
+# NFT_TEST_REQUIRES(NFT_TEST_HAVE_conntrack)
 
 . $NFT_TEST_LIBRARY_FILE
 
diff --git a/tests/shell/testcases/packetpath/ct_timeout_policy b/tests/shell/testcases/packetpath/ct_timeout_policy
index 1fefcb52d6c38..13b790bfa5051 100755
--- a/tests/shell/testcases/packetpath/ct_timeout_policy
+++ b/tests/shell/testcases/packetpath/ct_timeout_policy
@@ -3,6 +3,9 @@
 # Defines ct timeout policies (1s) and verifies they expire for matching flows
 # while non matching flow stay alive >2s
 
+# NFT_TEST_REQUIRES(NFT_TEST_HAVE_socat)
+# NFT_TEST_REQUIRES(NFT_TEST_HAVE_conntrack)
+
 . "$NFT_TEST_LIBRARY_FILE"
 
 ip link set lo up
diff --git a/tests/shell/testcases/packetpath/ct_zone_template b/tests/shell/testcases/packetpath/ct_zone_template
index c851e8f3280e7..0c8f92ba32e15 100755
--- a/tests/shell/testcases/packetpath/ct_zone_template
+++ b/tests/shell/testcases/packetpath/ct_zone_template
@@ -3,6 +3,8 @@
 # Check 'ct zone set 1' actually works, i.e. conntrack is created in
 # the assigned zone.
 
+# NFT_TEST_REQUIRES(NFT_TEST_HAVE_conntrack)
+
 . $NFT_TEST_LIBRARY_FILE
 
 set -e
diff --git a/tests/shell/testcases/packetpath/nat_ftp b/tests/shell/testcases/packetpath/nat_ftp
index bc44ed866125a..cfadd4a6b006e 100755
--- a/tests/shell/testcases/packetpath/nat_ftp
+++ b/tests/shell/testcases/packetpath/nat_ftp
@@ -3,6 +3,7 @@
 # NFT_TEST_REQUIRES(NFT_TEST_HAVE_tcpdump)
 # NFT_TEST_REQUIRES(NFT_TEST_HAVE_curl)
 # NFT_TEST_REQUIRES(NFT_TEST_HAVE_vsftpd)
+# NFT_TEST_REQUIRES(NFT_TEST_HAVE_conntrack)
 
 # modprobe does not work in fake root env
 [ "$NFT_TEST_HAS_REALROOT" != y ] && exit 77
diff --git a/tests/shell/testcases/packetpath/nat_lo b/tests/shell/testcases/packetpath/nat_lo
index 862aadc82ef13..761c4433afd54 100755
--- a/tests/shell/testcases/packetpath/nat_lo
+++ b/tests/shell/testcases/packetpath/nat_lo
@@ -1,5 +1,7 @@
 #!/bin/bash
 
+# NFT_TEST_REQUIRES(NFT_TEST_HAVE_socat)
+
 set -e
 
 $NFT -f - <<EOF
-- 
2.54.0


             reply	other threads:[~2026-10-20 14:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-20 14:04 Phil Sutter [this message]
2026-10-21 10:15 ` [nft PATCH] tests: shell: Add missing feature tests to packetpath tests 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=20261020140403.75708-1-phil@nwl.cc \
    --to=phil@nwl.cc \
    --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.