diff mbox series

[nft,05/12] tests: shell: skip NAT netmap tests if kernel lacks support

Message ID 20231109162304.119506-6-pablo@netfilter.org
State Changes Requested
Headers show
Series update tests/shell for 5.4 kernels | expand

Commit Message

Pablo Neira Ayuso Nov. 9, 2023, 4:22 p.m. UTC
Skip tests that require NAT netmap support

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 tests/shell/features/netmap.nft         | 8 ++++++++
 tests/shell/testcases/sets/0046netmap_0 | 2 ++
 2 files changed, 10 insertions(+)
 create mode 100644 tests/shell/features/netmap.nft
diff mbox series

Patch

diff --git a/tests/shell/features/netmap.nft b/tests/shell/features/netmap.nft
new file mode 100644
index 000000000000..129ee243e2eb
--- /dev/null
+++ b/tests/shell/features/netmap.nft
@@ -0,0 +1,8 @@ 
+# 3ff7ddb1353d ("netfilter: nft_nat: add netmap support")
+# v5.7-rc2-635-g3ff7ddb1353d
+table ip x {
+        chain y {
+              type nat hook postrouting priority srcnat; policy accept;
+              snat ip prefix to ip saddr map { 10.141.11.0/24 : 192.168.2.0/24 }
+        }
+}
diff --git a/tests/shell/testcases/sets/0046netmap_0 b/tests/shell/testcases/sets/0046netmap_0
index 60bda4017c59..7533623e7f7b 100755
--- a/tests/shell/testcases/sets/0046netmap_0
+++ b/tests/shell/testcases/sets/0046netmap_0
@@ -1,5 +1,7 @@ 
 #!/bin/bash
 
+# NFT_TEST_REQUIRES(NFT_TEST_HAVE_netmap)
+
 EXPECTED="table ip x {
             chain y {
                     type nat hook postrouting priority srcnat; policy accept;