]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
tests/functional/ppc64/test_hv: Silence warnings reported by pylint
authorThomas Huth <thuth@redhat.com>
Wed, 29 Oct 2025 15:49:54 +0000 (16:49 +0100)
committerThomas Huth <thuth@redhat.com>
Mon, 12 Jan 2026 12:53:32 +0000 (13:53 +0100)
To make pylint happy here, remove unused variables, switch to f-string,
use "check=True" when calling subprocess.run() and split a line that was
too long.

Message-Id: <20251119082636.43286-7-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
tests/functional/ppc64/test_hv.py

index d87f440fa798480d13c307f1b7a9b89e1e43f410..beec1dbbea39d4efb01aeb215e92164e624f1872 100755 (executable)
@@ -29,8 +29,6 @@ from qemu_test import exec_command_and_wait_for_pattern
 @skipBigDataTest()
 class HypervisorTest(QemuSystemTest):
 
-    timeout = 1000
-    KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 console=hvc0 '
     panic_message = 'Kernel panic - not syncing'
     good_message = 'VFS: Cannot open root device'
 
@@ -49,8 +47,8 @@ class HypervisorTest(QemuSystemTest):
         """
         filename = self.scratch_file(os.path.basename(path))
 
-        cmd = "xorriso -osirrox on -indev %s -cpx %s %s" % (iso, path, filename)
-        subprocess.run(cmd.split(),
+        cmd = f"xorriso -osirrox on -indev {iso} -cpx {path} {filename}"
+        subprocess.run(cmd.split(), check=True,
                        stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
 
         os.chmod(filename, 0o600)
@@ -66,7 +64,6 @@ class HypervisorTest(QemuSystemTest):
 
     def do_start_alpine(self):
         self.vm.set_console()
-        kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE
         self.vm.add_args("-kernel", self.vmlinuz)
         self.vm.add_args("-initrd", self.initramfs)
         self.vm.add_args("-smp", "4", "-m", "2g")
@@ -78,7 +75,8 @@ class HypervisorTest(QemuSystemTest):
         wait_for_console_pattern(self, 'localhost login:')
         exec_command_and_wait_for_pattern(self, 'root', ps1)
         # If the time is wrong, SSL certificates can fail.
-        exec_command_and_wait_for_pattern(self, 'date -s "' + datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S' + '"'), ps1)
+        cmd='date -s "' + datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S' + '"')
+        exec_command_and_wait_for_pattern(self, cmd, ps1)
         ps1='alpine:~#'
         exec_command_and_wait_for_pattern(self, 'setup-alpine -qe', ps1)
         exec_command_and_wait_for_pattern(self, 'setup-apkrepos -c1', ps1)