[ovs-dev] [PATCH v3 4/4] tests: Move MFEX tests to dpif-netdev.

David Marchand david.marchand at redhat.com
Tue Nov 30 15:00:13 UTC 2021


The MFEX code and tests do not depend on DPDK anymore.
We can move the unit tests to dpif-netdev.

Signed-off-by: David Marchand <david.marchand at redhat.com>
---
Note: this patch depends on series
https://patchwork.ozlabs.org/project/openvswitch/list/?series=274452

---
 Documentation/topics/dpdk/bridge.rst |  22 +--
 tests/dpif-netdev.at                 | 167 +++++++++++++++++++++++
 tests/system-dpdk.at                 | 194 ---------------------------
 3 files changed, 178 insertions(+), 205 deletions(-)

diff --git a/Documentation/topics/dpdk/bridge.rst b/Documentation/topics/dpdk/bridge.rst
index 648ce203eb..c88658fa91 100644
--- a/Documentation/topics/dpdk/bridge.rst
+++ b/Documentation/topics/dpdk/bridge.rst
@@ -385,21 +385,21 @@ Unit Test Miniflow Extract
 ++++++++++++++++++++++++++
 
 Unit test can also be used to test the workflow mentioned above by running
-the following test-case in tests/system-dpdk.at ::
+the following test-case in tests/dpif-netdev.at ::
 
-    make check-dpdk TESTSUITEFLAGS='-k MFEX'
-    OVS-DPDK - MFEX Autovalidator
+    make check TESTSUITEFLAGS='-k MFEX'
+    dpif-netdev - MFEX Autovalidator
 
-The unit test uses mulitple traffic type to test the correctness of the
-implementaions.
+The unit test uses multiple traffic type to test the correctness of the
+implementations.
 
 The MFEX commands can also be tested for negative and positive cases to
 verify that the MFEX set command does not allow for incorrect parameters.
 A user can directly run the following configuration test case in
-tests/system-dpdk.at ::
+tests/dpif-netdev.at ::
 
-    make check-dpdk TESTSUITEFLAGS='-k MFEX'
-    OVS-DPDK - MFEX Configuration
+    make check TESTSUITEFLAGS='-k MFEX'
+    dpif-netdev - MFEX Configuration
 
 Running Fuzzy test with Autovalidator
 +++++++++++++++++++++++++++++++++++++
@@ -431,7 +431,7 @@ Unit Fuzzy test with Autovalidator
 +++++++++++++++++++++++++++++++++++++
 
 Unit test can also be used to test the workflow mentioned above by running
-the following test-case in tests/system-dpdk.at ::
+the following test-case in tests/dpif-netdev.at ::
 
-    make check-dpdk TESTSUITEFLAGS='-k MFEX'
-    OVS-DPDK - MFEX Autovalidator Fuzzy
+    make check TESTSUITEFLAGS='-k MFEX'
+    dpif-netdev - MFEX Autovalidator Fuzzy
diff --git a/tests/dpif-netdev.at b/tests/dpif-netdev.at
index 53eee185ad..fbb8fe9a71 100644
--- a/tests/dpif-netdev.at
+++ b/tests/dpif-netdev.at
@@ -635,3 +635,170 @@ OVS_WAIT_UNTIL([grep "flow: in_port is not an exact match" ovs-vswitchd.log])
 OVS_VSWITCHD_STOP(["/flow: in_port is not an exact match/d
 /failed to put/d"])
 AT_CLEANUP
+
+AT_SETUP([dpif-netdev - MFEX Autovalidator])
+AT_SKIP_IF([! $PYTHON3 -c "import scapy"], [], [])
+OVS_VSWITCHD_START(
+  [add-port br0 p1 \
+   -- set interface p1 type=dummy-pmd])
+
+AT_SKIP_IF([! ovs-appctl dpif-netdev/miniflow-parser-get | sed 1,4d | grep "True"], [], [dnl
+])
+
+on_exit "pkill -f -x -9 '$PYTHON3 $srcdir/genpkts.py -1'"
+($PYTHON3 $srcdir/genpkts.py -1 | while read pkt; do
+     ovs-appctl netdev-dummy/receive p1 "$pkt" || break
+ done) &
+
+AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set autovalidator], [0], [dnl
+Miniflow extract implementation set to autovalidator.
+])
+
+OVS_WAIT_UNTIL([test `ovs-vsctl get interface p1 statistics:rx_packets` -ge 1000])
+pkill -f -x -9 '$PYTHON3 $srcdir/genpkts.py -1'
+
+OVS_VSWITCHD_STOP
+AT_CLEANUP
+
+AT_SETUP([dpif-netdev - MFEX Autovalidator Fuzzy])
+AT_SKIP_IF([! $PYTHON3 -c "import scapy"], [], [])
+OVS_VSWITCHD_START(
+  [add-port br0 p1 \
+   -- set interface p1 type=dummy-pmd])
+
+AT_SKIP_IF([! ovs-appctl dpif-netdev/miniflow-parser-get | sed 1,4d | grep "True"], [], [dnl
+])
+
+on_exit "pkill -f -x -9 '$PYTHON3 $srcdir/genpkts.py -1 fuzz'"
+($PYTHON3 $srcdir/genpkts.py -1 fuzz | while read pkt; do
+     ovs-appctl netdev-dummy/receive p1 "$pkt" || break
+ done) &
+
+AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set autovalidator], [0], [dnl
+Miniflow extract implementation set to autovalidator.
+])
+
+OVS_WAIT_UNTIL([test `ovs-vsctl get interface p1 statistics:rx_packets` -ge 1000])
+pkill -f -x -9 '$PYTHON3 $srcdir/genpkts.py -1 fuzz'
+
+OVS_VSWITCHD_STOP
+AT_CLEANUP
+
+AT_SETUP([dpif-netdev - MFEX Configuration])
+AT_SKIP_IF([! $PYTHON3 -c "import scapy"], [], [])
+OVS_VSWITCHD_START(
+  [add-port br0 p1 \
+   -- set Open_vSwitch . other_config:pmd-cpu-mask=0xC \
+   -- set interface p1 type=dummy-pmd])
+
+on_exit "pkill -f -x -9 '$PYTHON3 $srcdir/genpkts.py -1'"
+($PYTHON3 $srcdir/genpkts.py -1 | while read pkt; do
+     ovs-appctl netdev-dummy/receive p1 "$pkt" || break
+ done) &
+
+AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set scalar 1], [2],
+[], [dnl
+Error: unknown argument 1.
+ovs-appctl: ovs-vswitchd: server returned an error
+])
+
+AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set -pmd 6 study 300 xyz], [2],
+[], [dnl
+Error: invalid study_pkt_cnt value: xyz.
+ovs-appctl: ovs-vswitchd: server returned an error
+])
+
+AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set scalar abcd], [2],
+[], [dnl
+Error: unknown argument abcd.
+ovs-appctl: ovs-vswitchd: server returned an error
+])
+
+AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set -pmd 0 scalar abcd], [2],
+[], [dnl
+Error: unknown argument abcd.
+ovs-appctl: ovs-vswitchd: server returned an error
+])
+
+AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set -pmd], [2],
+[], [dnl
+Error: -pmd option requires a thread id argument.
+ovs-appctl: ovs-vswitchd: server returned an error
+])
+
+AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set tudy abcd], [2],
+[], [dnl
+Error: unknown argument abcd.
+ovs-appctl: ovs-vswitchd: server returned an error
+])
+
+AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set -pmd 7 study abcd], [2],
+[], [dnl
+Error: invalid study_pkt_cnt value: abcd.
+ovs-appctl: ovs-vswitchd: server returned an error
+])
+
+AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set -pmd 3 study], [0], [dnl
+Miniflow extract implementation set to study, on pmd thread 3, studying 128 packets.
+])
+
+AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set -pmd 3 study 512], [0], [dnl
+Miniflow extract implementation set to study, on pmd thread 3, studying 512 packets.
+])
+
+AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set study 512], [0], [dnl
+Miniflow extract implementation set to study, studying 512 packets.
+])
+
+AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set study], [0], [dnl
+Miniflow extract implementation set to study, studying 128 packets.
+])
+
+AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set -pmd 3 autovalidator], [0], [dnl
+Miniflow extract implementation set to autovalidator, on pmd thread 3.
+])
+
+AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set -pmd zero study], [2],
+[], [dnl
+Error: miniflow extract parser not changed, PMD thread passed is not valid: 'zero'. Pass a valid pmd thread ID.
+ovs-appctl: ovs-vswitchd: server returned an error
+])
+
+AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set -pmd 1], [2],
+[], [dnl
+Error: no miniflow extract name provided. Output of miniflow-parser-get shows implementation list.
+ovs-appctl: ovs-vswitchd: server returned an error
+])
+
+AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set -pmd 1 superstudy], [2],
+[], [dnl
+Error: unknown miniflow extract implementation superstudy.
+ovs-appctl: ovs-vswitchd: server returned an error
+])
+
+AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set superstudy], [2],
+[], [dnl
+Error: unknown miniflow extract implementation superstudy.
+ovs-appctl: ovs-vswitchd: server returned an error
+])
+
+AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set -pmd 1 study -pmd], [2],
+[], [dnl
+Error: invalid study_pkt_cnt value: -pmd.
+ovs-appctl: ovs-vswitchd: server returned an error
+])
+
+pkill -f -x -9 '$PYTHON3 $srcdir/genpkts.py -1'
+
+OVS_VSWITCHD_STOP(["
+\@Error: unknown argument 1. at d
+\@Error: invalid study_pkt_cnt value: xyz. at d
+\@Error: unknown argument abcd. at d
+\@Error: -pmd option requires a thread id argument. at d
+\@Error: invalid study_pkt_cnt value: abcd. at d
+\@Error: miniflow extract parser not changed, PMD thread passed is not valid: 'zero'. Pass a valid pmd thread ID. at d
+\@Error: no miniflow extract name provided. Output of miniflow-parser-get shows implementation list. at d
+\@Error: unknown miniflow extract implementation superstudy. at d
+\@Error: invalid study_pkt_cnt value: -pmd. at d
+"])
+AT_CLEANUP
diff --git a/tests/system-dpdk.at b/tests/system-dpdk.at
index 76b60f3c3a..fc030ff1ec 100644
--- a/tests/system-dpdk.at
+++ b/tests/system-dpdk.at
@@ -221,197 +221,3 @@ OVS_VSWITCHD_STOP("m4_join([], [SYSTEM_DPDK_ALLOWED_LOGS], [
 ])")
 AT_CLEANUP
 dnl --------------------------------------------------------------------------
-
-dnl --------------------------------------------------------------------------
-dnl Add standard DPDK PHY port
-AT_SETUP([OVS-DPDK - MFEX Autovalidator])
-AT_KEYWORDS([dpdk])
-AT_SKIP_IF([! $PYTHON3 -c "import scapy"], [], [])
-
-OVS_DPDK_START()
-
-dnl Add userspace bridge and attach it to OVS
-AT_CHECK([ovs-vsctl add-br br0 -- set bridge br0 datapath_type=netdev])
-AT_CHECK([ovs-vsctl add-port br0 p1 -- set interface p1 type=dummy-pmd])
-AT_CHECK([ovs-vsctl show], [], [stdout])
-
-AT_SKIP_IF([! ovs-appctl dpif-netdev/miniflow-parser-get | sed 1,4d | grep "True"], [], [dnl
-])
-
-on_exit "pkill -f -x -9 '$PYTHON3 $srcdir/genpkts.py -1'"
-($PYTHON3 $srcdir/genpkts.py -1 | while read pkt; do
-     ovs-appctl netdev-dummy/receive p1 "$pkt" || break
- done) &
-
-AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set autovalidator], [0], [dnl
-Miniflow extract implementation set to autovalidator.
-])
-
-OVS_WAIT_UNTIL([test `ovs-vsctl get interface p1 statistics:rx_packets` -ge 1000])
-pkill -f -x -9 '$PYTHON3 $srcdir/genpkts.py -1'
-
-dnl Clean up
-AT_CHECK([ovs-vsctl del-port br0 p1], [], [stdout], [stderr])
-OVS_VSWITCHD_STOP("[SYSTEM_DPDK_ALLOWED_LOGS]")
-AT_CLEANUP
-dnl --------------------------------------------------------------------------
-
-dnl --------------------------------------------------------------------------
-dnl Add standard DPDK PHY port
-AT_SETUP([OVS-DPDK - MFEX Autovalidator Fuzzy])
-AT_KEYWORDS([dpdk])
-AT_SKIP_IF([! $PYTHON3 -c "import scapy"], [], [])
-OVS_DPDK_START()
-
-dnl Add userspace bridge and attach it to OVS
-AT_CHECK([ovs-vsctl add-br br0 -- set bridge br0 datapath_type=netdev])
-AT_CHECK([ovs-vsctl add-port br0 p1 -- set interface p1 type=dummy-pmd])
-AT_CHECK([ovs-vsctl show], [], [stdout])
-
-AT_SKIP_IF([! ovs-appctl dpif-netdev/miniflow-parser-get | sed 1,4d | grep "True"], [], [dnl
-])
-
-on_exit "pkill -f -x -9 '$PYTHON3 $srcdir/genpkts.py -1 fuzz'"
-($PYTHON3 $srcdir/genpkts.py -1 fuzz | while read pkt; do
-     ovs-appctl netdev-dummy/receive p1 "$pkt" || break
- done) &
-
-AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set autovalidator], [0], [dnl
-Miniflow extract implementation set to autovalidator.
-])
-
-OVS_WAIT_UNTIL([test `ovs-vsctl get interface p1 statistics:rx_packets` -ge 1000])
-pkill -f -x -9 '$PYTHON3 $srcdir/genpkts.py -1 fuzz'
-
-dnl Clean up
-AT_CHECK([ovs-vsctl del-port br0 p1], [], [stdout], [stderr])
-OVS_VSWITCHD_STOP("[SYSTEM_DPDK_ALLOWED_LOGS]")
-AT_CLEANUP
-dnl --------------------------------------------------------------------------
-
-dnl --------------------------------------------------------------------------
-AT_SETUP([OVS-DPDK - MFEX Configuration])
-AT_KEYWORDS([dpdk])
-AT_SKIP_IF([! $PYTHON3 -c "import scapy"], [], [])
-
-OVS_DPDK_START()
-AT_CHECK([ovs-vsctl --no-wait set Open_vSwitch . other_config:pmd-cpu-mask=0xC])
-dnl Add userspace bridge and attach it to OVS
-AT_CHECK([ovs-vsctl add-br br0 -- set bridge br0 datapath_type=netdev])
-AT_CHECK([ovs-vsctl add-port br0 p1 -- set interface p1 type=dummy-pmd])
-AT_CHECK([ovs-vsctl show], [], [stdout])
-
-on_exit "pkill -f -x -9 '$PYTHON3 $srcdir/genpkts.py -1'"
-($PYTHON3 $srcdir/genpkts.py -1 | while read pkt; do
-     ovs-appctl netdev-dummy/receive p1 "$pkt" || break
- done) &
-
-AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set scalar 1], [2],
-[], [dnl
-Error: unknown argument 1.
-ovs-appctl: ovs-vswitchd: server returned an error
-])
-
-AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set -pmd 6 study 300 xyz], [2],
-[], [dnl
-Error: invalid study_pkt_cnt value: xyz.
-ovs-appctl: ovs-vswitchd: server returned an error
-])
-
-AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set scalar abcd], [2],
-[], [dnl
-Error: unknown argument abcd.
-ovs-appctl: ovs-vswitchd: server returned an error
-])
-
-AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set -pmd 0 scalar abcd], [2],
-[], [dnl
-Error: unknown argument abcd.
-ovs-appctl: ovs-vswitchd: server returned an error
-])
-
-AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set -pmd], [2],
-[], [dnl
-Error: -pmd option requires a thread id argument.
-ovs-appctl: ovs-vswitchd: server returned an error
-])
-
-AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set tudy abcd], [2],
-[], [dnl
-Error: unknown argument abcd.
-ovs-appctl: ovs-vswitchd: server returned an error
-])
-
-AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set -pmd 7 study abcd], [2],
-[], [dnl
-Error: invalid study_pkt_cnt value: abcd.
-ovs-appctl: ovs-vswitchd: server returned an error
-])
-
-AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set -pmd 3 study], [0], [dnl
-Miniflow extract implementation set to study, on pmd thread 3, studying 128 packets.
-])
-
-AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set -pmd 3 study 512], [0], [dnl
-Miniflow extract implementation set to study, on pmd thread 3, studying 512 packets.
-])
-
-AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set study 512], [0], [dnl
-Miniflow extract implementation set to study, studying 512 packets.
-])
-
-AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set study], [0], [dnl
-Miniflow extract implementation set to study, studying 128 packets.
-])
-
-AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set -pmd 3 autovalidator], [0], [dnl
-Miniflow extract implementation set to autovalidator, on pmd thread 3.
-])
-
-AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set -pmd zero study], [2],
-[], [dnl
-Error: miniflow extract parser not changed, PMD thread passed is not valid: 'zero'. Pass a valid pmd thread ID.
-ovs-appctl: ovs-vswitchd: server returned an error
-])
-
-AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set -pmd 1], [2],
-[], [dnl
-Error: no miniflow extract name provided. Output of miniflow-parser-get shows implementation list.
-ovs-appctl: ovs-vswitchd: server returned an error
-])
-
-AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set -pmd 1 superstudy], [2],
-[], [dnl
-Error: unknown miniflow extract implementation superstudy.
-ovs-appctl: ovs-vswitchd: server returned an error
-])
-
-AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set superstudy], [2],
-[], [dnl
-Error: unknown miniflow extract implementation superstudy.
-ovs-appctl: ovs-vswitchd: server returned an error
-])
-
-AT_CHECK([ovs-appctl dpif-netdev/miniflow-parser-set -pmd 1 study -pmd], [2],
-[], [dnl
-Error: invalid study_pkt_cnt value: -pmd.
-ovs-appctl: ovs-vswitchd: server returned an error
-])
-
-pkill -f -x -9 '$PYTHON3 $srcdir/genpkts.py -1'
-
-dnl Clean up
-AT_CHECK([ovs-vsctl del-port br0 p1], [], [stdout], [stderr])
-OVS_VSWITCHD_STOP("m4_join([], [SYSTEM_DPDK_ALLOWED_LOGS], [
-\@Error: unknown argument 1. at d
-\@Error: invalid study_pkt_cnt value: xyz. at d
-\@Error: unknown argument abcd. at d
-\@Error: -pmd option requires a thread id argument. at d
-\@Error: invalid study_pkt_cnt value: abcd. at d
-\@Error: miniflow extract parser not changed, PMD thread passed is not valid: 'zero'. Pass a valid pmd thread ID. at d
-\@Error: no miniflow extract name provided. Output of miniflow-parser-get shows implementation list. at d
-\@Error: unknown miniflow extract implementation superstudy. at d
-\@Error: invalid study_pkt_cnt value: -pmd. at d
-])")
-AT_CLEANUP dnl
-dnl --------------------------------------------------------------------------
-- 
2.23.0



More information about the dev mailing list