mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
test_infra: improve guest MemTotal assertion message
validate_memory() asserts that the guest's reported MemTotal exceeds the expected size, but on failure printed nothing about either value. Include both the actual and expected figures in the panic message so a failing run is self-explanatory. Assisted-by: Claude:Opus-4.8 Signed-off-by: Ruben Hakobyan <hruben@meta.com>
This commit is contained in:
committed by
Rob Bradford
parent
ec157d7eb9
commit
1071a3d301
@@ -1804,7 +1804,11 @@ impl Guest {
|
||||
.or_else(|| self.get_expected_memory())
|
||||
.unwrap_or_default();
|
||||
|
||||
assert!(self.get_total_memory().unwrap_or_default() > memory);
|
||||
let total = self.get_total_memory().unwrap_or_default();
|
||||
assert!(
|
||||
total > memory,
|
||||
"guest MemTotal {total} kB is not greater than expected {memory} kB"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user