From f554a7eaa1d45c1cb430def51d8b4b288000eec0 Mon Sep 17 00:00:00 2001 From: Balazs Scheidler Date: Sat, 29 Aug 2020 09:04:04 +0200 Subject: tests: added "socket wildcard" testcases Signed-off-by: Balazs Scheidler Signed-off-by: Pablo Neira Ayuso --- tests/py/inet/socket.t | 4 ++++ tests/py/inet/socket.t.json | 29 +++++++++++++++++++++++++++++ tests/py/inet/socket.t.payload | 29 +++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+) (limited to 'tests/py/inet') diff --git a/tests/py/inet/socket.t b/tests/py/inet/socket.t index 91846e8e..05e9ebb4 100644 --- a/tests/py/inet/socket.t +++ b/tests/py/inet/socket.t @@ -9,3 +9,7 @@ socket transparent 1;ok socket transparent 2;fail socket mark 0x00000005;ok + +socket wildcard 0;ok +socket wildcard 1;ok +socket wildcard 2;fail diff --git a/tests/py/inet/socket.t.json b/tests/py/inet/socket.t.json index 99d6e248..fa48e79d 100644 --- a/tests/py/inet/socket.t.json +++ b/tests/py/inet/socket.t.json @@ -43,3 +43,32 @@ } ] +# socket wildcard 0 +[ + { + "match": { + "left": { + "socket": { + "key": "wildcard" + } + }, + "op": "==", + "right": 0 + } + } +] + +# socket wildcard 1 +[ + { + "match": { + "left": { + "socket": { + "key": "wildcard" + } + }, + "op": "==", + "right": 1 + } + } +] diff --git a/tests/py/inet/socket.t.payload b/tests/py/inet/socket.t.payload index 687b7a45..79fcea79 100644 --- a/tests/py/inet/socket.t.payload +++ b/tests/py/inet/socket.t.payload @@ -43,3 +43,32 @@ inet sockin sockchain [ socket load mark => reg 1 ] [ cmp eq reg 1 0x00000005 ] +# socket wildcard 0 +ip sockip4 sockchain + [ socket load wildcard => reg 1 ] + [ cmp eq reg 1 0x00000000 ] + +# socket wildcard 0 +ip6 sockip6 sockchain + [ socket load wildcard => reg 1 ] + [ cmp eq reg 1 0x00000000 ] + +# socket wildcard 0 +inet sockin sockchain + [ socket load wildcard => reg 1 ] + [ cmp eq reg 1 0x00000000 ] + +# socket wildcard 1 +ip sockip4 sockchain + [ socket load wildcard => reg 1 ] + [ cmp eq reg 1 0x00000001 ] + +# socket wildcard 1 +ip6 sockip6 sockchain + [ socket load wildcard => reg 1 ] + [ cmp eq reg 1 0x00000001 ] + +# socket wildcard 1 +inet sockin sockchain + [ socket load wildcard => reg 1 ] + [ cmp eq reg 1 0x00000001 ] -- cgit v1.2.3