summaryrefslogtreecommitdiff
path: root/smoketest/scripts/cli
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-04-17 21:11:05 +0200
committerGitHub <noreply@github.com>2021-04-17 21:11:05 +0200
commitccfd6d24c41dc229f24317a90d1387c70ca2c674 (patch)
tree5e5c70c587957e5b720306e18a523d20e8bb3ac1 /smoketest/scripts/cli
parent837929297855034e4bea339ae5081c68daa4d6cb (diff)
parentb5c9dd63967c926083e36d1e074ac7c6a22578bb (diff)
downloadvyos-1x-ccfd6d24c41dc229f24317a90d1387c70ca2c674.tar.gz
vyos-1x-ccfd6d24c41dc229f24317a90d1387c70ca2c674.zip
Merge pull request #814 from sever-sever/T2216-smoketest
smoketest: T2216: Containers set ip to test01
Diffstat (limited to 'smoketest/scripts/cli')
-rwxr-xr-xsmoketest/scripts/cli/test_container.py20
1 files changed, 6 insertions, 14 deletions
diff --git a/smoketest/scripts/cli/test_container.py b/smoketest/scripts/cli/test_container.py
index d4f152828..09ca89721 100755
--- a/smoketest/scripts/cli/test_container.py
+++ b/smoketest/scripts/cli/test_container.py
@@ -27,7 +27,7 @@ from vyos.util import read_file
base_path = ['container']
cont_image = 'busybox'
-prefix = '192.0.2.0/24'
+prefix = '192.168.205.0/24'
net_name = 'NET01'
PROCESS_NAME = 'podman'
@@ -39,23 +39,15 @@ def cmd_to_json(command):
class TesContainer(VyOSUnitTestSHIM.TestCase):
- # We need real internet connection to pull images
- def setUp(self):
+
+ def test_01_basic_container(self):
+ cont_name = 'c1'
+
self.cli_set(['interfaces', 'ethernet', 'eth0', 'address', '10.0.2.15/24'])
self.cli_set(['protocols', 'static', 'route', '0.0.0.0/0', 'next-hop', '10.0.2.2'])
self.cli_set(['system', 'name-server', '1.1.1.1'])
self.cli_set(['system', 'name-server', '8.8.8.8'])
- def tearDown(self):
- self.cli_delete(['interfaces', 'ethernet', 'eth0', 'address', '10.0.2.15/24'])
- self.cli_delete(['protocols', 'static', 'route', '0.0.0.0/0', 'next-hop', '10.0.2.2'])
- self.cli_delete(['system', 'name-server', '1.1.1.1'])
- self.cli_delete(['system', 'name-server', '8.8.8.8'])
- self.cli_delete(base_path)
- self.cli_commit()
-
- def test_01_basic_container(self):
- cont_name = 'c1'
self.cli_set(base_path + ['name', cont_name, 'image', cont_image])
self.cli_set(base_path + ['name', cont_name, 'allow-host-networks'])
@@ -67,7 +59,7 @@ class TesContainer(VyOSUnitTestSHIM.TestCase):
def test_02_container_network(self):
cont_name = 'c2'
- cont_ip = '192.0.2.25'
+ cont_ip = '192.168.205.25'
self.cli_set(base_path + ['network', net_name, 'ipv4-prefix', prefix])
self.cli_set(base_path + ['name', cont_name, 'image', cont_image])
self.cli_set(base_path + ['name', cont_name, 'network', net_name, 'address', cont_ip])