Skip to content

Commit 4fc8b97

Browse files
simonartxavieralmusil
authored andcommitted
tests: Fix dpctl related commands not properly executed at exit.
- ovs-dpctl was erroneously not executed when ovs-vswitchd was stopped. - on_exit 'test -e $OVS_RUNDIR/ovs-vswitchd.pid && ovs-appctl dpctl/flush-conntrack' was executed after stopping ovs-vswitchd, so ovs-appctl dpctl/flush-conntrack was never executed. Fixes: 0156e7d ("tests: Avoid calling ovs/ovn commands when ovs/ovn are stopped.") Signed-off-by: Xavier Simonart <xsimonar@redhat.com> Signed-off-by: Ales Musil <amusil@redhat.com> (cherry picked from commit 2005378)
1 parent 7ce18f8 commit 4fc8b97

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

tests/ovs-macros.at

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ on_exit () {
386386
(echo "test -e ovn-nb/ovn-nb.sock && $1"; cat cleanup;) > cleanup.tmp
387387
elif [ echo "$1" | grep -qe '^ovn-sbctl' ]; then
388388
(echo "test -e ovn-sb/ovn-sb.sock && $1"; cat cleanup) > cleanup.tmp
389-
elif [ echo "$1" | grep -qe '^ovs-ofctl' -qe '^ovs-dpctl' ]; then
389+
elif [ echo "$1" | grep -qe '^ovs-ofctl' ]; then
390390
(echo "test -e $OVS_RUNDIR/ovs-vswitchd.pid && $1"; cat cleanup) > cleanup.tmp
391391
else
392392
(echo "$1"; cat cleanup) > cleanup.tmp

tests/system-kmod-macros.at

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ m4_define([OVS_TRAFFIC_VSWITCHD_START],
2222
[modprobe mod && on_exit 'modprobe -r mod' || echo "Module mod not loaded."
2323
])
2424
on_exit 'ovs-dpctl show | grep ovs-system && ovs-dpctl del-dp ovs-system'
25-
on_exit 'test -e $OVS_RUNDIR/ovs-vswitchd.pid && ovs-appctl dpctl/flush-conntrack'
2625
_OVS_VSWITCHD_START([])
26+
# Do 'on_exit ovs-appctl ...' after 'on_exit kill_ovs_vswitchd' (from _OVS_VSWITCHD_START)
27+
# so it is executed before.
28+
on_exit 'test -e $OVS_RUNDIR/ovs-vswitchd.pid && ovs-appctl dpctl/flush-conntrack'
2729
dnl Add bridges, ports, etc.
2830
AT_CHECK([ovs-vsctl -- _ADD_BR([br0]) -- $1 m4_if([$2], [], [], [| uuidfilt])], [0], [$2])
2931
if test OVN_MONITOR_ALL = yes; then

0 commit comments

Comments
 (0)