]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
selftests: net: make ovs-dpctl.py fail when pyroute2 is unsupported
authorAleksei Oladko <aleksey.oladko@virtuozzo.com>
Fri, 6 Mar 2026 00:01:23 +0000 (00:01 +0000)
committerJakub Kicinski <kuba@kernel.org>
Sat, 7 Mar 2026 03:26:23 +0000 (19:26 -0800)
The pmtu.sh kselftest configures OVS using ovs-dpctl.py and falls back
to ovs-vsctl only when ovs-dpctl.py fails. However, ovs-dpctl.py exits
with a success status when the installed pyroute2 package version is
lower than 0.6, even though the OVS datapath is not configured.

As a result, pmtu.sh assumes that the setup was successful and
continues running the test, which later fails due to the missing
OVS configuration.

Fix the exit code handling in ovs-dpctl.py so that pmtu.sh can detect
that the setup did not complete successfully and fall back to
ovs-vsctl.

Signed-off-by: Aleksei Oladko <aleksey.oladko@virtuozzo.com>
Reviewed-by: Aaron Conole <aconole@redhat.com>
Link: https://patch.msgid.link/20260306000127.519064-3-aleksey.oladko@virtuozzo.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/net/openvswitch/ovs-dpctl.py

index b521e0dea5061a0d01788725a25914e343552c32..848f61fdcee09aee2603ca587de65d3f2c7fadb4 100644 (file)
@@ -2583,7 +2583,7 @@ def main(argv):
     prverscheck = pyroute2.__version__.split(".")
     if int(prverscheck[0]) == 0 and int(prverscheck[1]) < 6:
         print("Need to upgrade the python pyroute2 package to >= 0.6.")
-        sys.exit(0)
+        sys.exit(1)
 
     parser = argparse.ArgumentParser()
     parser.add_argument(