tests: Optimize integration test on AArch64

AArch64 tests were divided into 2 steps:
- Build and test with 'acpi' feature
- Build and test without 'acpi'

This can be optimized. We need only to build and test once with default
features ('acpi' is enabled).

On AArch64, ACPI only works with UEFI. If UEFI is not available, guest
kernel fall back to use FDT. Most AArch64 test cases boot from direct
kernel, the guest will keep using FDT even if ACPI is enabled. So
nothing is broken.

Signed-off-by: Michael Zhao <michael.zhao@arm.com>
This commit is contained in:
Michael Zhao
2021-06-24 11:07:06 +08:00
committed by Rob Bradford
parent 3613b4c096
commit d330d91e1a
2 changed files with 13 additions and 22 deletions

View File

@@ -1039,7 +1039,7 @@ mod tests {
);
// ACPI feature is needed.
#[cfg(feature = "acpi")]
#[cfg(all(target_arch = "x86_64", feature = "acpi"))]
{
guest.enable_memory_hotplug();
@@ -1179,7 +1179,7 @@ mod tests {
);
// ACPI feature is needed.
#[cfg(feature = "acpi")]
#[cfg(all(target_arch = "x86_64", feature = "acpi"))]
{
guest.enable_memory_hotplug();
@@ -1383,7 +1383,7 @@ mod tests {
);
// ACPI feature is needed.
#[cfg(feature = "acpi")]
#[cfg(all(target_arch = "x86_64", feature = "acpi"))]
{
guest.enable_memory_hotplug();
@@ -4165,6 +4165,12 @@ mod tests {
thread::sleep(std::time::Duration::new(20, 0));
let r = std::panic::catch_unwind(|| {
// On AArch64 when acpi is enabled, there is a 4 MiB gap between the RAM
// that the VMM gives and the guest can see.
// This is a temporary solution, will be fixed in future.
#[cfg(all(target_arch = "aarch64", feature = "acpi"))]
let guest_memory_size_kb = guest_memory_size_kb - 4 * 1024;
let overhead = get_vmm_overhead(child.id(), guest_memory_size_kb);
eprintln!(
"Guest memory overhead: {} vs {}",