forked from firecracker-microvm/firecracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
As seen in firecracker-microvm#4925, a bad CPU template made secondary CPUs not come up. To catch similar bugs of CPU templates, check all the vCPUs are online from guests' perspective. Signed-off-by: Takahiro Itazuri <[email protected]>
- Loading branch information
Showing
2 changed files
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
""" | ||
Test all vCPUs are configured correctly and work properly. | ||
This test suite aims to catch bugs of Firecracker's vCPU configuration and | ||
CPU templates especially under multi-vCPU setup, by checking that all vCPUs | ||
are operating identically, except for the expected differences. | ||
""" | ||
|
||
import pytest | ||
|
||
|
||
def test_all_vcpus_online(uvm_any): | ||
"""Check all vCPUs are online inside guest""" | ||
vm = uvm_any | ||
for idx in range(vm.vcpus_count): | ||
assert vm.ssh.check_output(f"cat /sys/devices/system/cpu/cpu{idx}/online").stdout == "1\n" |