]> www.infradead.org Git - users/jedix/linux-maple.git/commit
selftests: openvswitch: retry instead of sleep
authorAdrian Moreno <amorenoz@redhat.com>
Wed, 10 Jul 2024 09:04:59 +0000 (11:04 +0200)
committerJakub Kicinski <kuba@kernel.org>
Fri, 12 Jul 2024 01:11:31 +0000 (18:11 -0700)
commit5e724cb688a207ae7a348d57f9ea77f475998883
treef0016986814a627d96af26455bae69ba54c679d3
parent13cabc47f8ae69d24653f32c28399d493fde0a56
selftests: openvswitch: retry instead of sleep

There are a couple of places where the test script "sleep"s to wait for
some external condition to be met.

This is error prone, specially in slow systems (identified in CI by
"KSFT_MACHINE_SLOW=yes").

To fix this, add a "ovs_wait" function that tries to execute a command
a few times until it succeeds. The timeout used is set to 5s for
"normal" systems and doubled if a slow CI machine is detected.

This should make the following work:

$ vng --build  \
    --config tools/testing/selftests/net/config \
    --config kernel/configs/debug.config

$ vng --run . --user root -- "make -C tools/testing/selftests/ \
    KSFT_MACHINE_SLOW=yes TARGETS=net/openvswitch run_tests"

Signed-off-by: Adrian Moreno <amorenoz@redhat.com>
Reviewed-by: Ilya Maximets <i.maximets@ovn.org>
Link: https://patch.msgid.link/20240710090500.1655212-1-amorenoz@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/net/openvswitch/openvswitch.sh
tools/testing/selftests/net/openvswitch/ovs-dpctl.py