tests: do not run qemu interface tests if the environment does not allow it

cdf73b9731 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 <ayourtch@gmail.com>
Change-Id: Ie631f7fb2a80864f77c79619eba4a43712e950e5
This commit is contained in:
Andrew Yourtchenko
2023-06-20 14:52:08 +00:00
parent 4aeba37762
commit 9ba6dcf558
3 changed files with 39 additions and 2 deletions

View File

@@ -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__: