summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/py/inet/socket.t9
-rw-r--r--tests/py/inet/socket.t.payload30
2 files changed, 39 insertions, 0 deletions
diff --git a/tests/py/inet/socket.t b/tests/py/inet/socket.t
new file mode 100644
index 00000000..8edfa78d
--- /dev/null
+++ b/tests/py/inet/socket.t
@@ -0,0 +1,9 @@
+:sockchain;type filter hook prerouting priority -150
+
+*ip;sockip4;sockchain
+*ip6;sockip6;sockchain
+*inet;sockin;sockchain
+
+socket transparent 0;ok
+socket transparent 1;ok
+socket transparent 2;fail
diff --git a/tests/py/inet/socket.t.payload b/tests/py/inet/socket.t.payload
new file mode 100644
index 00000000..acad2ace
--- /dev/null
+++ b/tests/py/inet/socket.t.payload
@@ -0,0 +1,30 @@
+# socket transparent 0
+ip sockip4 sockchain
+ [ socket load transparent => reg 1 ]
+ [ cmp eq reg 1 0x00000000 ]
+
+# socket transparent 0
+ip6 sockip6 sockchain
+ [ socket load transparent => reg 1 ]
+ [ cmp eq reg 1 0x00000000 ]
+
+# socket transparent 0
+inet sockin sockchain
+ [ socket load transparent => reg 1 ]
+ [ cmp eq reg 1 0x00000000 ]
+
+# socket transparent 1
+ip sockip4 sockchain
+ [ socket load transparent => reg 1 ]
+ [ cmp eq reg 1 0x00000001 ]
+
+# socket transparent 1
+ip6 sockip6 sockchain
+ [ socket load transparent => reg 1 ]
+ [ cmp eq reg 1 0x00000001 ]
+
+# socket transparent 1
+inet sockin sockchain
+ [ socket load transparent => reg 1 ]
+ [ cmp eq reg 1 0x00000001 ]
+