summaryrefslogtreecommitdiffstats
path: root/test/config.py
diff options
context:
space:
mode:
authorAndrew Yourtchenko <ayourtch@gmail.com>2023-06-20 14:52:08 +0000
committerAndrew Yourtchenko <ayourtch@gmail.com>2023-06-21 17:20:03 +0000
commit9ba6dcf558eeb876f863e13e6250c13341a2a3f0 (patch)
tree8893de8cf1372b814518c3cf091ac91509e81e15 /test/config.py
parent4aeba3776244efe5fbf8de894b6af13a9220762c (diff)
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 <ayourtch@gmail.com> Change-Id: Ie631f7fb2a80864f77c79619eba4a43712e950e5
Diffstat (limited to 'test/config.py')
-rw-r--r--test/config.py10
1 files changed, 10 insertions, 0 deletions
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__: