[ovs-dev] [PATCHv3 5/6] tests: Create dpif-netdev.at.

Joe Stringer joestringer at nicira.com
Thu May 15 06:57:25 UTC 2014


Shift datapath flow test macros and "ofproto-dpif - dummy interface" out
into a separate file.

Signed-off-by: Joe Stringer <joestringer at nicira.com>
---
v3: No change.
---
 tests/automake.mk     |    1 +
 tests/dpif-netdev.at  |   53 +++++++++++++++++++++++++++++++++++++++++++++++++
 tests/ofproto-dpif.at |   51 -----------------------------------------------
 tests/testsuite.at    |    1 +
 4 files changed, 55 insertions(+), 51 deletions(-)
 create mode 100644 tests/dpif-netdev.at

diff --git a/tests/automake.mk b/tests/automake.mk
index c115289..b427b22 100644
--- a/tests/automake.mk
+++ b/tests/automake.mk
@@ -37,6 +37,7 @@ TESTSUITE_AT = \
 	tests/lockfile.at \
 	tests/reconnect.at \
 	tests/ovs-vswitchd.at \
+	tests/dpif-netdev.at \
 	tests/ofproto-dpif.at \
 	tests/vlan-splinters.at \
 	tests/ofproto-macros.at \
diff --git a/tests/dpif-netdev.at b/tests/dpif-netdev.at
new file mode 100644
index 0000000..6e81354
--- /dev/null
+++ b/tests/dpif-netdev.at
@@ -0,0 +1,53 @@
+AT_BANNER([dpif-netdev])
+
+# 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_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]])
+m4_define([FILTER_FLOW_INSTALL], [[
+grep ' put' | sed '
+    s/.*put\[create\]\[modify\] //
+' | sort | uniq]])
+m4_define([FILTER_FLOW_DUMP], [[
+grep 'flow_dump ' | sed '
+    s/.*flow_dump //
+    s/used:[0-9]*\.[0-9]*/used:0.0/
+' | sort | uniq]])
+
+AT_SETUP([dpif-netdev - 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-appctl vlog/set dpif:dbg])
+
+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
+sleep 1  # wait for forwarders process packets
+
+AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
+skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/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),icmp(type=8/0,code=0/0), actions: <del>
+skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/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),icmp(type=8/0,code=0/0), actions: <del>
+skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/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),icmp(type=8/0,code=0/0), actions: <del>
+skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/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),icmp(type=8/0,code=0/0), actions: <del>
+])
+
+OVS_VSWITCHD_STOP
+AT_CLEANUP
diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at
index 9e387c1..1eb3ac1 100644
--- a/tests/ofproto-dpif.at
+++ b/tests/ofproto-dpif.at
@@ -1,56 +1,5 @@
 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_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]])
-m4_define([FILTER_FLOW_INSTALL], [[
-grep ' put' | sed '
-    s/.*put\[create\]\[modify\] //
-' | sort | uniq]])
-m4_define([FILTER_FLOW_DUMP], [[
-grep 'flow_dump ' | sed '
-    s/.*flow_dump //
-    s/used:[0-9]*\.[0-9]*/used:0.0/
-' | sort | uniq]])
-
-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-appctl vlog/set dpif:dbg])
-
-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
-sleep 1  # wait for forwarders process packets
-
-AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
-skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/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),icmp(type=8/0,code=0/0), actions: <del>
-skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/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),icmp(type=8/0,code=0/0), actions: <del>
-skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/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),icmp(type=8/0,code=0/0), actions: <del>
-skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/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),icmp(type=8/0,code=0/0), actions: <del>
-])
-OVS_VSWITCHD_STOP
-AT_CLEANUP
-
 AT_SETUP([ofproto-dpif, active-backup bonding])
 # Create br0 with interfaces p1, p2 and p7, creating bond0 with p1 and p2
 #    and br1 with interfaces p3, p4 and p8.
diff --git a/tests/testsuite.at b/tests/testsuite.at
index 264a15f..1911ac6 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -145,6 +145,7 @@ m4_include([tests/lockfile.at])
 m4_include([tests/reconnect.at])
 m4_include([tests/ovs-vswitchd.at])
 m4_include([tests/ofproto.at])
+m4_include([tests/dpif-netdev.at])
 m4_include([tests/ofproto-dpif.at])
 m4_include([tests/vlan-splinters.at])
 m4_include([tests/ovsdb.at])
-- 
1.7.10.4




More information about the dev mailing list