Skip to contentSkip to conversation

tests/functional: Fix the ppc64_hv and the ppc_40p test for read-only assets

PATCH In review Thomas Huth 2 participants 2 messages Nov 5, 2024 – Nov 8, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests/functional: Fix the ppc64_hv and the ppc_40p test for read-only assets

Since commit 786bc2255256, cached asset files are read-only, so now we've got to use "read-only=true" in tests that try to use these files directly.

Fixes 786bc22552 ("tests/functional: make cached asset files read-only")
---
 tests/functional/test_ppc64_hv.py | 3 ++-
 tests/functional/test_ppc_40p.py  | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
tests/functional/test_ppc64_hv.py +2 -1
index 1a6e4b6d07..312248bbfe 100755
@@ -99,7 +99,8 @@ def do_start_alpine(self):
         self.vm.add_args("-kernel", self.vmlinuz)
         self.vm.add_args("-initrd", self.initramfs)
         self.vm.add_args("-smp", "4", "-m", "2g")
-        self.vm.add_args("-drive", f"file={self.iso_path},format=raw,if=none,id=drive0")
+        self.vm.add_args("-drive", f"file={self.iso_path},format=raw,if=none,"
+                                    "id=drive0,read-only=true")
 
         self.vm.launch()
         wait_for_console_pattern(self, 'Welcome to Alpine Linux 3.18')
tests/functional/test_ppc_40p.py +2 -1
index c64e876c1f..67bcdae53a 100755
@@ -46,7 +46,8 @@ def test_factory_firmware_and_netbsd(self):
 
         self.vm.set_console()
         self.vm.add_args('-bios', bios_path,
-                         '-fda', drive_path)
+                         '-drive',
+                         f"file={drive_path},format=raw,if=floppy,read-only=true")
         self.vm.launch()
         os_banner = 'NetBSD 4.0 (GENERIC) #0: Sun Dec 16 00:49:40 PST 2007'
         wait_for_console_pattern(self, os_banner)
Signature · 1 line
2.47.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Thomas Huth

Since commit 786bc2255256, cached asset files are read-only, so now we've got to use "read-only=true" in tests that try to use these files directly.

Fixes 786bc22552 ("tests/functional: make cached asset files read-only")

LGTM

Quoted 33 lines
---
 tests/functional/test_ppc64_hv.py | 3 ++-
 tests/functional/test_ppc_40p.py  | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
tests/functional/test_ppc64_hv.py +2 -1
index 1a6e4b6d07..312248bbfe 100755
@@ -99,7 +99,8 @@ def do_start_alpine(self):
         self.vm.add_args("-kernel", self.vmlinuz)
         self.vm.add_args("-initrd", self.initramfs)
         self.vm.add_args("-smp", "4", "-m", "2g")
-        self.vm.add_args("-drive", f"file={self.iso_path},format=raw,if=none,id=drive0")
+        self.vm.add_args("-drive", f"file={self.iso_path},format=raw,if=none,"
+                                    "id=drive0,read-only=true")
 
         self.vm.launch()
         wait_for_console_pattern(self, 'Welcome to Alpine Linux 3.18')
tests/functional/test_ppc_40p.py +2 -1
index c64e876c1f..67bcdae53a 100755
@@ -46,7 +46,8 @@ def test_factory_firmware_and_netbsd(self):
 
         self.vm.set_console()
         self.vm.add_args('-bios', bios_path,
-                         '-fda', drive_path)
+                         '-drive',
+                         f"file={drive_path},format=raw,if=floppy,read-only=true")
         self.vm.launch()
         os_banner = 'NetBSD 4.0 (GENERIC) #0: Sun Dec 16 00:49:40 PST 2007'
         wait_for_console_pattern(self, os_banner)