@@ -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']])
@@ -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])
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 <xsimonar@redhat.com> --- tests/ofproto-macros.at | 2 +- tests/system-kmod-macros.at | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)