From 8221d86e616bdd5e9828c3eefb7cfb9abc3d211a Mon Sep 17 00:00:00 2001 From: Jeremy Sowden Date: Fri, 17 Mar 2023 10:16:48 +0100 Subject: tests: py: add test-cases for ct and packet mark payload expressions Add new test-cases to verify that defining a rule that sets the ct or packet mark to a value derived from a payload works correctly. Signed-off-by: Jeremy Sowden Signed-off-by: Pablo Neira Ayuso --- tests/py/ip/ct.t.json | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) (limited to 'tests/py/ip/ct.t.json') diff --git a/tests/py/ip/ct.t.json b/tests/py/ip/ct.t.json index 3288413f..e739b5f6 100644 --- a/tests/py/ip/ct.t.json +++ b/tests/py/ip/ct.t.json @@ -325,3 +325,61 @@ } } ] + +# ct mark set ip dscp << 2 | 0x10 +[ + { + "mangle": { + "key": { + "ct": { + "key": "mark" + } + }, + "value": { + "|": [ + { + "<<": [ + { + "payload": { + "field": "dscp", + "protocol": "ip" + } + }, + 2 + ] + }, + 16 + ] + } + } + } +] + +# ct mark set ip dscp << 26 | 0x10 +[ + { + "mangle": { + "key": { + "ct": { + "key": "mark" + } + }, + "value": { + "|": [ + { + "<<": [ + { + "payload": { + "field": "dscp", + "protocol": "ip" + } + }, + 26 + ] + }, + 16 + ] + } + } + } +] -- cgit v1.2.3