mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-08-21 23:41:15 +00:00
tests: Use Ubuntu Jammy for test_multi_cpu
This allows the unification of the same testing methodology with aarch64 and removes a user of the Bionic image. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
7d16c74020
commit
8868c9c950
@ -2022,8 +2022,10 @@ mod common_parallel {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_multi_cpu() {
|
fn test_multi_cpu() {
|
||||||
let bionic = UbuntuDiskConfig::new(BIONIC_IMAGE_NAME.to_string());
|
let jammy_image = JAMMY_IMAGE_NAME.to_string();
|
||||||
let guest = Guest::new(Box::new(bionic));
|
let jammy = UbuntuDiskConfig::new(jammy_image);
|
||||||
|
let guest = Guest::new(Box::new(jammy));
|
||||||
|
|
||||||
let mut cmd = GuestCommand::new(&guest);
|
let mut cmd = GuestCommand::new(&guest);
|
||||||
cmd.args(["--cpus", "boot=2,max=4"])
|
cmd.args(["--cpus", "boot=2,max=4"])
|
||||||
.args(["--memory", "size=512M"])
|
.args(["--memory", "size=512M"])
|
||||||
@ -2040,18 +2042,11 @@ mod common_parallel {
|
|||||||
|
|
||||||
assert_eq!(guest.get_cpu_count().unwrap_or_default(), 2);
|
assert_eq!(guest.get_cpu_count().unwrap_or_default(), 2);
|
||||||
|
|
||||||
#[cfg(target_arch = "x86_64")]
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
guest
|
guest
|
||||||
.ssh_command(r#"dmesg | grep "smpboot: Allowing" | sed "s/\[\ *[0-9.]*\] //""#)
|
.ssh_command(
|
||||||
.unwrap()
|
r#"sudo dmesg | grep "smp: Brought up" | sed "s/\[\ *[0-9.]*\] //""#
|
||||||
.trim(),
|
)
|
||||||
"smpboot: Allowing 4 CPUs, 2 hotplug CPUs"
|
|
||||||
);
|
|
||||||
#[cfg(target_arch = "aarch64")]
|
|
||||||
assert_eq!(
|
|
||||||
guest
|
|
||||||
.ssh_command(r#"dmesg | grep "smp: Brought up" | sed "s/\[\ *[0-9.]*\] //""#)
|
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.trim(),
|
.trim(),
|
||||||
"smp: Brought up 1 node, 2 CPUs"
|
"smp: Brought up 1 node, 2 CPUs"
|
||||||
|
Loading…
Reference in New Issue
Block a user