tests/functional: switch over to using self.scratch_file()

Replace any instances of

  os.path.join(self.workdir, ".../...")
  self.workdir + "/.../..."

with

  self.scratch_file("...", "...")

which is more compact and portable

Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-ID: <20241217155953.3950506-15-berrange@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
This commit is contained in:
Daniel P. Berrangé 2024-12-17 15:59:35 +00:00 committed by Thomas Huth
parent bd96e460d3
commit beaf88c895
45 changed files with 118 additions and 139 deletions

View file

@ -9,8 +9,6 @@
#
# SPDX-License-Identifier: GPL-2.0-or-later
import os
from qemu_test import QemuSystemTest, LinuxKernelTest, Asset
from qemu_test import interrupt_interactive_console_until_pattern
from qemu_test import wait_for_console_pattern
@ -37,7 +35,7 @@ class MaltaMachineConsole(LinuxKernelTest):
'ce21ff4b07a981ecb8a39db2876616f5a2473eb2ab459c6f67465b9914b0c6b6')
def do_test_mips_malta32el_nanomips(self, kernel_path_xz):
kernel_path = os.path.join(self.workdir, 'kernel')
kernel_path = self.scratch_file('kernel')
lzma_uncompress(kernel_path_xz, kernel_path)
self.set_machine('malta')
@ -78,7 +76,7 @@ class MaltaMachineYAMON(QemuSystemTest):
zip_path = self.ASSET_YAMON_ROM.fetch()
with ZipFile(zip_path, 'r') as zf:
zf.extract(yamon_bin, path=self.workdir)
yamon_path = os.path.join(self.workdir, yamon_bin)
yamon_path = self.scratch_file(yamon_bin)
self.set_machine('malta')
self.vm.set_console()