summaryrefslogtreecommitdiffstats
path: root/tests/shell/testcases/optimizations/merge_nat_concat
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2023-11-07 13:03:56 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2023-11-11 10:05:26 +0100
commit0f89958eefd5318f594a653b78b47cefec9e87e9 (patch)
treed749ae9aad45cd89f92266642dbfc23b23b513fa /tests/shell/testcases/optimizations/merge_nat_concat
parent89fa232fda07d3826c4ab8c155cdedb157d8a09c (diff)
tests: shell: split merge nat optimization in two tests
One without pipapo support and another with not to harm existing coverage. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'tests/shell/testcases/optimizations/merge_nat_concat')
-rwxr-xr-xtests/shell/testcases/optimizations/merge_nat_concat18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/shell/testcases/optimizations/merge_nat_concat b/tests/shell/testcases/optimizations/merge_nat_concat
new file mode 100755
index 00000000..2e0a91a3
--- /dev/null
+++ b/tests/shell/testcases/optimizations/merge_nat_concat
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+# NFT_TEST_REQUIRES(NFT_TEST_HAVE_pipapo)
+
+set -e
+
+RULESET="table ip test3 {
+ chain y {
+ oif lo accept
+ ip saddr 1.1.1.1 tcp sport 1024-65535 snat to 3.3.3.3
+ ip saddr 2.2.2.2 tcp sport 1024-65535 snat to 4.4.4.4
+ oifname enp2s0 snat ip to ip saddr map { 10.1.1.0/24 : 72.2.3.66-72.2.3.78 }
+ tcp dport 8888 redirect
+ tcp dport 9999 redirect
+ }
+}"
+
+$NFT -o -f - <<< $RULESET