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 --- 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 - <