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:
Muminul Islam
2026-02-22 22:39:10 -08:00
committed by Rob Bradford
parent 05aeef06e5
commit 32edcf39a6
2 changed files with 35 additions and 1 deletions

View File

@@ -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