[netfilter-cvslog] r3301 - trunk/nfsim-testsuite/01iptables

rusty at netfilter.org rusty at netfilter.org
Thu Nov 25 06:25:56 CET 2004


Author: rusty at netfilter.org
Date: 2004-11-25 06:25:56 +0100 (Thu, 25 Nov 2004)
New Revision: 3301

Added:
   trunk/nfsim-testsuite/01iptables/20ipt_MARK.sim
Log:
Test MARK extensions.


Added: trunk/nfsim-testsuite/01iptables/20ipt_MARK.sim
===================================================================
--- trunk/nfsim-testsuite/01iptables/20ipt_MARK.sim	2004-11-25 05:25:12 UTC (rev 3300)
+++ trunk/nfsim-testsuite/01iptables/20ipt_MARK.sim	2004-11-25 05:25:56 UTC (rev 3301)
@@ -0,0 +1,70 @@
+# Test the ipt_MARK target, which has a backwards compatbility mode.
+
+# Test old-style first, insert and delete.
+iptables -t mangle -A PREROUTING -j MARK --set-mark 7
+iptables -t mangle -D PREROUTING -j MARK --set-mark 7
+
+iptables -t mangle -A PREROUTING -s 192.160.0.2 -j MARK --set-mark 7
+iptables -t mangle -D PREROUTING -s 192.160.0.2 -j MARK --set-mark 7
+
+# Test that it works.
+iptables -t mangle -A PREROUTING -j MARK --set-mark 7
+expect gen_ip send:eth1 MARK 7 {IPv4 192.168.0.2 192.168.1.2 10 17 1 2}
+gen_ip IF=eth0 192.168.0.2 192.168.1.2 10 17 1 2
+iptables -t mangle -D PREROUTING -j MARK --set-mark 7
+
+# Test new-style, insert and delete.
+iptables -t mangle -A PREROUTING -j MARK --or-mark 7
+iptables -t mangle -D PREROUTING -j MARK --or-mark 7
+
+iptables -t mangle -A PREROUTING -j MARK --and-mark 7
+iptables -t mangle -D PREROUTING -j MARK --and-mark 7
+
+iptables -t mangle -A PREROUTING -s 192.160.0.2 -j MARK --or-mark 7
+iptables -t mangle -D PREROUTING -s 192.160.0.2 -j MARK --or-mark 7
+
+iptables -t mangle -A PREROUTING -s 192.160.0.2 -j MARK --and-mark 7
+iptables -t mangle -D PREROUTING -s 192.160.0.2 -j MARK --and-mark 7
+
+# Test that they work.
+iptables -t mangle -A PREROUTING -j MARK --or-mark 7
+expect gen_ip send:eth1 MARK 7 {IPv4 192.168.0.2 192.168.1.2 10 17 1 2}
+gen_ip IF=eth0 192.168.0.2 192.168.1.2 10 17 1 2
+iptables -t mangle -D PREROUTING -j MARK --or-mark 7
+
+iptables -t mangle -A PREROUTING -j MARK --set-mark 3
+iptables -t mangle -A PREROUTING -j MARK --or-mark 4
+expect gen_ip send:eth1 MARK 7 {IPv4 192.168.0.2 192.168.1.2 10 17 1 2}
+gen_ip IF=eth0 192.168.0.2 192.168.1.2 10 17 1 2
+iptables -t mangle -D PREROUTING -j MARK --set-mark 3
+iptables -t mangle -D PREROUTING -j MARK --or-mark 4
+
+iptables -t mangle -A PREROUTING -j MARK --set-mark 3
+iptables -t mangle -A PREROUTING -j MARK --and-mark 6
+expect gen_ip send:eth1 MARK 2 {IPv4 192.168.0.2 192.168.1.2 10 17 1 2}
+gen_ip IF=eth0 192.168.0.2 192.168.1.2 10 17 1 2
+iptables -t mangle -D PREROUTING -j MARK --set-mark 3
+iptables -t mangle -D PREROUTING -j MARK --and-mark 6
+
+# Now mix them up: check we delete the right one.
+iptables -t mangle -A PREROUTING -j MARK --set-mark 7
+iptables -t mangle -A PREROUTING -j MARK --or-mark 7
+iptables -t mangle -A PREROUTING -j MARK --and-mark 7
+
+# Delete old-style.
+iptables -t mangle -D PREROUTING -j MARK --set-mark 7
+expect iptables iptables: command failed
+iptables -t mangle -D PREROUTING -j MARK --set-mark 7
+iptables -t mangle -A PREROUTING -j MARK --set-mark 7
+
+# Delete or.
+iptables -t mangle -D PREROUTING -j MARK --or-mark 7
+expect iptables iptables: command failed
+iptables -t mangle -D PREROUTING -j MARK --or-mark 7
+iptables -t mangle -A PREROUTING -j MARK --or-mark 7
+
+# Delete and.
+iptables -t mangle -D PREROUTING -j MARK --and-mark 7
+expect iptables iptables: command failed
+iptables -t mangle -D PREROUTING -j MARK --and-mark 7
+iptables -t mangle -A PREROUTING -j MARK --and-mark 7




More information about the netfilter-cvslog mailing list