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:
Ruben Hakobyan
2026-06-07 14:52:42 -07:00
committed by Rob Bradford
parent ec157d7eb9
commit 1071a3d301

View File

@@ -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"
);
}
}