From db2e270d996b3e31037bcf5bd7e1292103f2f39a Mon Sep 17 00:00:00 2001 From: Takahiro Itazuri Date: Fri, 6 Dec 2024 07:45:57 +0000 Subject: [PATCH] test: Remove test_max_cpus.py test_max_cpus.py tests vCPUs are online only on a microVM without CPU templates, which is now covered as part of test_all_vcpus_online(). Remove the test and use the maximum number of vCPUs in the new tests. Signed-off-by: Takahiro Itazuri --- .../{test_cpu_multiple.py => test_cpu_all.py} | 7 ++++++ .../functional/test_max_vcpus.py | 23 ------------------- 2 files changed, 7 insertions(+), 23 deletions(-) rename tests/integration_tests/functional/{test_cpu_multiple.py => test_cpu_all.py} (87%) delete mode 100644 tests/integration_tests/functional/test_max_vcpus.py diff --git a/tests/integration_tests/functional/test_cpu_multiple.py b/tests/integration_tests/functional/test_cpu_all.py similarity index 87% rename from tests/integration_tests/functional/test_cpu_multiple.py rename to tests/integration_tests/functional/test_cpu_all.py index 1dd38a10906..6b934ffa394 100644 --- a/tests/integration_tests/functional/test_cpu_multiple.py +++ b/tests/integration_tests/functional/test_cpu_all.py @@ -9,7 +9,13 @@ are operating identically, except for the expected differences. """ +import pytest +# Use the maximum number of vCPUs supported by Firecracker +MAX_VCPUS = 32 + + +@pytest.mark.parametrize("vcpu_count", [MAX_VCPUS]) def test_all_vcpus_online(uvm_any): """Check all vCPUs are online inside guest""" assert ( @@ -18,6 +24,7 @@ def test_all_vcpus_online(uvm_any): ) +@pytest.mark.parametrize("vcpu_count", [MAX_VCPUS]) def test_all_vcpus_have_same_features(uvm_any): """ Check all vCPUs have the same features inside guest. diff --git a/tests/integration_tests/functional/test_max_vcpus.py b/tests/integration_tests/functional/test_max_vcpus.py deleted file mode 100644 index 05c1f3c51ff..00000000000 --- a/tests/integration_tests/functional/test_max_vcpus.py +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. -# SPDX-License-Identifier: Apache-2.0 -"""Tests scenario for microvms with max vcpus(32).""" - -MAX_VCPUS = 32 - - -def test_max_vcpus(uvm_plain): - """ - Test if all configured guest vcpus are online. - """ - microvm = uvm_plain - microvm.spawn() - - # Configure a microVM with 32 vCPUs. - microvm.basic_config(vcpu_count=MAX_VCPUS) - microvm.add_net_iface() - microvm.start() - - cmd = "nproc" - _, stdout, stderr = microvm.ssh.run(cmd) - assert stderr == "" - assert int(stdout) == MAX_VCPUS