diff options
author | Andrew Yourtchenko <ayourtch@gmail.com> | 2023-06-20 14:52:08 +0000 |
---|---|---|
committer | Andrew Yourtchenko <ayourtch@gmail.com> | 2023-06-21 17:20:03 +0000 |
commit | 9ba6dcf558eeb876f863e13e6250c13341a2a3f0 (patch) | |
tree | 8893de8cf1372b814518c3cf091ac91509e81e15 /test/test_vm_vpp_interfaces.py | |
parent | 4aeba3776244efe5fbf8de894b6af13a9220762c (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/test_vm_vpp_interfaces.py')
-rw-r--r-- | test/test_vm_vpp_interfaces.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/test_vm_vpp_interfaces.py b/test/test_vm_vpp_interfaces.py index f87a48aef37..6866c24d228 100644 --- a/test/test_vm_vpp_interfaces.py +++ b/test/test_vm_vpp_interfaces.py @@ -63,6 +63,9 @@ layer3 = test_config["L3"] def create_test(test_name, test, ip_version, mtu): """Create and return a unittest method for a test.""" + @unittest.skipIf( + config.skip_netns_tests, "netns not available or disabled from cli" + ) def test_func(self): self.logger.debug(f"Starting unittest:{test_name}") self.setUpTestToplogy(test=test, ip_version=ip_version) @@ -97,6 +100,8 @@ def create_test(test_name, test, ip_version, mtu): def generate_vpp_interface_tests(): """Generate unittests for testing vpp interfaces.""" + if config.skip_netns_tests: + print("Skipping netns tests") for test in tests: for ip_version in test_config["ip_versions"]: for mtu in test_config["mtus"]: |