diff options
author | Jeremy Sowden <jeremy@azazel.net> | 2020-02-03 11:20:23 +0000 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2020-02-07 16:57:30 +0100 |
commit | a16920d3620d9b7130c994a26c0b86f8b357103e (patch) | |
tree | 304151f8693cee6740a276b6422ef7d75b4d9ec2 /tests/py/any/ct.t.payload | |
parent | 2674c39bfdb77e5d61a44ebf6e5c356ac767cd24 (diff) |
tests: py: add bit-shift tests.
Add a couple of Python test-cases for setting the CT mark to a bitwise
expression derived from the packet mark and vice versa.
Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'tests/py/any/ct.t.payload')
-rw-r--r-- | tests/py/any/ct.t.payload | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/py/any/ct.t.payload b/tests/py/any/ct.t.payload index bdc6a70e..66159125 100644 --- a/tests/py/any/ct.t.payload +++ b/tests/py/any/ct.t.payload @@ -329,6 +329,27 @@ ip test-ip4 output [ meta load mark => reg 1 ] [ ct set mark with reg 1 ] +# ct mark set (meta mark | 0x10) << 8 +ip test-ip4 output + [ meta load mark => reg 1 ] + [ bitwise reg 1 = (reg=1 & 0xffffffef ) ^ 0x00000010 ] + [ bitwise reg 1 = ( reg 1 << 0x00000008 ) ] + [ ct set mark with reg 1 ] + +# ct mark set (meta mark | 0x10) << 8 +ip6 test-ip6 output + [ meta load mark => reg 1 ] + [ bitwise reg 1 = (reg=1 & 0xffffffef ) ^ 0x00000010 ] + [ bitwise reg 1 = ( reg 1 << 0x00000008 ) ] + [ ct set mark with reg 1 ] + +# ct mark set (meta mark | 0x10) << 8 +inet test-inet output + [ meta load mark => reg 1 ] + [ bitwise reg 1 = (reg=1 & 0xffffffef ) ^ 0x00000010 ] + [ bitwise reg 1 = ( reg 1 << 0x00000008 ) ] + [ ct set mark with reg 1 ] + # ct mark set mark map { 1 : 10, 2 : 20, 3 : 30 } __map%d test-ip4 b __map%d test-ip4 0 |