tests: shell: Add missing feature tests to packetpath tests
Phil Sutter
reviewerPATCH 1/1 tests: shell: Add missing feature tests to packetpath tests
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 <[email protected]>
--- 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
tests/shell/features/conntrack.sh new file +4 -0
@@ -0,0 +1,4 @@ +#!/bin/sh + +# check whether conntrack command is available +conntrack --help >/dev/null 2>&1
tests/shell/testcases/packetpath/ct_expect +1 -0
@@ -1,6 +1,7 @@ #!/bin/bash # NFT_TEST_REQUIRES(NFT_TEST_HAVE_socat) +# NFT_TEST_REQUIRES(NFT_TEST_HAVE_conntrack) . $NFT_TEST_LIBRARY_FILE
tests/shell/testcases/packetpath/ct_timeout_policy +3 -0
@@ -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
tests/shell/testcases/packetpath/ct_zone_template +2 -0
@@ -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
tests/shell/testcases/packetpath/nat_ftp +1 -0
@@ -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
tests/shell/testcases/packetpath/nat_lo +2 -0
@@ -1,5 +1,7 @@ #!/bin/bash +# NFT_TEST_REQUIRES(NFT_TEST_HAVE_socat) + set -e $NFT -f - <<EOF
Signature · 1 line
2.54.0
Phil Sutter
reviewertests/shell/features/conntrack.sh
Quoted 21 lines · Phil Sutter
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 <[email protected]>--- 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.shtests/shell/features/conntrack.sh new file +0
-0
Patch applied after fixing for missing execute permissions in the new feature test.