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/test_vm_vpp_interfaces.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test/test_vm_vpp_interfaces.py') 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"]: -- cgit 1.2.3-korg