mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
tests: centralize memory validation in test helpers
Replace the hard-coded memory threshold check in the simple launch integration test with Guest::validate_memory(None). Add Guest::get_expected_memory() to derive thresholds from mem_size_str and vm_type, and reuse this through validate_memory(). Signed-off-by: Muminul Islam <muislam@microsoft.com>
This commit is contained in:
committed by
Rob Bradford
parent
05aeef06e5
commit
32edcf39a6
@@ -2560,7 +2560,7 @@ fn _test_simple_launch(guest: &Guest) {
|
||||
guest.wait_vm_boot().unwrap();
|
||||
|
||||
guest.validate_cpu_count(None);
|
||||
assert!(guest.get_total_memory().unwrap_or_default() > 480_000);
|
||||
guest.validate_memory(None);
|
||||
assert_eq!(guest.get_pci_bridge_class().unwrap_or_default(), "0x060000");
|
||||
assert!(check_sequential_events(
|
||||
&guest
|
||||
|
||||
Reference in New Issue
Block a user