[ovs-dev] [PATCH 7/7] system-event: add event testsuite

Gowrishankar Muthukrishnan gmuthukr at redhat.com
Tue Jun 2 10:09:49 UTC 2020


Add iperf3 performance testsuite for checking events.

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukr at redhat.com>
---
This is not complete test suite as I would like to get first set of 
feedbacks on implementation and write unit tests accordingly. This
test is to check if event API works expectedly while running some
traffic profile.

Run ovs-testeventd before test (though not mandatory if "notify:"
is removed in json file as test generates).

$ sudo sh -c "while true;do ./utilities/ovs-testeventd /tmp/event.sock;done"
$ sudo -E PATH=$DPDK_BUILD/app:$PATH make check-event
$ for i in `seq 1 4`;do echo test $i; pushd tests/system-event-testsuite.dir/$i > /dev/null; grep 'sender' -A1 -B1 system-event-testsuite.log; cat event_list;popd > /dev/null; done

Sample results from my VM (not server :) ):

test 1
[ ID] Interval           Transfer     Bandwidth       Retr
[  4]   0.00-10.00  sec   296 MBytes   249 Mbits/sec  837             sender
[  4]   0.00-10.00  sec   294 MBytes   246 Mbits/sec                  receiver
List of events:
netdev_send:
  resource       : timer
  no_of_samples  : 50
  max duration   : 349 (us)
  min duration   : 3 (us)
  95% of times   : 169.623093 (us)
  hit count      : 10

rte_vhost_enqueue_burst:
  resource       : timer
  no_of_samples  : 50
  max duration   : 43 (us)
  min duration   : 1 (us)
  95% of times   : 3.891219 (us)
  hit count      : 10

List of events not yet added:
test 2
[ ID] Interval           Transfer     Bandwidth       Retr
[  4]   0.00-10.01  sec   267 MBytes   224 Mbits/sec   31             sender
[  4]   0.00-10.01  sec   266 MBytes   223 Mbits/sec                  receiver
List of events:
netdev_send:
  resource       : timer
  no_of_samples  : 50
  max duration   : 283 (us)
  min duration   : 2 (us)
  95% of times   : 150.735806 (us)
  hit count      : 10

rte_vhost_enqueue_burst:
  resource       : timer
  no_of_samples  : 50
  max duration   : 7 (us)
  min duration   : 1 (us)
  95% of times   : 3.955793 (us)
  hit count      : 10

List of events not yet added:
test 3
[ ID] Interval           Transfer     Bandwidth       Retr
[  4]   0.00-10.00  sec   326 MBytes   273 Mbits/sec  599             sender
[  4]   0.00-10.00  sec   323 MBytes   270 Mbits/sec                  receiver
List of events:
netdev_send:
  resource       : timer
  no_of_samples  : 50
  max duration   : 278 (us)
  min duration   : 6 (us)
  95% of times   : 179.230316 (us)
  hit count      : 10

rte_vhost_enqueue_burst:
  resource       : timer
  no_of_samples  : 50
  max duration   : 39 (us)
  min duration   : 1 (us)
  95% of times   : 4.549241 (us)
  hit count      : 10

List of events not yet added:
test 4
[ ID] Interval           Transfer     Bandwidth       Retr
[  4]   0.00-10.01  sec   257 MBytes   216 Mbits/sec   75             sender
[  4]   0.00-10.01  sec   256 MBytes   214 Mbits/sec                  receiver
List of events:
netdev_send:
  resource       : timer
  no_of_samples  : 50
  max duration   : 428 (us)
  min duration   : 4 (us)
  95% of times   : 129.270144 (us)
  hit count      : 11

rte_vhost_enqueue_burst:
  resource       : timer
  no_of_samples  : 50
  max duration   : 12 (us)
  min duration   : 1 (us)
  95% of times   : 3.113697 (us)
  hit count      : 11

List of events not yet added:

---
 tests/automake.mk     |  18 +++
 tests/system-event.at | 351 ++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 369 insertions(+)
 create mode 100644 tests/system-event.at

diff --git a/tests/automake.mk b/tests/automake.mk
index cbba5b1..ea8f318 100644
--- a/tests/automake.mk
+++ b/tests/automake.mk
@@ -8,6 +8,7 @@ EXTRA_DIST += \
 	$(SYSTEM_AFXDP_TESTSUITE_AT) \
 	$(SYSTEM_OFFLOADS_TESTSUITE_AT) \
 	$(SYSTEM_DPDK_TESTSUITE_AT) \
+	$(SYSTEM_EVENT_TESTSUITE_AT) \
 	$(OVSDB_CLUSTER_TESTSUITE_AT) \
 	$(TESTSUITE) \
 	$(SYSTEM_KMOD_TESTSUITE) \
@@ -16,6 +17,7 @@ EXTRA_DIST += \
 	$(SYSTEM_AFXDP_TESTSUITE) \
 	$(SYSTEM_OFFLOADS_TESTSUITE) \
 	$(SYSTEM_DPDK_TESTSUITE) \
+	$(SYSTEM_EVENT_TESTSUITE) \
 	$(OVSDB_CLUSTER_TESTSUITE) \
 	tests/atlocal.in \
 	$(srcdir)/package.m4 \
@@ -184,6 +186,12 @@ SYSTEM_DPDK_TESTSUITE_AT = \
 	tests/system-dpdk-testsuite.at \
 	tests/system-dpdk.at
 
+SYSTEM_EVENT_TESTSUITE_AT = \
+	tests/system-common-macros.at \
+	tests/system-dpdk-macros.at \
+	tests/system-dpdk-testsuite.at \
+	tests/system-event.at
+
 check_SCRIPTS += tests/atlocal
 
 TESTSUITE = $(srcdir)/tests/testsuite
@@ -194,6 +202,7 @@ SYSTEM_TSO_TESTSUITE = $(srcdir)/tests/system-tso-testsuite
 SYSTEM_AFXDP_TESTSUITE = $(srcdir)/tests/system-afxdp-testsuite
 SYSTEM_OFFLOADS_TESTSUITE = $(srcdir)/tests/system-offloads-testsuite
 SYSTEM_DPDK_TESTSUITE = $(srcdir)/tests/system-dpdk-testsuite
+SYSTEM_EVENT_TESTSUITE = $(srcdir)/tests/system-event-testsuite
 OVSDB_CLUSTER_TESTSUITE = $(srcdir)/tests/ovsdb-cluster-testsuite
 DISTCLEANFILES += tests/atconfig tests/atlocal
 
@@ -356,6 +365,10 @@ check-dpdk: all
 	set $(SHELL) '$(SYSTEM_DPDK_TESTSUITE)' -C tests  AUTOTEST_PATH='$(AUTOTEST_PATH)'; \
 	"$$@" $(TESTSUITEFLAGS) -j1 || (test X'$(RECHECK)' = Xyes && "$$@" --recheck)
 
+check-event: all
+	set $(SHELL) '$(SYSTEM_EVENT_TESTSUITE)' -C tests  AUTOTEST_PATH='$(AUTOTEST_PATH)'; \
+	"$$@" $(TESTSUITEFLAGS) -j1 || (test X'$(RECHECK)' = Xyes && "$$@" --recheck)
+
 clean-local:
 	test ! -f '$(TESTSUITE)' || $(SHELL) '$(TESTSUITE)' -C tests --clean
 
@@ -401,6 +414,11 @@ $(SYSTEM_DPDK_TESTSUITE): package.m4 $(SYSTEM_TESTSUITE_AT) $(SYSTEM_DPDK_TESTSU
 	$(AM_V_GEN)$(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at
 	$(AM_V_at)mv $@.tmp $@
 
+$(SYSTEM_EVENT_TESTSUITE): package.m4 $(SYSTEM_TESTSUITE_AT) $(SYSTEM_EVENT_TESTSUITE_AT) $(COMMON_MACROS_AT)
+	$(AM_V_GEN)$(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at
+	$(AM_V_at)mv $@.tmp $@
+
+$(OVSDB_CLUSTER_TESTSUITE): package.m4 $(OVSDB_CLUSTER_TESTSUITE_AT) $(COMMON_MACROS_AT)
 $(OVSDB_CLUSTER_TESTSUITE): package.m4 $(OVSDB_CLUSTER_TESTSUITE_AT) $(COMMON_MACROS_AT)
 	$(AM_V_GEN)$(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at
 	$(AM_V_at)mv $@.tmp $@
diff --git a/tests/system-event.at b/tests/system-event.at
new file mode 100644
index 0000000..bc9ba1d
--- /dev/null
+++ b/tests/system-event.at
@@ -0,0 +1,351 @@
+m4_define([CONFIGURE_VETH_OFFLOADS],
+   [AT_CHECK([ethtool -K $1 tx off], [0], [ignore], [ignore])])
+
+m4_define([SET_NUMA_NODE],
+   [
+    AT_CHECK([lscpu | awk '/NUMA node\(s\)/ {c=1; while (c++<$(3)) {printf "$1,"}; print "$1"}' > NUMA_NODE])
+])
+
+m4_define([CREATE_EVENT_JSON],
+   [
+    AT_CHECK[cat > $abs_top_srcdir/tests/event.json <<EOF
+[
+  {
+    "name": "rte_vhost_enqueue_burst",
+    "type": "message",
+    "definition": {
+      "resource": "timer",
+      "samples": 50,
+      "unit": "us"
+    },
+    "notify": "/tmp/event.sock"
+  },
+  {
+    "name": "netdev_send",
+    "type": "message",
+    "definition": {
+      "resource": "timer",
+      "samples": 50,
+      "unit": "us"
+    },
+    "notify": "/tmp/event.sock"
+  }
+]
+EOF]
+])
+
+AT_BANNER([OVS-DPDK perf tests])
+
+dnl --------------------------------------------------------------------------
+dnl iperf on vhostuserclient (with userspace-tso)
+AT_SETUP([OVS-DPDK - iperf on vhostuserclient (with userspace-tso)])
+AT_KEYWORDS([dpdk])
+OVS_DPDK_PRE_CHECK()
+AT_SKIP_IF([! which testpmd >/dev/null 2>/dev/null])
+OVS_DB_START()
+AT_CHECK([ovs-vsctl --no-wait set Open_vSwitch . other_config:userspace-tso-enable=true])
+AT_CHECK([ovs-vsctl --no-wait set Open_vSwitch . other_config:user_defined_event_enable=true])
+OVS_DPDK_START()
+AT_CHECK([grep -c 'Userspace TCP Segmentation Offloading support enabled' \
+          ovs-vswitchd.log],[ignore],[dnl
+1
+])
+
+dnl Find number of sockets
+SET_NUMA_NODE([512])
+
+dnl Add userspace bridge and attach it to OVS
+AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev])
+AT_CHECK([ovs-vsctl add-port br10 dpdkvhostuserclient0 -- set Interface \
+          dpdkvhostuserclient0 \
+          type=dpdkvhostuserclient \
+          options:vhost-server-path=$OVS_RUNDIR/dpdkvhostclient0], [],
+         [stdout], [stderr])
+AT_CHECK([ovs-vsctl show], [], [stdout])
+
+dnl Set up namespaces
+ADD_NAMESPACES(ns1, ns2)
+
+dnl Add veth device
+ADD_VETH(tap1, ns2, br10, "172.31.110.12/24")
+
+dnl Execute testpmd in background
+on_exit "pkill -f -x -9 'tail -f /dev/null'"
+AT_CHECK([echo "show device info all" > CMDFILE])
+AT_CHECK([echo "show port 0 tx_offload capabilities" >> CMDFILE])
+tail -f /dev/null | testpmd --socket-mem="$(cat NUMA_NODE)" --no-pci\
+           --vdev="net_virtio_user,path=$OVS_RUNDIR/dpdkvhostclient0,server=1" \
+           --vdev="net_tap0,iface=tap0" --file-prefix page0 \
+           --single-file-segments -- --cmdline-file=CMDFILE \
+           -a >$OVS_RUNDIR/testpmd-dpdkvhostuserclient0.log 2>&1 &
+
+dnl Give settling time to the testpmd processes - NOTE: this is bad form.
+sleep 10
+
+dnl Move the tap devices to the namespaces
+AT_CHECK([ps aux | grep testpmd], [], [stdout], [stderr])
+AT_CHECK([ip link show], [], [stdout], [stderr])
+AT_CHECK([ip link set tap0 netns ns1], [], [stdout], [stderr])
+
+AT_CHECK([ip netns exec ns1 ip link show], [], [stdout], [stderr])
+AT_CHECK([ip netns exec ns1 ip link show | grep tap0], [], [stdout], [stderr])
+AT_CHECK([ip netns exec ns1 ip link set tap0 up], [], [stdout], [stderr])
+AT_CHECK([ip netns exec ns1 ip addr add 172.31.110.11/24 dev tap0], [],
+         [stdout], [stderr])
+
+AT_CHECK([ip netns exec ns1 ip link show], [], [stdout], [stderr])
+AT_CHECK([ip netns exec ns2 ip link show], [], [stdout], [stderr])
+AT_CHECK([ip netns exec ns1 ping -c 4 -I tap0 172.31.110.12], [], [stdout],
+         [stderr])
+
+CREATE_EVENT_JSON()
+AT_CHECK([ovs-appctl event/define $abs_top_srcdir/tests/event.json],[],[ignore])
+AT_CHECK([ip netns exec ns2 iperf3 -s -1 -D])
+AT_CHECK([ip netns exec ns1 iperf3 -c 172.31.110.12],[],[stdout])
+AT_CHECK([ovs-appctl event/list --all-timer > event_list])
+
+dnl Clean up
+AT_CHECK([ovs-vsctl del-port br10 dpdkvhostuserclient0], [], [stdout], [stderr])
+
+dnl Clean up the testpmd now
+pkill -f -x -9 'tail -f /dev/null'
+
+AT_FAIL_IF([true])
+OVS_VSWITCHD_STOP()
+AT_CLEANUP
+dnl --------------------------------------------------------------------------
+
+dnl --------------------------------------------------------------------------
+dnl iperf on vhostuser (with userspace-tso)
+AT_SETUP([OVS-DPDK - iperf on vhostuser (with userspace-tso)])
+AT_KEYWORDS([dpdk])
+OVS_DPDK_PRE_CHECK()
+AT_SKIP_IF([! which testpmd >/dev/null 2>/dev/null])
+OVS_DB_START()
+AT_CHECK([ovs-vsctl --no-wait set Open_vSwitch . other_config:userspace-tso-enable=true])
+AT_CHECK([ovs-vsctl --no-wait set Open_vSwitch . other_config:user_defined_event_enable=true])
+OVS_DPDK_START()
+AT_CHECK([grep -c 'Userspace TCP Segmentation Offloading support enabled' \
+          ovs-vswitchd.log],[ignore],[dnl
+1
+])
+
+dnl Find number of sockets
+SET_NUMA_NODE([512])
+
+dnl Add userspace bridge and attach it to OVS
+AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev])
+AT_CHECK([ovs-vsctl add-port br10 dpdkvhostuser0 -- set Interface dpdkvhostuser0 \
+          type=dpdkvhostuser], [],
+         [stdout], [stderr])
+AT_CHECK([ovs-vsctl show], [], [stdout])
+
+dnl Set up namespaces
+ADD_NAMESPACES(ns1, ns2)
+
+dnl Add veth device
+ADD_VETH(tap1, ns2, br10, "172.31.110.12/24")
+
+dnl Execute testpmd in background
+on_exit "pkill -f -x -9 'tail -f /dev/null'"
+AT_CHECK([echo "show device info all" > CMDFILE])
+AT_CHECK([echo "show port 0 tx_offload capabilities" >> CMDFILE])
+tail -f /dev/null | testpmd --socket-mem="$(cat NUMA_NODE)" --no-pci\
+           --vdev="net_virtio_user,path=$OVS_RUNDIR/dpdkvhostuser0" \
+           --vdev="net_tap0,iface=tap0" --file-prefix page0 \
+           --single-file-segments -- --cmdline-file=CMDFILE \
+           -a >$OVS_RUNDIR/testpmd-dpdkvhostuser0.log 2>&1 &
+
+dnl Give settling time to the testpmd processes - NOTE: this is bad form.
+sleep 10
+
+dnl Move the tap devices to the namespaces
+AT_CHECK([ps aux | grep testpmd], [], [stdout], [stderr])
+AT_CHECK([ip link show], [], [stdout], [stderr])
+AT_CHECK([ip link set tap0 netns ns1], [], [stdout], [stderr])
+
+AT_CHECK([ip netns exec ns1 ip link show], [], [stdout], [stderr])
+AT_CHECK([ip netns exec ns1 ip link show | grep tap0], [], [stdout], [stderr])
+AT_CHECK([ip netns exec ns1 ip link set tap0 up], [], [stdout], [stderr])
+AT_CHECK([ip netns exec ns1 ip addr add 172.31.110.11/24 dev tap0], [],
+         [stdout], [stderr])
+
+AT_CHECK([ip netns exec ns1 ip link show], [], [stdout], [stderr])
+AT_CHECK([ip netns exec ns2 ip link show], [], [stdout], [stderr])
+AT_CHECK([ip netns exec ns1 ping -c 4 -I tap0 172.31.110.12], [], [stdout],
+         [stderr])
+
+CREATE_EVENT_JSON()
+AT_CHECK([ovs-appctl event/define $abs_top_srcdir/tests/event.json],[],[ignore])
+AT_CHECK([ip netns exec ns2 iperf3 -s -1 -D])
+AT_CHECK([ip netns exec ns1 iperf3 -c 172.31.110.12],[],[stdout])
+AT_CHECK([ovs-appctl event/list --all-timer > event_list])
+
+dnl Clean up the testpmd now
+pkill -f -x -9 'tail -f /dev/null'
+
+dnl Clean up
+AT_CHECK([ovs-vsctl del-port br10 dpdkvhostuser0], [], [stdout], [stderr])
+
+AT_FAIL_IF([true])
+OVS_VSWITCHD_STOP()
+AT_CLEANUP
+dnl --------------------------------------------------------------------------
+
+dnl --------------------------------------------------------------------------
+dnl iperf on vhostuserclient (without userspace-tso)
+AT_SETUP([OVS-DPDK - iperf on vhostuserclient (without userspace-tso)])
+AT_KEYWORDS([dpdk])
+OVS_DPDK_PRE_CHECK()
+AT_SKIP_IF([! which testpmd >/dev/null 2>/dev/null])
+OVS_DB_START()
+AT_CHECK([ovs-vsctl --no-wait set Open_vSwitch . other_config:userspace-tso-enable=false])
+AT_CHECK([ovs-vsctl --no-wait set Open_vSwitch . other_config:user_defined_event_enable=true])
+OVS_DPDK_START()
+AT_CHECK([grep -c 'Userspace TCP Segmentation Offloading support enabled' \
+          ovs-vswitchd.log],[ignore],[dnl
+0
+])
+
+dnl Find number of sockets
+SET_NUMA_NODE([512])
+
+dnl Add userspace bridge and attach it to OVS
+AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev])
+AT_CHECK([ovs-vsctl add-port br10 dpdkvhostuserclient0 -- set Interface \
+          dpdkvhostuserclient0 \
+          type=dpdkvhostuserclient \
+          options:vhost-server-path=$OVS_RUNDIR/dpdkvhostclient0], [],
+         [stdout], [stderr])
+AT_CHECK([ovs-vsctl show], [], [stdout])
+
+dnl Set up namespaces
+ADD_NAMESPACES(ns1, ns2)
+
+dnl Add veth device
+ADD_VETH(tap1, ns2, br10, "172.31.110.12/24")
+
+dnl Execute testpmd in background
+on_exit "pkill -f -x -9 'tail -f /dev/null'"
+AT_CHECK([echo "show device info all" > CMDFILE])
+AT_CHECK([echo "show port 0 tx_offload capabilities" >> CMDFILE])
+tail -f /dev/null | testpmd --socket-mem="$(cat NUMA_NODE)" --no-pci\
+           --vdev="net_virtio_user,path=$OVS_RUNDIR/dpdkvhostclient0,server=1" \
+           --vdev="net_tap0,iface=tap0" --file-prefix page0 \
+           --single-file-segments -- --cmdline-file=CMDFILE \
+           -a >$OVS_RUNDIR/testpmd-dpdkvhostuserclient0.log 2>&1 &
+
+dnl Give settling time to the testpmd processes - NOTE: this is bad form.
+sleep 10
+
+dnl Move the tap devices to the namespaces
+AT_CHECK([ps aux | grep testpmd], [], [stdout], [stderr])
+AT_CHECK([ip link show], [], [stdout], [stderr])
+AT_CHECK([ip link set tap0 netns ns1], [], [stdout], [stderr])
+
+AT_CHECK([ip netns exec ns1 ip link show], [], [stdout], [stderr])
+AT_CHECK([ip netns exec ns1 ip link show | grep tap0], [], [stdout], [stderr])
+AT_CHECK([ip netns exec ns1 ip link set tap0 up], [], [stdout], [stderr])
+AT_CHECK([ip netns exec ns1 ip addr add 172.31.110.11/24 dev tap0], [],
+         [stdout], [stderr])
+
+AT_CHECK([ip netns exec ns1 ip link show], [], [stdout], [stderr])
+AT_CHECK([ip netns exec ns2 ip link show], [], [stdout], [stderr])
+AT_CHECK([ip netns exec ns1 ping -c 4 -I tap0 172.31.110.12], [], [stdout],
+         [stderr])
+
+CREATE_EVENT_JSON()
+AT_CHECK([ovs-appctl event/define $abs_top_srcdir/tests/event.json],[],[ignore])
+AT_CHECK([ip netns exec ns2 iperf3 -s -1 -D])
+AT_CHECK([ip netns exec ns1 iperf3 -c 172.31.110.12],[],[stdout])
+AT_CHECK([ovs-appctl event/list --all-timer > event_list])
+
+dnl Clean up
+AT_CHECK([ovs-vsctl del-port br10 dpdkvhostuserclient0], [], [stdout], [stderr])
+
+dnl Clean up the testpmd now
+pkill -f -x -9 'tail -f /dev/null'
+
+AT_FAIL_IF([true])
+OVS_VSWITCHD_STOP()
+AT_CLEANUP
+dnl --------------------------------------------------------------------------
+
+dnl --------------------------------------------------------------------------
+dnl iperf on vhostuser (without userspace-tso)
+AT_SETUP([OVS-DPDK - iperf on vhostuser (without userspace-tso)])
+AT_KEYWORDS([dpdk])
+OVS_DPDK_PRE_CHECK()
+AT_SKIP_IF([! which testpmd >/dev/null 2>/dev/null])
+OVS_DB_START()
+AT_CHECK([ovs-vsctl --no-wait set Open_vSwitch . other_config:userspace-tso-enable=false])
+AT_CHECK([ovs-vsctl --no-wait set Open_vSwitch . other_config:user_defined_event_enable=true])
+OVS_DPDK_START()
+AT_CHECK([grep -c 'Userspace TCP Segmentation Offloading support enabled' \
+          ovs-vswitchd.log],[ignore],[dnl
+0
+])
+
+dnl Find number of sockets
+SET_NUMA_NODE([512])
+
+dnl Add userspace bridge and attach it to OVS
+AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev])
+AT_CHECK([ovs-vsctl add-port br10 dpdkvhostuser0 -- set Interface dpdkvhostuser0 \
+          type=dpdkvhostuser], [],
+         [stdout], [stderr])
+AT_CHECK([ovs-vsctl show], [], [stdout])
+
+dnl Set up namespaces
+ADD_NAMESPACES(ns1, ns2)
+
+dnl Add veth device
+ADD_VETH(tap1, ns2, br10, "172.31.110.12/24")
+
+dnl Execute testpmd in background
+on_exit "pkill -f -x -9 'tail -f /dev/null'"
+AT_CHECK([echo "show device info all" > CMDFILE])
+AT_CHECK([echo "show port 0 tx_offload capabilities" >> CMDFILE])
+tail -f /dev/null | testpmd --socket-mem="$(cat NUMA_NODE)" --no-pci\
+           --vdev="net_virtio_user,path=$OVS_RUNDIR/dpdkvhostuser0" \
+           --vdev="net_tap0,iface=tap0" --file-prefix page0 \
+           --single-file-segments -- --cmdline-file=CMDFILE \
+           -a >$OVS_RUNDIR/testpmd-dpdkvhostuser0.log 2>&1 &
+
+dnl Give settling time to the testpmd processes - NOTE: this is bad form.
+sleep 10
+
+dnl Move the tap devices to the namespaces
+AT_CHECK([ps aux | grep testpmd], [], [stdout], [stderr])
+AT_CHECK([ip link show], [], [stdout], [stderr])
+AT_CHECK([ip link set tap0 netns ns1], [], [stdout], [stderr])
+
+AT_CHECK([ip netns exec ns1 ip link show], [], [stdout], [stderr])
+AT_CHECK([ip netns exec ns1 ip link show | grep tap0], [], [stdout], [stderr])
+AT_CHECK([ip netns exec ns1 ip link set tap0 up], [], [stdout], [stderr])
+AT_CHECK([ip netns exec ns1 ip addr add 172.31.110.11/24 dev tap0], [],
+         [stdout], [stderr])
+
+AT_CHECK([ip netns exec ns1 ip link show], [], [stdout], [stderr])
+AT_CHECK([ip netns exec ns2 ip link show], [], [stdout], [stderr])
+AT_CHECK([ip netns exec ns1 ping -c 4 -I tap0 172.31.110.12], [], [stdout],
+         [stderr])
+
+CREATE_EVENT_JSON()
+AT_CHECK([ovs-appctl event/define $abs_top_srcdir/tests/event.json],[],[ignore])
+AT_CHECK([ip netns exec ns2 iperf3 -s -1 -D])
+AT_CHECK([ip netns exec ns1 iperf3 -c 172.31.110.12],[],[stdout])
+AT_CHECK([ovs-appctl event/list --all-timer > event_list])
+
+dnl Clean up the testpmd now
+pkill -f -x -9 'tail -f /dev/null'
+
+dnl Clean up
+AT_CHECK([ovs-vsctl del-port br10 dpdkvhostuser0], [], [stdout], [stderr])
+
+AT_FAIL_IF([true])
+OVS_VSWITCHD_STOP()
+AT_CLEANUP
+dnl --------------------------------------------------------------------------
+
+
-- 
1.8.3.1



More information about the dev mailing list