summaryrefslogtreecommitdiff
path: root/smoketest/scripts
diff options
context:
space:
mode:
authorNicolas Vollmar <nvo@scaling.ch>2024-05-27 13:12:54 +0200
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2024-05-28 18:16:31 +0000
commit8007b58f1e0ecfad9ed0cca7ecec725287432439 (patch)
tree1224dc7bbc2c95e3504a1c7ce6643ae6b0a9d863 /smoketest/scripts
parent10df4ad8a3d7182363460b8043af2cacf128c893 (diff)
downloadvyos-1x-8007b58f1e0ecfad9ed0cca7ecec725287432439.tar.gz
vyos-1x-8007b58f1e0ecfad9ed0cca7ecec725287432439.zip
T6406: add container cpu limit option
(cherry picked from commit 81dea053e7178b8fea836a85aacde2a38ffb9e09)
Diffstat (limited to 'smoketest/scripts')
-rwxr-xr-xsmoketest/scripts/cli/test_container.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_container.py b/smoketest/scripts/cli/test_container.py
index 3201883b8..ef31d0f6f 100755
--- a/smoketest/scripts/cli/test_container.py
+++ b/smoketest/scripts/cli/test_container.py
@@ -91,6 +91,22 @@ class TestContainer(VyOSUnitTestSHIM.TestCase):
# Check for running process
self.assertEqual(process_named_running(PROCESS_NAME), pid)
+ def test_cpu_limit(self):
+ cont_name = 'c2'
+
+ self.cli_set(base_path + ['name', cont_name, 'allow-host-networks'])
+ self.cli_set(base_path + ['name', cont_name, 'image', cont_image])
+ self.cli_set(base_path + ['name', cont_name, 'cpus', '1.25'])
+
+ self.cli_commit()
+
+ pid = 0
+ with open(PROCESS_PIDFILE.format(cont_name), 'r') as f:
+ pid = int(f.read())
+
+ # Check for running process
+ self.assertEqual(process_named_running(PROCESS_NAME), pid)
+
def test_ipv4_network(self):
prefix = '192.0.2.0/24'
base_name = 'ipv4'