diff options
-rw-r--r-- | tests/py/netdev/reject.t.json | 66 | ||||
-rw-r--r-- | tests/py/netdev/reject.t.json.output | 81 |
2 files changed, 126 insertions, 21 deletions
diff --git a/tests/py/netdev/reject.t.json b/tests/py/netdev/reject.t.json index 9968aaf8..b80db03b 100644 --- a/tests/py/netdev/reject.t.json +++ b/tests/py/netdev/reject.t.json @@ -134,17 +134,6 @@ "match": { "left": { "meta": { - "key": "l4proto" - } - }, - "op": "==", - "right": 6 - } - }, - { - "match": { - "left": { - "meta": { "key": "mark" } }, @@ -162,30 +151,43 @@ # reject [ { - "reject": { - "expr": "port-unreachable", - "type": "icmpx" - } + "reject": null } ] # meta protocol ip reject [ { - "reject": { - "expr": "port-unreachable", - "type": "icmp" + "match": { + "left": { + "meta": { + "key": "protocol" + } + }, + "op": "==", + "right": "ip" } + }, + { + "reject": null } ] # meta protocol ip6 reject [ { - "reject": { - "expr": "port-unreachable", - "type": "icmpv6" + "match": { + "left": { + "meta": { + "key": "protocol" + } + }, + "op": "==", + "right": "ip6" } + }, + { + "reject": null } ] @@ -232,6 +234,17 @@ # meta protocol ip reject with icmp host-unreachable [ { + "match": { + "left": { + "meta": { + "key": "protocol" + } + }, + "op": "==", + "right": "ip" + } + }, + { "reject": { "expr": "host-unreachable", "type": "icmp" @@ -242,6 +255,17 @@ # meta protocol ip6 reject with icmpv6 no-route [ { + "match": { + "left": { + "meta": { + "key": "protocol" + } + }, + "op": "==", + "right": "ip6" + } + }, + { "reject": { "expr": "no-route", "type": "icmpv6" diff --git a/tests/py/netdev/reject.t.json.output b/tests/py/netdev/reject.t.json.output new file mode 100644 index 00000000..cbd73104 --- /dev/null +++ b/tests/py/netdev/reject.t.json.output @@ -0,0 +1,81 @@ +# mark 12345 reject with tcp reset +[ + { + "match": { + "left": { + "meta": { + "key": "l4proto" + } + }, + "op": "==", + "right": 6 + } + }, + { + "match": { + "left": { + "meta": { + "key": "mark" + } + }, + "op": "==", + "right": 12345 + } + }, + { + "reject": { + "type": "tcp reset" + } + } +] + +# reject +[ + { + "reject": { + "expr": "port-unreachable", + "type": "icmpx" + } + } +] + +# meta protocol ip reject +[ + { + "reject": { + "expr": "port-unreachable", + "type": "icmp" + } + } +] + +# meta protocol ip6 reject +[ + { + "reject": { + "expr": "port-unreachable", + "type": "icmpv6" + } + } +] + +# meta protocol ip reject with icmp host-unreachable +[ + { + "reject": { + "expr": "host-unreachable", + "type": "icmp" + } + } +] + +# meta protocol ip6 reject with icmpv6 no-route +[ + { + "reject": { + "expr": "no-route", + "type": "icmpv6" + } + } +] + |