Skip to contentSkip to conversation

tests/avocado: move aarch64 boot_linux tcg tests and slim down

RFC PATCH In review Alex Bennée 2 participants 2 messages Nov 17, 2022

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 tests/avocado: move aarch64 boot_linux tcg tests and slim down

The boot_linux tests download and run a full cloud image boot and start a full distro. While the ability to test the full boot chain is worthwhile it is perhaps a little too heavy weight and causes issues in CI. Fix this by dropping the TCG tests in boot_linux and replacing them with a alpine linux ISO boot in machine_aarch64_virt.

This boots a fully loaded -cpu max with all the bells and whistles in 41s on my machine. A full debug build takes around 250s on my machine so we set a more generous timeout to cover that.

We do drop testing for lesser GIC versions although there is some coverage for that already in the boot_xen.py tests. If we want to introduce more comprehensive testing we can do it with a custom kernel and initrd rather than a full distro boot.

---
 tests/avocado/boot_linux.py           | 43 +++++--------------------
 tests/avocado/machine_aarch64_virt.py | 46 ++++++++++++++++++++++++++-
 2 files changed, 53 insertions(+), 36 deletions(-)
tests/avocado/boot_linux.py +8 -35
index 2be4be395d..0b747d5aa9 100644
@@ -58,56 +58,29 @@ def test_pc_q35_kvm(self):
         self.launch_and_wait(set_up_ssh_connection=False)
 
 
+# For Aarch64 we only boot KVM tests with the full LinuxTest cloud
+# init. The TCG tests are run with lighter weight distros in the
+# machine_aarch64_virt.py tests.
 class BootLinuxAarch64(LinuxTest):
     """
     :avocado: tags=arch:aarch64
     :avocado: tags=machine:virt
-    :avocado: tags=machine:gic-version=2
     """
     timeout = 240
 
-    def add_common_args(self):
-        self.vm.add_args('-bios',
-                         os.path.join(BUILD_DIR, 'pc-bios',
-                                      'edk2-aarch64-code.fd'))
-        self.vm.add_args('-device', 'virtio-rng-pci,rng=rng0')
-        self.vm.add_args('-object', 'rng-random,id=rng0,filename=/dev/urandom')
-
-    def test_virt_tcg_gicv2(self):
-        """
-        :avocado: tags=accel:tcg
-        :avocado: tags=cpu:max
-        :avocado: tags=device:gicv2
-        """
-        self.require_accelerator("tcg")
-        self.vm.add_args("-accel", "tcg")
-        self.vm.add_args("-cpu", "max,lpa2=off")
-        self.vm.add_args("-machine", "virt,gic-version=2")
-        self.add_common_args()
-        self.launch_and_wait(set_up_ssh_connection=False)
-
-    def test_virt_tcg_gicv3(self):
-        """
-        :avocado: tags=accel:tcg
-        :avocado: tags=cpu:max
-        :avocado: tags=device:gicv3
-        """
-        self.require_accelerator("tcg")
-        self.vm.add_args("-accel", "tcg")
-        self.vm.add_args("-cpu", "max,lpa2=off")
-        self.vm.add_args("-machine", "virt,gic-version=3")
-        self.add_common_args()
-        self.launch_and_wait(set_up_ssh_connection=False)
-
     def test_virt_kvm(self):
         """
         :avocado: tags=accel:kvm
         :avocado: tags=cpu:host
+        :avocado: tags=machine:gic-version=host
         """
         self.require_accelerator("kvm")
         self.vm.add_args("-accel", "kvm")
         self.vm.add_args("-machine", "virt,gic-version=host")
-        self.add_common_args()
+        self.vm.add_args('-bios', os.path.join(BUILD_DIR, 'pc-bios',
+                                               'edk2-aarch64-code.fd'))
+        self.vm.add_args('-device', 'virtio-rng-pci,rng=rng0')
+        self.vm.add_args('-object', 'rng-random,id=rng0,filename=/dev/urandom')
         self.launch_and_wait(set_up_ssh_connection=False)
 
 
tests/avocado/machine_aarch64_virt.py +45 -1

68 lines not on this page · raw message

Signature · 1 line
2.34.1
#1 lore raw
Quoted 15 lines · Alex Bennée

The boot_linux tests download and run a full cloud image boot and start a full distro. While the ability to test the full boot chain is worthwhile it is perhaps a little too heavy weight and causes issues in CI. Fix this by dropping the TCG tests in boot_linux and replacing them with a alpine linux ISO boot in machine_aarch64_virt.

This boots a fully loaded -cpu max with all the bells and whistles in 41s on my machine. A full debug build takes around 250s on my machine so we set a more generous timeout to cover that.

We do drop testing for lesser GIC versions although there is some coverage for that already in the boot_xen.py tests. If we want to introduce more comprehensive testing we can do it with a custom kernel and initrd rather than a full distro boot.

Quoted 5 lines
---
  tests/avocado/boot_linux.py           | 43 +++++--------------------
  tests/avocado/machine_aarch64_virt.py | 46 ++++++++++++++++++++++++++-
  2 files changed, 53 insertions(+), 36 deletions(-)

I'd rather keep the current tests but:
1/ rename them as '_cloud_image',
2/ skip them on CI
and 3/ add the '_alpine' tests to run on CI.