tests: py: remove meter tests
Pablo Neira Ayuso
maintainerPATCH 1/1 tests: py: remove meter tests
Userspace performs an translation to dynamic set which does not fit well into tests/py, move them to tests/shell.
Fixes b8f8ddfff733 ("evaluate: translate meter into dynamic set")
Signed-off-by Pablo Neira Ayuso <[email protected]>
--- tests/py/ip/flowtable.t | 5 - tests/py/ip/flowtable.t.json | 24 --- tests/py/ip/flowtable.t.payload | 7 - tests/py/ip6/flowtable.t | 6 - tests/py/ip6/flowtable.t.json | 62 ------ tests/py/ip6/flowtable.t.json.output | 62 ------ tests/py/ip6/flowtable.t.payload | 16 -- .../testcases/sets/dumps/meter_0.json-nft | 203 ++++++++++++++++++ tests/shell/testcases/sets/dumps/meter_0.nft | 29 +++ tests/shell/testcases/sets/meter_0 | 18 ++ 10 files changed, 250 insertions(+), 182 deletions(-) delete mode 100644 tests/py/ip/flowtable.t delete mode 100644 tests/py/ip/flowtable.t.json delete mode 100644 tests/py/ip/flowtable.t.payload delete mode 100644 tests/py/ip6/flowtable.t delete mode 100644 tests/py/ip6/flowtable.t.json delete mode 100644 tests/py/ip6/flowtable.t.json.output delete mode 100644 tests/py/ip6/flowtable.t.payload create mode 100644 tests/shell/testcases/sets/dumps/meter_0.json-nft create mode 100644 tests/shell/testcases/sets/dumps/meter_0.nft create mode 100755 tests/shell/testcases/sets/meter_0
tests/py/ip/flowtable.t deleted +0 -5
@@ -1,5 +0,0 @@ -:input;type filter hook input priority 0 - -*ip;test-ip;input - -meter xyz size 8192 { ip saddr timeout 30s counter};ok
tests/py/ip/flowtable.t.json deleted +0 -24
@@ -1,24 +0,0 @@ -# meter xyz size 8192 { ip saddr timeout 30s counter} -[ - { - "meter": { - "key": { - "elem": { - "timeout": 30, - "val": { - "payload": { - "field": "saddr", - "protocol": "ip" - } - } - } - }, - "name": "xyz", - "size": 8192, - "stmt": { - "counter": null - } - } - } -] -
tests/py/ip/flowtable.t.payload deleted +0 -7
@@ -1,7 +0,0 @@ -# meter xyz size 8192 { ip saddr timeout 30s counter} -xyz test-ip 31 -xyz test-ip 0 -ip test-ip input - [ payload load 4b @ network header + 12 => reg 1 ] - [ dynset update reg_key 1 set xyz timeout 30000ms expr [ counter pkts 0 bytes 0 ] ] -
tests/py/ip6/flowtable.t deleted +0 -6
@@ -1,6 +0,0 @@ -:input;type filter hook input priority 0 - -*ip6;test-ip6;input - -meter acct_out size 4096 { meta iif . ip6 saddr timeout 600s counter };ok;meter acct_out size 4096 { iif . ip6 saddr timeout 10m counter } -meter acct_out size 12345 { ip6 saddr . meta iif timeout 600s counter };ok;meter acct_out size 12345 { ip6 saddr . iif timeout 10m counter }
tests/py/ip6/flowtable.t.json deleted +0 -62
62 lines not on this page · raw message
tests/py/ip6/flowtable.t.json.output deleted +0 -62
62 lines not on this page · raw message
tests/py/ip6/flowtable.t.payload deleted +0 -16
@@ -1,16 +0,0 @@ -# meter acct_out size 4096 { meta iif . ip6 saddr timeout 600s counter } -acct_out test-ip6 31 -acct_out test-ip6 0 -ip6 test-ip6 input - [ meta load iif => reg 1 ] - [ payload load 16b @ network header + 8 => reg 9 ] - [ dynset update reg_key 1 set acct_out timeout 600000ms expr [ counter pkts 0 bytes 0 ] ] - -# meter acct_out size 12345 { ip6 saddr . meta iif timeout 600s counter } -acct_out test-ip6 31 -acct_out test-ip6 0 -ip6 test-ip6 input - [ payload load 16b @ network header + 8 => reg 1 ] - [ meta load iif => reg 2 ] - [ dynset update reg_key 1 set acct_out timeout 600000ms expr [ counter pkts 0 bytes 0 ] ] -
tests/shell/testcases/sets/dumps/meter_0.json-nft new file +203 -0
203 lines not on this page · raw message
tests/shell/testcases/sets/dumps/meter_0.nft new file +29 -0
@@ -0,0 +1,29 @@ +table ip6 test { + set acct_out { + type iface_index . ipv6_addr + size 4096 + flags dynamic,timeout + } + + set acct_out2 { + type ipv6_addr . iface_index + size 12345 + flags dynamic,timeout + } + + chain test { + update @acct_out { iif . ip6 saddr timeout 10m counter } + update @acct_out2 { ip6 saddr . iif timeout 10m counter } + } +} +table ip test { + set xyz { + type ipv4_addr + size 8192 + flags dynamic,timeout + } + + chain test { + update @xyz { ip saddr timeout 30s counter } + } +}
tests/shell/testcases/sets/meter_0 new file +18 -0
@@ -0,0 +1,18 @@ +#!/bin/bash + +set -e + +RULESET="table ip6 test { + chain test { + meter acct_out size 4096 { meta iif . ip6 saddr timeout 600s counter } + meter acct_out2 size 12345 { ip6 saddr . meta iif timeout 600s counter } + } +} + +table ip test { + chain test { + meter xyz size 8192 { ip saddr timeout 30s counter} + } +}" + +$NFT -f - <<< $RULESET
Signature · 1 line
2.30.2
Quoted 2 lines · Pablo Neira Ayuso
Userspace performs an translation to dynamic set which does not fit well into tests/py, move them to tests/shell.
Acked-by Florian Westphal <[email protected]>