Avoid unnecessary errors trying to stop already stopped processes,
or removing already removed datapath.
Tests were not failing due to this, but potentially confusing errors
were logged.

Signed-off-by: Xavier Simonart <[email protected]>
---
 tests/ofproto-macros.at     | 2 +-
 tests/system-kmod-macros.at | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/ofproto-macros.at b/tests/ofproto-macros.at
index 31a067c1e..b0a05baf2 100644
--- a/tests/ofproto-macros.at
+++ b/tests/ofproto-macros.at
@@ -196,7 +196,7 @@ m4_define([_OVS_VSWITCHD_START],
 
    dnl Start ovsdb-server.
    AT_CHECK([ovsdb-server --detach --no-chdir --pidfile --log-file 
--remote=punix:$OVS_RUNDIR/db.sock], [0], [], [stderr])
-   on_exit "kill `cat ovsdb-server.pid`"
+   on_exit "test -e `cat ovsdb-server.pid` && kill `cat ovsdb-server.pid`"
    AT_CHECK([[sed < stderr '
 /vlog|INFO|opened log file/d
 /ovsdb_server|INFO|ovsdb-server (Open vSwitch)/d']])
diff --git a/tests/system-kmod-macros.at b/tests/system-kmod-macros.at
index 6f6670199..ec23c55cf 100644
--- a/tests/system-kmod-macros.at
+++ b/tests/system-kmod-macros.at
@@ -22,8 +22,8 @@ m4_define([OVS_TRAFFIC_VSWITCHD_START],
               [modprobe -q mod || echo "Module mod not loaded."
                on_exit 'modprobe -q -r mod'
               ])
-   on_exit 'ovs-dpctl del-dp ovs-system'
-   on_exit 'ovs-appctl dpctl/flush-conntrack'
+   on_exit 'ovs-dpctl show | grep ovs-system && ovs-dpctl del-dp ovs-system'
+   on_exit 'test -e $OVS_RUNDIR/ovs-vswitchd.pid && ovs-appctl 
dpctl/flush-conntrack'
    _OVS_VSWITCHD_START([])
    dnl Add bridges, ports, etc.
    AT_CHECK([ovs-vsctl -- _ADD_BR([br0]) -- $1 m4_if([$2], [], [], [| 
uuidfilt])], [0], [$2])
-- 
2.31.1

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

Reply via email to