qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/2] tests/avocado: updates for sbsa-ref testing
@ 2024-07-03 14:06 Marcin Juszkiewicz
  2024-07-03 14:06 ` [PATCH v4 1/2] tests/avocado: sbsa-ref: add FreeBSD tests Marcin Juszkiewicz
  2024-07-03 14:06 ` [PATCH v4 2/2] tests/avocado: add test for default sbsa-ref cpu Marcin Juszkiewicz
  0 siblings, 2 replies; 5+ messages in thread
From: Marcin Juszkiewicz @ 2024-07-03 14:06 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-arm, Leif Lindholm, Radoslaw Biernacki, Peter Maydell,
	Cleber Rosa, Philippe Mathieu-Daudé,
	Wainer dos Santos Moschetta, Beraldo Leal, Marcin Juszkiewicz

We want to have some non-Linux OS in testing in case one of changes keep
Linux booting but crash elsewhere. So far OpenBSD was used for it but we
move to FreeBSD 14.x due to longer support cycles.

One OpenBSD stays - will be run on Cortex-A57 only. And only on local
runs hidden behind AVOCADO_TEST_LEGACY_OS variable.

At same time we add test to run on default cpu settings. For now it is
plain Neoverse-N2 but we are considering either disabling PAuth or going
with 'impdef' way.

Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>

---
Changes in v4:
- hide OpenBSD test behind AVOCADO_TEST_LEGACY_OS switch
- Link to v3: https://lore.kernel.org/r/20240624-b4-move-to-freebsd-v3-0-71496bf119d4@linaro.org

Changes in v3:
- kept OpenBSD/Cortex-A57 test for local runs (by request of Philippe)
- Link to v2: https://lore.kernel.org/r/20240624-b4-move-to-freebsd-v2-0-64ea7b04998f@linaro.org

---
Marcin Juszkiewicz (2):
      tests/avocado: sbsa-ref: add FreeBSD tests
      tests/avocado: add test for default sbsa-ref cpu

 tests/avocado/machine_aarch64_sbsaref.py | 88 +++++++++++++++++++++++---------
 1 file changed, 64 insertions(+), 24 deletions(-)
---
base-commit: 1a2d52c7fcaeaaf4f2fe8d4d5183dccaeab67768
change-id: 20240624-b4-move-to-freebsd-aafdeb75ef38

Best regards,
-- 
Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v4 1/2] tests/avocado: sbsa-ref: add FreeBSD tests
  2024-07-03 14:06 [PATCH v4 0/2] tests/avocado: updates for sbsa-ref testing Marcin Juszkiewicz
@ 2024-07-03 14:06 ` Marcin Juszkiewicz
  2024-07-03 14:09   ` Philippe Mathieu-Daudé
  2024-07-03 14:06 ` [PATCH v4 2/2] tests/avocado: add test for default sbsa-ref cpu Marcin Juszkiewicz
  1 sibling, 1 reply; 5+ messages in thread
From: Marcin Juszkiewicz @ 2024-07-03 14:06 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-arm, Leif Lindholm, Radoslaw Biernacki, Peter Maydell,
	Cleber Rosa, Philippe Mathieu-Daudé,
	Wainer dos Santos Moschetta, Beraldo Leal, Marcin Juszkiewicz

FreeBSD has longer support cycle for stable release (14.x EoL in 2028)
than OpenBSD (7.3 we used is already EoL). Also bugfixes are backported
so we can stay on 14.x for longer. Tests done on OpenBSD will now be
done using FreeBSD.

OpenBSD 7.3 stays with Cortex-A57 test for local runs only.

Moved from Neoverse-N1 to Neoverse-N2 as sbsa-ref defaults were changed.

Timeout messages expanded to mention being affected by PAuth emulation.

Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
---
 tests/avocado/machine_aarch64_sbsaref.py | 73 ++++++++++++++++++++++++--------
 1 file changed, 55 insertions(+), 18 deletions(-)

diff --git a/tests/avocado/machine_aarch64_sbsaref.py b/tests/avocado/machine_aarch64_sbsaref.py
index e920bbf08c..2e27d37cb8 100644
--- a/tests/avocado/machine_aarch64_sbsaref.py
+++ b/tests/avocado/machine_aarch64_sbsaref.py
@@ -1,4 +1,4 @@
-# Functional test that boots a Linux kernel and checks the console
+# Functional test that boots a kernel and checks the console
 #
 # SPDX-FileCopyrightText: 2023-2024 Linaro Ltd.
 # SPDX-FileContributor: Philippe Mathieu-Daudé <philmd@linaro.org>
@@ -163,7 +163,8 @@ def test_sbsaref_alpine_linux_max_pauth_impdef(self):
         """
         self.boot_alpine_linux("max,pauth-impdef=on")
 
-    @skipUnless(os.getenv('AVOCADO_TIMEOUT_EXPECTED'), 'Test might timeout')
+    @skipUnless(os.getenv('AVOCADO_TIMEOUT_EXPECTED'),
+                'Test might timeout due to PAuth emulation')
     def test_sbsaref_alpine_linux_max(self):
         """
         :avocado: tags=cpu:max
@@ -171,7 +172,6 @@ def test_sbsaref_alpine_linux_max(self):
         """
         self.boot_alpine_linux("max")
 
-
     # This tests the whole boot chain from EFI to Userspace
     # We only boot a whole OS for the current top level CPU and GIC
     # Other test profiles should use more minimal boots
@@ -198,6 +198,9 @@ def boot_openbsd73(self, cpu):
                                  "Welcome to the OpenBSD/arm64"
                                  " 7.3 installation program.")
 
+
+    # we keep OpenBSD 7.3 on Cortex-A57 by request
+    @skipUnless(os.getenv('AVOCADO_TEST_LEGACY_OS'), 'OpenBSD 7.3 is EOL')
     def test_sbsaref_openbsd73_cortex_a57(self):
         """
         :avocado: tags=cpu:cortex-a57
@@ -205,32 +208,66 @@ def test_sbsaref_openbsd73_cortex_a57(self):
         """
         self.boot_openbsd73("cortex-a57")
 
-    def test_sbsaref_openbsd73_neoverse_n1(self):
+
+    # This tests the whole boot chain from EFI to Userspace
+    # We only boot a whole OS for the current top level CPU and GIC
+    # Other test profiles should use more minimal boots
+    def boot_freebsd(self, cpu):
+        self.fetch_firmware()
+
+        img_url = (
+            "https://download.freebsd.org/releases/arm64/aarch64/ISO-IMAGES/"
+            "14.1/FreeBSD-14.1-RELEASE-arm64-aarch64-bootonly.iso"
+        )
+
+        img_hash = "44cdbae275ef1bb6dab1d5fbb59473d4f741e1c8ea8a80fd9e906b531d6ad461"
+        img_path = self.fetch_asset(img_url, algorithm="sha256", asset_hash=img_hash)
+
+        self.vm.set_console()
+        self.vm.add_args(
+            "-cpu",
+            cpu,
+            "-drive",
+            f"file={img_path},format=raw",
+        )
+
+        self.vm.launch()
+        wait_for_console_pattern(self, "Welcome to FreeBSD!")
+
+    def test_sbsaref_freebsd_cortex_a57(self):
         """
-        :avocado: tags=cpu:neoverse-n1
-        :avocado: tags=os:openbsd
+        :avocado: tags=cpu:cortex-a57
+        :avocado: tags=os:freebsd
+        """
+        self.boot_freebsd("cortex-a57")
+
+    # We use Neoverse-N2 as default cpu
+    def test_sbsaref_freebsd_neoverse_n2(self):
         """
-        self.boot_openbsd73("neoverse-n1")
+        :avocado: tags=cpu:neoverse-n2
+        :avocado: tags=os:freebsd
+        """
+        self.boot_freebsd("neoverse-n2")
 
-    def test_sbsaref_openbsd73_max_pauth_off(self):
+    def test_sbsaref_freebsd_max_pauth_off(self):
         """
         :avocado: tags=cpu:max
-        :avocado: tags=os:openbsd
+        :avocado: tags=os:freebsd
         """
-        self.boot_openbsd73("max,pauth=off")
+        self.boot_freebsd("max,pauth=off")
 
-    @skipUnless(os.getenv('AVOCADO_TIMEOUT_EXPECTED'), 'Test might timeout')
-    def test_sbsaref_openbsd73_max_pauth_impdef(self):
+    def test_sbsaref_freebsd_max_pauth_impdef(self):
         """
         :avocado: tags=cpu:max
-        :avocado: tags=os:openbsd
+        :avocado: tags=os:freebsd
         """
-        self.boot_openbsd73("max,pauth-impdef=on")
+        self.boot_freebsd("max,pauth-impdef=on")
 
-    @skipUnless(os.getenv('AVOCADO_TIMEOUT_EXPECTED'), 'Test might timeout')
-    def test_sbsaref_openbsd73_max(self):
+    @skipUnless(os.getenv('AVOCADO_TIMEOUT_EXPECTED'),
+                'Test might timeout due to PAuth emulation')
+    def test_sbsaref_freebsd_max(self):
         """
         :avocado: tags=cpu:max
-        :avocado: tags=os:openbsd
+        :avocado: tags=os:freebsd
         """
-        self.boot_openbsd73("max")
+        self.boot_freebsd("max")

-- 
2.45.2



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v4 2/2] tests/avocado: add test for default sbsa-ref cpu
  2024-07-03 14:06 [PATCH v4 0/2] tests/avocado: updates for sbsa-ref testing Marcin Juszkiewicz
  2024-07-03 14:06 ` [PATCH v4 1/2] tests/avocado: sbsa-ref: add FreeBSD tests Marcin Juszkiewicz
@ 2024-07-03 14:06 ` Marcin Juszkiewicz
  2024-07-03 14:11   ` Philippe Mathieu-Daudé
  1 sibling, 1 reply; 5+ messages in thread
From: Marcin Juszkiewicz @ 2024-07-03 14:06 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-arm, Leif Lindholm, Radoslaw Biernacki, Peter Maydell,
	Cleber Rosa, Philippe Mathieu-Daudé,
	Wainer dos Santos Moschetta, Beraldo Leal, Marcin Juszkiewicz

We changed sbsa-ref cpu several times already and may do it again in a
future. To newer core or to enable/disable some properties.

This change switches Neoverse-N2 tests to 'let test default cpu' ones.

Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
---
 tests/avocado/machine_aarch64_sbsaref.py | 29 ++++++++++++++++-------------
 1 file changed, 16 insertions(+), 13 deletions(-)

diff --git a/tests/avocado/machine_aarch64_sbsaref.py b/tests/avocado/machine_aarch64_sbsaref.py
index 2e27d37cb8..46a1d982f3 100644
--- a/tests/avocado/machine_aarch64_sbsaref.py
+++ b/tests/avocado/machine_aarch64_sbsaref.py
@@ -113,7 +113,7 @@ def test_sbsaref_edk2_firmware(self):
     # This tests the whole boot chain from EFI to Userspace
     # We only boot a whole OS for the current top level CPU and GIC
     # Other test profiles should use more minimal boots
-    def boot_alpine_linux(self, cpu):
+    def boot_alpine_linux(self, cpu=False):
         self.fetch_firmware()
 
         iso_url = (
@@ -126,12 +126,14 @@ def boot_alpine_linux(self, cpu):
 
         self.vm.set_console()
         self.vm.add_args(
-            "-cpu",
-            cpu,
             "-drive",
             f"file={iso_path},format=raw",
         )
 
+        # let allow test which will use default cpu of platform
+        if cpu:
+            self.vm.add_args("-cpu", cpu)
+
         self.vm.launch()
         wait_for_console_pattern(self, "Welcome to Alpine Linux 3.17")
 
@@ -142,12 +144,12 @@ def test_sbsaref_alpine_linux_cortex_a57(self):
         """
         self.boot_alpine_linux("cortex-a57")
 
-    def test_sbsaref_alpine_linux_neoverse_n1(self):
+    # Let test whichever cpu is used as default
+    def test_sbsaref_alpine_linux_default(self):
         """
-        :avocado: tags=cpu:neoverse-n1
         :avocado: tags=os:linux
         """
-        self.boot_alpine_linux("neoverse-n1")
+        self.boot_alpine_linux()
 
     def test_sbsaref_alpine_linux_max_pauth_off(self):
         """
@@ -212,7 +214,7 @@ def test_sbsaref_openbsd73_cortex_a57(self):
     # This tests the whole boot chain from EFI to Userspace
     # We only boot a whole OS for the current top level CPU and GIC
     # Other test profiles should use more minimal boots
-    def boot_freebsd(self, cpu):
+    def boot_freebsd(self, cpu=False):
         self.fetch_firmware()
 
         img_url = (
@@ -225,12 +227,14 @@ def boot_freebsd(self, cpu):
 
         self.vm.set_console()
         self.vm.add_args(
-            "-cpu",
-            cpu,
             "-drive",
             f"file={img_path},format=raw",
         )
 
+        # let allow test which will use default cpu of platform
+        if cpu:
+            self.vm.add_args("-cpu", cpu)
+
         self.vm.launch()
         wait_for_console_pattern(self, "Welcome to FreeBSD!")
 
@@ -241,13 +245,12 @@ def test_sbsaref_freebsd_cortex_a57(self):
         """
         self.boot_freebsd("cortex-a57")
 
-    # We use Neoverse-N2 as default cpu
-    def test_sbsaref_freebsd_neoverse_n2(self):
+    # Let test whichever cpu is used as default
+    def test_sbsaref_freebsd_default(self):
         """
-        :avocado: tags=cpu:neoverse-n2
         :avocado: tags=os:freebsd
         """
-        self.boot_freebsd("neoverse-n2")
+        self.boot_freebsd()
 
     def test_sbsaref_freebsd_max_pauth_off(self):
         """

-- 
2.45.2



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v4 1/2] tests/avocado: sbsa-ref: add FreeBSD tests
  2024-07-03 14:06 ` [PATCH v4 1/2] tests/avocado: sbsa-ref: add FreeBSD tests Marcin Juszkiewicz
@ 2024-07-03 14:09   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-07-03 14:09 UTC (permalink / raw)
  To: Marcin Juszkiewicz, qemu-devel
  Cc: qemu-arm, Leif Lindholm, Radoslaw Biernacki, Peter Maydell,
	Cleber Rosa, Wainer dos Santos Moschetta, Beraldo Leal

On 3/7/24 16:06, Marcin Juszkiewicz wrote:
> FreeBSD has longer support cycle for stable release (14.x EoL in 2028)
> than OpenBSD (7.3 we used is already EoL). Also bugfixes are backported
> so we can stay on 14.x for longer. Tests done on OpenBSD will now be
> done using FreeBSD.
> 
> OpenBSD 7.3 stays with Cortex-A57 test for local runs only.
> 
> Moved from Neoverse-N1 to Neoverse-N2 as sbsa-ref defaults were changed.
> 
> Timeout messages expanded to mention being affected by PAuth emulation.
> 
> Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
> ---
>   tests/avocado/machine_aarch64_sbsaref.py | 73 ++++++++++++++++++++++++--------
>   1 file changed, 55 insertions(+), 18 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v4 2/2] tests/avocado: add test for default sbsa-ref cpu
  2024-07-03 14:06 ` [PATCH v4 2/2] tests/avocado: add test for default sbsa-ref cpu Marcin Juszkiewicz
@ 2024-07-03 14:11   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-07-03 14:11 UTC (permalink / raw)
  To: Marcin Juszkiewicz, qemu-devel
  Cc: qemu-arm, Leif Lindholm, Radoslaw Biernacki, Peter Maydell,
	Cleber Rosa, Wainer dos Santos Moschetta, Beraldo Leal

On 3/7/24 16:06, Marcin Juszkiewicz wrote:
> We changed sbsa-ref cpu several times already and may do it again in a
> future. To newer core or to enable/disable some properties.
> 
> This change switches Neoverse-N2 tests to 'let test default cpu' ones.
> 
> Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
> ---
>   tests/avocado/machine_aarch64_sbsaref.py | 29 ++++++++++++++++-------------
>   1 file changed, 16 insertions(+), 13 deletions(-)
> 
> diff --git a/tests/avocado/machine_aarch64_sbsaref.py b/tests/avocado/machine_aarch64_sbsaref.py
> index 2e27d37cb8..46a1d982f3 100644
> --- a/tests/avocado/machine_aarch64_sbsaref.py
> +++ b/tests/avocado/machine_aarch64_sbsaref.py
> @@ -113,7 +113,7 @@ def test_sbsaref_edk2_firmware(self):
>       # This tests the whole boot chain from EFI to Userspace
>       # We only boot a whole OS for the current top level CPU and GIC
>       # Other test profiles should use more minimal boots
> -    def boot_alpine_linux(self, cpu):
> +    def boot_alpine_linux(self, cpu=False):
>           self.fetch_firmware()
>   
>           iso_url = (
> @@ -126,12 +126,14 @@ def boot_alpine_linux(self, cpu):
>   
>           self.vm.set_console()
>           self.vm.add_args(
> -            "-cpu",
> -            cpu,
>               "-drive",
>               f"file={iso_path},format=raw",
>           )
>   
> +        # let allow test which will use default cpu of platform
> +        if cpu:
> +            self.vm.add_args("-cpu", cpu)

I think the pythonic way is to initialize cpu=None instead of False.

> +
>           self.vm.launch()
>           wait_for_console_pattern(self, "Welcome to Alpine Linux 3.17")



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-07-03 14:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-03 14:06 [PATCH v4 0/2] tests/avocado: updates for sbsa-ref testing Marcin Juszkiewicz
2024-07-03 14:06 ` [PATCH v4 1/2] tests/avocado: sbsa-ref: add FreeBSD tests Marcin Juszkiewicz
2024-07-03 14:09   ` Philippe Mathieu-Daudé
2024-07-03 14:06 ` [PATCH v4 2/2] tests/avocado: add test for default sbsa-ref cpu Marcin Juszkiewicz
2024-07-03 14:11   ` Philippe Mathieu-Daudé

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).