summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAndy Zhou <azhou@nicira.com>2013-12-18 13:55:25 -0800
committerAndy Zhou <azhou@nicira.com>2014-01-23 16:08:53 -0800
commit631486bd29dc6cfe2dc7cf65495d308f4c7fca56 (patch)
treed32b7d0a421abb38fd06ee0889e92385941383b4 /tests
parent9c8ad495ec332a29b4e101c00b0b0341631a4d20 (diff)
downloadopenvswitch-631486bd29dc6cfe2dc7cf65495d308f4c7fca56.tar.gz
netdev-dummy: Add support for active stream
The dummy ports thus far only support passive connections. It can listen for multiple incoming connection requests but not make active connections. This patch adds support of active stream, so that a dummy port can be configured with either passive or active connections. The net result is that dummy ports can now connect to each other, without being patch ports. This feature will be useful in adding test cases of future commits. Signed-off-by: Andy Zhou <azhou@nicira.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/ofproto-dpif.at58
1 files changed, 46 insertions, 12 deletions
diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at
index 730bb9154..23a1f1480 100644
--- a/tests/ofproto-dpif.at
+++ b/tests/ofproto-dpif.at
@@ -1,5 +1,51 @@
AT_BANNER([ofproto-dpif])
+# Strips out uninteresting parts of flow output, as well as parts
+# that vary from one run to another (e.g., timing and bond actions).
+m4_define([STRIP_USED], [[sed '
+ s/used:[0-9]*\.[0-9]*/used:0.0/
+' | sort]])
+m4_define([STRIP_XOUT], [[sed '
+ s/used:[0-9]*\.[0-9]*/used:0.0/
+ s/actions:.*/actions: <del>/
+ s/packets:[0-9]*/packets:0/
+ s/bytes:[0-9]*/bytes:0/
+' | sort]])
+
+AT_SETUP([ofproto-dpif - dummy interface])
+# Create br0 with interfaces p1 and p7
+# and br1 with interfaces p2 and p8
+# with p1 and p2 connected via unix domain socket
+OVS_VSWITCHD_START(
+ [add-port br0 p1 -- set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p0.sock ofport_request=1 -- \
+ add-port br0 p7 -- set interface p7 ofport_request=7 type=dummy -- \
+ add-br br1 -- \
+ set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
+ set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
+ fail-mode=secure -- \
+ add-port br1 p2 -- set interface p2 type=dummy options:stream=unix:$OVS_RUNDIR/p0.sock ofport_request=2 -- \
+ add-port br1 p8 -- set interface p8 ofport_request=8 type=dummy --])
+
+AT_CHECK([ovs-ofctl add-flow br0 action=normal])
+AT_CHECK([ovs-ofctl add-flow br1 action=normal])
+ovs-appctl time/stop
+ovs-appctl time/warp 5000
+AT_CHECK([ovs-appctl netdev-dummy/receive p7 'in_port(7),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
+AT_CHECK([ovs-appctl netdev-dummy/receive p8 'in_port(8),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.3,dst=10.0.0.4,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
+ovs-appctl time/warp 100
+
+AT_CHECK([ovs-appctl dpif/dump-flows br0 | STRIP_XOUT], [0], [dnl
+skb_priority(0),in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.3/0.0.0.0,dst=10.0.0.4/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff), packets:0, bytes:0, used:never, actions: <del>
+skb_priority(0),in_port(7),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff), packets:0, bytes:0, used:never, actions: <del>
+])
+
+AT_CHECK([ovs-appctl dpif/dump-flows br1 | STRIP_XOUT], [0], [dnl
+skb_priority(0),in_port(2),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff), packets:0, bytes:0, used:never, actions: <del>
+skb_priority(0),in_port(8),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.3/0.0.0.0,dst=10.0.0.4/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff), packets:0, bytes:0, used:never, actions: <del>
+])
+OVS_VSWITCHD_STOP
+AT_CLEANUP
+
AT_SETUP([ofproto-dpif - resubmit])
OVS_VSWITCHD_START
ADD_OF_PORTS([br0], [1], [10], [11], [12], [13], [14], [15],
@@ -2466,18 +2512,6 @@ AT_CLEANUP
dnl ----------------------------------------------------------------------
AT_BANNER([ofproto-dpif -- megaflows])
-# Strips out uninteresting parts of megaflow output, as well as parts
-# that vary from one run to another (e.g., timing and bond actions).
-m4_define([STRIP_USED], [[sed '
- s/used:[0-9]*\.[0-9]*/used:0.0/
-' | sort]])
-m4_define([STRIP_XOUT], [[sed '
- s/used:[0-9]*\.[0-9]*/used:0.0/
- s/actions:.*/actions: <del>/
- s/packets:[0-9]*/packets:0/
- s/bytes:[0-9]*/bytes:0/
-' | sort]])
-
AT_SETUP([ofproto-dpif megaflow - port classification])
OVS_VSWITCHD_START
ADD_OF_PORTS([br0], [1], [2])