From 9ba6dcf558eeb876f863e13e6250c13341a2a3f0 Mon Sep 17 00:00:00 2001 From: Andrew Yourtchenko Date: Tue, 20 Jun 2023 14:52:08 +0000 Subject: tests: do not run qemu interface tests if the environment does not allow it cdf73b973181ff4c67147900408216e37bae897a has added the qemu tests as part of the default test run, which results in "make test" failure in more restricted environments which do not allow the namespace creation. Add a config flag to skip those tests, and skip them if the namespace creation fails. Type: test Signed-off-by: Andrew Yourtchenko Change-Id: Ie631f7fb2a80864f77c79619eba4a43712e950e5 --- test/config.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test/config.py') diff --git a/test/config.py b/test/config.py index 578cc40fa2a..5d2ef1dab4f 100644 --- a/test/config.py +++ b/test/config.py @@ -2,6 +2,7 @@ import argparse import os import psutil import time +from vpp_qemu_utils import can_create_namespaces def positive_int_or_default(default): @@ -191,6 +192,11 @@ parser.add_argument( ) parser.add_argument("--extended", action="store_true", help="run extended tests") +parser.add_argument( + "--skip-netns-tests", + action="store_true", + help="skip tests involving netns operations", +) parser.add_argument( "--sanity", action="store_true", help="perform sanity vpp run before running tests" @@ -444,6 +450,10 @@ elif config.max_vpp_cpus > 0: else: max_vpp_cpus = num_cpus +if not config.skip_netns_tests: + if not can_create_namespaces(): + config.skip_netns_tests = True + if __name__ == "__main__": print("Provided arguments:") for i in config.__dict__: -- cgit 1.2.3-korg