Path: blob/main/tests/integration_tests/functional/test_max_vcpus.py
1958 views
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.1# SPDX-License-Identifier: Apache-2.02"""Tests scenario for microvms with max vcpus(32)."""3import host_tools.network as net_tools # pylint: disable=import-error45MAX_VCPUS = 32678def test_max_vcpus(test_microvm_with_ssh, network_config):9"""Test if all configured guest vcpus are online."""10microvm = test_microvm_with_ssh11microvm.spawn()1213# Configure a microVM with 32 vCPUs.14microvm.basic_config(vcpu_count=MAX_VCPUS)15_tap, _, _ = microvm.ssh_network_config(network_config, '1')1617microvm.start()1819ssh_connection = net_tools.SSHConnection(microvm.ssh_config)20cmd = "nproc"21_, stdout, stderr = ssh_connection.execute_command(cmd)22assert stderr.read() == ""23assert int(stdout.read()) == MAX_VCPUS242526