Those tests are subject to a race when a testpmd hosting the vhost-user
server is stopped and OVS has enough time to detect the vhost-user socket
drop and tries to reconnect to this socket.

In such a situation, the tests can fail as the OVS process with the
vhost-user client port complains with a warning log:

2023-09-08T13:15:18.160Z|00163|dpdk|INFO|VHOST_CONFIG:
        (.../005/dpdkvhostclient0) vhost peer closed
2023-09-08T13:15:18.160Z|00164|netdev_dpdk|INFO|vHost Device
        '.../005/dpdkvhostclient0' connection has been destroyed
2023-09-08T13:15:18.160Z|00165|dpdk|INFO|VHOST_CONFIG:
        (.../005/dpdkvhostclient0) vhost-user client: socket created, fd: 24
2023-09-08T13:15:18.160Z|00166|dpdk|WARN|VHOST_CONFIG:
        (.../005/dpdkvhostclient0) failed to connect: Connection refused
2023-09-08T13:15:18.160Z|00167|dpdk|INFO|VHOST_CONFIG:
        (.../005/dpdkvhostclient0) reconnecting...

Invert the order of the cleanup steps.

Signed-off-by: David Marchand <[email protected]>
Acked-by: Eelco Chaudron <[email protected]>
---
Changes since v6:
- added this fix for spurious failures hit by Eelco,

---
 tests/system-dpdk.at | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/tests/system-dpdk.at b/tests/system-dpdk.at
index 4da2afd683..5e486d1f47 100644
--- a/tests/system-dpdk.at
+++ b/tests/system-dpdk.at
@@ -221,10 +221,9 @@ AT_CHECK([test `ovs-vsctl get interface 
dpdkvhostuserclient0 statistics:tx_bytes
                $((`ovs-vsctl get interface dpdkvhostuserclient0 
statistics:tx_q0_good_bytes` + dnl
                   `ovs-vsctl get interface dpdkvhostuserclient0 
statistics:tx_q1_good_bytes`))])
 
-OVS_DPDK_STOP_TESTPMD()
-
 dnl Clean up
 AT_CHECK([ovs-vsctl del-port br10 dpdkvhostuserclient0], [], [stdout], 
[stderr])
+OVS_DPDK_STOP_TESTPMD()
 OVS_DPDK_STOP_VSWITCHD(["dnl
 /VHOST_CONFIG: (.*dpdkvhostclient0) recvmsg failed/d
 /VHOST_CONFIG: (.*dpdkvhostclient0) failed to connect: No such file or 
directory/d
@@ -619,10 +618,9 @@ AT_CHECK([ovs-vsctl get Interface dpdkvhostuserclient0 
mtu], [0], [dnl
 9000
 ])
 
-OVS_DPDK_STOP_TESTPMD()
-
 dnl Clean up
 AT_CHECK([ovs-vsctl del-port br10 dpdkvhostuserclient0], [], [stdout], 
[stderr])
+OVS_DPDK_STOP_TESTPMD()
 OVS_DPDK_STOP_VSWITCHD(["dnl
 /VHOST_CONFIG: (.*dpdkvhostclient0) failed to connect: No such file or 
directory/d"])
 AT_CLEANUP
@@ -662,10 +660,9 @@ AT_CHECK([ovs-vsctl get Interface dpdkvhostuserclient0 
mtu], [0], [dnl
 2000
 ])
 
-OVS_DPDK_STOP_TESTPMD()
-
 dnl Clean up
 AT_CHECK([ovs-vsctl del-port br10 dpdkvhostuserclient0], [], [stdout], 
[stderr])
+OVS_DPDK_STOP_TESTPMD()
 OVS_DPDK_STOP_VSWITCHD(["dnl
 /VHOST_CONFIG: (.*dpdkvhostclient0) failed to connect: No such file or 
directory/d"])
 AT_CLEANUP
@@ -785,10 +782,9 @@ dnl Set MTU value above upper bound and check for error
 AT_CHECK([ovs-vsctl set Interface dpdkvhostuserclient0 mtu_request=9711])
 AT_CHECK([grep "dpdkvhostuserclient0: unsupported MTU 9711" ovs-vswitchd.log], 
[], [stdout])
 
-OVS_DPDK_STOP_TESTPMD()
-
 dnl Clean up
 AT_CHECK([ovs-vsctl del-port br10 dpdkvhostuserclient0], [], [stdout], 
[stderr])
+OVS_DPDK_STOP_TESTPMD()
 OVS_DPDK_STOP_VSWITCHD(["dnl
 /VHOST_CONFIG: (.*dpdkvhostclient0) failed to connect: No such file or 
directory/d
 /dpdkvhostuserclient0: unsupported MTU 9711/d
@@ -828,10 +824,9 @@ dnl Set MTU value below lower bound and check for error
 AT_CHECK([ovs-vsctl set Interface dpdkvhostuserclient0 mtu_request=67])
 AT_CHECK([grep "dpdkvhostuserclient0: unsupported MTU 67" ovs-vswitchd.log], 
[], [stdout])
 
-OVS_DPDK_STOP_TESTPMD()
-
 dnl Clean up
 AT_CHECK([ovs-vsctl del-port br10 dpdkvhostuserclient0], [], [stdout], 
[stderr])
+OVS_DPDK_STOP_TESTPMD()
 OVS_DPDK_STOP_VSWITCHD(["dnl
 /VHOST_CONFIG: (.*dpdkvhostclient0) failed to connect: No such file or 
directory/d
 /dpdkvhostuserclient0: unsupported MTU 67/d
-- 
2.41.0

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to