[nft,2/2] test: Added test cases for socket matching

Message ID ae545eb3583cad8bccade24e28148370974a4cf6.1526542099.git.ecklm94@gmail.com
State Changes Requested
Delegated to: Pablo Neira
Headers show
Series
  • Python test fixes
Related show

Commit Message

Máté Eckl May 17, 2018, 7:36 a.m.
Signed-off-by: Máté Eckl <ecklm94@gmail.com>
---
 tests/py/inet/socket.t         | 10 ++++++++++
 tests/py/inet/socket.t.payload |  8 ++++++++
 2 files changed, 18 insertions(+)
 create mode 100644 tests/py/inet/socket.t
 create mode 100644 tests/py/inet/socket.t.payload

Patch

diff --git a/tests/py/inet/socket.t b/tests/py/inet/socket.t
new file mode 100644
index 0000000..7782c3c
--- /dev/null
+++ b/tests/py/inet/socket.t
@@ -0,0 +1,10 @@ 
+:sockchain;type filter hook prerouting priority -150
+
+*ip;sockip4;sockchain
+*ip6;sockip6;sockchain
+
+# For now, it does not work for inet tables
+
+socket exists;ok
+socket flags transparent;ok
+
diff --git a/tests/py/inet/socket.t.payload b/tests/py/inet/socket.t.payload
new file mode 100644
index 0000000..05ece70
--- /dev/null
+++ b/tests/py/inet/socket.t.payload
@@ -0,0 +1,8 @@ 
+# socket exists
+ip sockip4 sockchain 
+  [ match name socket rev 3 ]
+
+# socket flags transparent
+ip sockip4 sockchain 
+  [ match name socket rev 3 ]
+