Skip to content

Commit 578143f

Browse files
committed
test-ovs-dpdk-hot-upgrade.sh: Update to match ovs hotupgrade changes
Following [1], update to use systemctl reload ovs-vswitchd. [1] https://git-nbu.nvidia.com/r/c/sdn/ovs/+/1159522 Change-Id: I4297fdd6859a5b32df20405634a8031c2353b84e Signed-off-by: Roi Dayan <roid@nvidia.com>
1 parent 614bd1c commit 578143f

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

common.sh

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2138,8 +2138,18 @@ function service_ovs() {
21382138
else
21392139
systemctl $action $ovs
21402140
fi
2141+
__update_ovs_pid
2142+
}
2143+
2144+
function service_ovs_vswitchd() {
2145+
local action=$1
2146+
systemctl $action ovs-vswitchd
2147+
__update_ovs_pid
2148+
}
2149+
2150+
function __update_ovs_pid() {
21412151
OVS_PID_FILE="/var/run/openvswitch/ovs-vswitchd.pid"
2142-
if [ "$action" == "start" ] && [ -f $OVS_PID_FILE ]; then
2152+
if [ -f $OVS_PID_FILE ]; then
21432153
OVS_PID=`cat $OVS_PID_FILE`
21442154
fi
21452155
}
@@ -2290,6 +2300,10 @@ function start_clean_openvswitch() {
22902300
__ovs_used=1
22912301
}
22922302

2303+
function reload_ovs_vswitchd() {
2304+
bf_wrap_exec 'service_ovs_vswitchd reload'
2305+
}
2306+
22932307
function wait_for_ifaces() {
22942308
local i
22952309
local max=4

ovs-dpdk-tests/test-ovs-dpdk-hot-upgrade.sh

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
my_dir="$(dirname "$0")"
77
. $my_dir/common-dpdk.sh
88

9-
OVS_HOTUPGRADE='/usr/share/openvswitch/scripts/ovs-hotupgrade'
109
OVS_RUNDIR='/var/run/openvswitch'
1110
PIDFILE="$OVS_RUNDIR/ovs-vswitchd.pid"
1211
PIDFILE_UPGRADING="$OVS_RUNDIR/ovs-vswitchd.upgrading.pid"
@@ -15,11 +14,6 @@ config_sriov 2
1514
enable_switchdev
1615

1716
function check_supported() {
18-
if [ ! -f $OVS_HOTUPGRADE ]; then
19-
warn "Cannot find $OVS_HOTUPGRADE. consider as not supported."
20-
return 1
21-
fi
22-
2317
if [ ! -f $PIDFILE ]; then
2418
err "Cannot find $PIDFILE"
2519
return 1
@@ -45,12 +39,12 @@ function case_with_bridge() {
4539
}
4640

4741
function run() {
48-
title "Execute $OVS_HOTUPGRADE"
42+
title "Hotupgrade ovs-vswitchd"
4943

5044
local pid1=`cat $PIDFILE`
5145
log "Current pid: $pid1"
5246

53-
$OVS_HOTUPGRADE || err "ovs-hotupgrade script failed."
47+
reload_ovs_vswitchd || err "ovs-vswitchd hotupgrade failed."
5448
sleep 2
5549

5650
title "Wait for the upgrading pid file to be removed."
@@ -66,7 +60,7 @@ function run() {
6660
done
6761

6862
local pid2=`cat $PIDFILE`
69-
log "pid after ovs-hotupgrade: $pid2"
63+
log "pid after ovs-vswitchd reload: $pid2"
7064
if [ -z "$pid2" ] || [ "$pid1" == "$pid2" ]; then
7165
err "Expected a new pid. skip rest of the checks."
7266
return

0 commit comments

Comments
 (0)