Skip to content

Commit e19f67d

Browse files
committed
Merge branch 'selftests-openvswitch-address-some-flakes-in-the-ci-environment'
Aaron Conole says: ==================== selftests: openvswitch: Address some flakes in the CI environment These patches aim to make using the openvswitch testsuite more reliable. These should address the major sources of flakiness in the openvswitch test suite allowing the CI infrastructure to exercise the openvswitch module for patch series. There should be no change for users who simply run the tests (except that patch 3/3 does make some of the debugging a bit easier by making some output more verbose). ==================== Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 1a16cdf + 7abfd8e commit e19f67d

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

tools/testing/selftests/net/openvswitch/openvswitch.sh

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ tests="
2323
drop_reason drop: test drop reasons are emitted"
2424

2525
info() {
26-
[ $VERBOSE = 0 ] || echo $*
26+
[ "${ovs_dir}" != "" ] &&
27+
echo "`date +"[%m-%d %H:%M:%S]"` $*" >> ${ovs_dir}/debug.log
28+
[ $VERBOSE = 0 ] || echo $*
2729
}
2830

2931
ovs_base=`pwd`
@@ -65,7 +67,8 @@ ovs_setenv() {
6567

6668
ovs_sbx() {
6769
if test "X$2" != X; then
68-
(ovs_setenv $1; shift; "$@" >> ${ovs_dir}/debug.log)
70+
(ovs_setenv $1; shift;
71+
info "run cmd: $@"; "$@" >> ${ovs_dir}/debug.log)
6972
else
7073
ovs_setenv $1
7174
fi
@@ -139,7 +142,7 @@ ovs_add_flow () {
139142
info "Adding flow to DP: sbx:$1 br:$2 flow:$3 act:$4"
140143
ovs_sbx "$1" python3 $ovs_base/ovs-dpctl.py add-flow "$2" "$3" "$4"
141144
if [ $? -ne 0 ]; then
142-
echo "Flow [ $3 : $4 ] failed" >> ${ovs_dir}/debug.log
145+
info "Flow [ $3 : $4 ] failed"
143146
return 1
144147
fi
145148
return 0
@@ -613,16 +616,20 @@ run_test() {
613616
tname="$1"
614617
tdesc="$2"
615618

616-
if ! lsmod | grep openvswitch >/dev/null 2>&1; then
617-
stdbuf -o0 printf "TEST: %-60s [NOMOD]\n" "${tdesc}"
618-
return $ksft_skip
619-
fi
620-
621619
if python3 ovs-dpctl.py -h 2>&1 | \
622620
grep -E "Need to (install|upgrade) the python" >/dev/null 2>&1; then
623621
stdbuf -o0 printf "TEST: %-60s [PYLIB]\n" "${tdesc}"
624622
return $ksft_skip
625623
fi
624+
625+
python3 ovs-dpctl.py show >/dev/null 2>&1 || \
626+
echo "[DPCTL] show exception."
627+
628+
if ! lsmod | grep openvswitch >/dev/null 2>&1; then
629+
stdbuf -o0 printf "TEST: %-60s [NOMOD]\n" "${tdesc}"
630+
return $ksft_skip
631+
fi
632+
626633
printf "TEST: %-60s [START]\n" "${tname}"
627634

628635
unset IFS
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
timeout=900

0 commit comments

Comments
 (0)