Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
aos
GitHub Repository: aos/firecracker
Path: blob/main/tests/integration_tests/functional/test_max_vcpus.py
1958 views
1
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
# SPDX-License-Identifier: Apache-2.0
3
"""Tests scenario for microvms with max vcpus(32)."""
4
import host_tools.network as net_tools # pylint: disable=import-error
5
6
MAX_VCPUS = 32
7
8
9
def test_max_vcpus(test_microvm_with_ssh, network_config):
10
"""Test if all configured guest vcpus are online."""
11
microvm = test_microvm_with_ssh
12
microvm.spawn()
13
14
# Configure a microVM with 32 vCPUs.
15
microvm.basic_config(vcpu_count=MAX_VCPUS)
16
_tap, _, _ = microvm.ssh_network_config(network_config, '1')
17
18
microvm.start()
19
20
ssh_connection = net_tools.SSHConnection(microvm.ssh_config)
21
cmd = "nproc"
22
_, stdout, stderr = ssh_connection.execute_command(cmd)
23
assert stderr.read() == ""
24
assert int(stdout.read()) == MAX_VCPUS
25
26