summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authoradrianvillin <avillin@cisco.com>2023-10-31 13:15:53 +0100
committerAndrew Yourtchenko <ayourtch@gmail.com>2023-10-31 15:29:08 +0000
commite908fe7e474d6b7b1e9e1bd2fb39423e1552a35f (patch)
tree3dfdc1fcf9eaaa474e51aab5835fa9f23171d3a0 /test
parent4a8fde0e51a94191efecedb431d6b9a524a23b29 (diff)
tests: http static - skip if cannot create namespaces
Type: test Change-Id: I5fddb293f1b56853613ca2823dbb6d3d887d9929 Signed-off-by: adrianvillin <avillin@cisco.com>
Diffstat (limited to 'test')
-rw-r--r--test/asf/test_http_static.py15
1 files changed, 6 insertions, 9 deletions
diff --git a/test/asf/test_http_static.py b/test/asf/test_http_static.py
index 17eed9c9c7b..504ffa35236 100644
--- a/test/asf/test_http_static.py
+++ b/test/asf/test_http_static.py
@@ -6,7 +6,6 @@ import tempfile
from vpp_qemu_utils import (
create_host_interface,
delete_host_interfaces,
- can_create_namespaces,
create_namespace,
delete_namespace,
)
@@ -15,8 +14,9 @@ from vpp_qemu_utils import (
@unittest.skipIf(
"http_static" in config.excluded_plugins, "Exclude HTTP Static Server plugin tests"
)
+@unittest.skipIf(config.skip_netns_tests, "netns not available or disabled from cli")
class TestHttpStaticVapi(VppTestCase):
- """enable the http static server [VAPI]"""
+ """enable the http static server and send requests [VAPI]"""
@classmethod
def setUpClass(cls):
@@ -28,11 +28,9 @@ class TestHttpStaticVapi(VppTestCase):
cls.temp2 = tempfile.NamedTemporaryFile()
cls.temp2.write(b"Hello world2")
- if not can_create_namespaces():
- raise Exception("Unable to create namespace")
create_namespace("HttpStatic")
-
create_host_interface("vppHost", "vppOut", "HttpStatic", "10.10.1.1/24")
+
cls.vapi.cli("create host-interface name vppOut")
cls.vapi.cli("set int state host-vppOut up")
cls.vapi.cli("set int ip address host-vppOut 10.10.1.2/24")
@@ -83,8 +81,9 @@ class TestHttpStaticVapi(VppTestCase):
@unittest.skipIf(
"http_static" in config.excluded_plugins, "Exclude HTTP Static Server plugin tests"
)
+@unittest.skipIf(config.skip_netns_tests, "netns not available or disabled from cli")
class TestHttpStaticCli(VppTestCase):
- """enable the static http server [CLI]"""
+ """enable the static http server and send requests [CLI]"""
@classmethod
def setUpClass(cls):
@@ -96,11 +95,9 @@ class TestHttpStaticCli(VppTestCase):
cls.temp2 = tempfile.NamedTemporaryFile()
cls.temp2.write(b"Hello world2")
- if not can_create_namespaces("vpp_chk_4212_2"):
- raise Exception("Unable to create namespace")
create_namespace("HttpStatic2")
-
create_host_interface("vppHost2", "vppOut2", "HttpStatic2", "10.10.1.1/24")
+
cls.vapi.cli("create host-interface name vppOut2")
cls.vapi.cli("set int state host-vppOut2 up")
cls.vapi.cli("set int ip address host-vppOut2 10.10.1.2/24")