]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests: monitor: update insert and replace commands
authorPablo Neira Ayuso <pablo@netfilter.org>
Fri, 24 Sep 2021 23:34:36 +0000 (01:34 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 29 Sep 2021 16:59:44 +0000 (18:59 +0200)
Adjust test after these two kernel fixes:

("netfilter: nf_tables: reverse order in rule replacement expansion")
("netfilter: nf_tables: add position handle in event notification")

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
tests/monitor/testcases/simple.t

index 78fd6616eb074c442f84db48963c3ae6340c1dba..2d9c92de25dd363cee940db28de7677ec3e073cb 100644 (file)
@@ -14,12 +14,12 @@ O -
 J {"add": {"rule": {"family": "ip", "table": "t", "chain": "c", "handle": 0, "expr": [{"match": {"op": "==", "left": {"payload": {"protocol": "tcp", "field": "dport"}}, "right": {"set": [22, 80, 443]}}}, {"accept": null}]}}}
 
 I insert rule ip t c counter accept
-O add rule ip t c counter packets 0 bytes 0 accept
+O insert rule ip t c counter packets 0 bytes 0 accept
 J {"add": {"rule": {"family": "ip", "table": "t", "chain": "c", "handle": 0, "expr": [{"counter": {"packets": 0, "bytes": 0}}, {"accept": null}]}}}
 
 I replace rule ip t c handle 2 accept comment "foo bar"
-O add rule ip t c accept comment "foo bar"
 O delete rule ip t c handle 2
+O add rule ip t c handle 5 accept comment "foo bar"
 J {"add": {"rule": {"family": "ip", "table": "t", "chain": "c", "handle": 0, "comment": "foo bar", "expr": [{"accept": null}]}}}
 J {"delete": {"rule": {"family": "ip", "table": "t", "chain": "c", "handle": 0, "expr": [{"accept": null}]}}}