mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 07:13:54 -06:00
Acceptance tests: use avocado tags for machine type
The same way the arch tag is being used as a fallback for the arch parameter, let's do the same for QEMU's machine and avoid some boiler plate code. This is now possible because, since Avocado 72.0, it's possible to use tags with names that match the machine types on QEMU. Signed-off-by: Cleber Rosa <crosa@redhat.com> Message-Id: <20191104151323.9883-4-crosa@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
This commit is contained in:
parent
f108934fca
commit
ba21bde930
10 changed files with 72 additions and 59 deletions
|
@ -62,7 +62,6 @@ class BootLinuxConsole(Test):
|
|||
kernel_hash = '23bebd2680757891cf7adedb033532163a792495'
|
||||
kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
|
||||
|
||||
self.vm.set_machine('pc')
|
||||
self.vm.set_console()
|
||||
kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=ttyS0'
|
||||
self.vm.add_args('-kernel', kernel_path,
|
||||
|
@ -85,7 +84,6 @@ class BootLinuxConsole(Test):
|
|||
kernel_path = self.extract_from_deb(deb_path,
|
||||
'/boot/vmlinux-2.6.32-5-4kc-malta')
|
||||
|
||||
self.vm.set_machine('malta')
|
||||
self.vm.set_console()
|
||||
kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=ttyS0'
|
||||
self.vm.add_args('-kernel', kernel_path,
|
||||
|
@ -118,7 +116,6 @@ class BootLinuxConsole(Test):
|
|||
kernel_path = self.extract_from_deb(deb_path,
|
||||
'/boot/vmlinux-2.6.32-5-5kc-malta')
|
||||
|
||||
self.vm.set_machine('malta')
|
||||
self.vm.set_console()
|
||||
kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=ttyS0'
|
||||
self.vm.add_args('-kernel', kernel_path,
|
||||
|
@ -148,7 +145,6 @@ class BootLinuxConsole(Test):
|
|||
initrd_path = self.workdir + "rootfs.cpio"
|
||||
archive.gzip_uncompress(initrd_path_gz, initrd_path)
|
||||
|
||||
self.vm.set_machine('malta')
|
||||
self.vm.set_console()
|
||||
kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE
|
||||
+ 'console=ttyS0 console=tty '
|
||||
|
@ -188,7 +184,6 @@ class BootLinuxConsole(Test):
|
|||
initrd_path = self.workdir + "rootfs.cpio"
|
||||
archive.gzip_uncompress(initrd_path_gz, initrd_path)
|
||||
|
||||
self.vm.set_machine('malta')
|
||||
self.vm.set_console()
|
||||
kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE
|
||||
+ 'console=ttyS0 console=tty '
|
||||
|
@ -215,7 +210,6 @@ class BootLinuxConsole(Test):
|
|||
with open(kernel_path, 'wb') as f_out:
|
||||
shutil.copyfileobj(f_in, f_out)
|
||||
|
||||
self.vm.set_machine('malta')
|
||||
self.vm.set_console()
|
||||
kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE
|
||||
+ 'mem=256m@@0x0 '
|
||||
|
@ -275,7 +269,6 @@ class BootLinuxConsole(Test):
|
|||
kernel_hash = '8c73e469fc6ea06a58dc83a628fc695b693b8493'
|
||||
kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
|
||||
|
||||
self.vm.set_machine('virt')
|
||||
self.vm.set_console()
|
||||
kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
|
||||
'console=ttyAMA0')
|
||||
|
@ -297,7 +290,6 @@ class BootLinuxConsole(Test):
|
|||
kernel_hash = 'e9826d741b4fb04cadba8d4824d1ed3b7fb8b4d4'
|
||||
kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
|
||||
|
||||
self.vm.set_machine('virt')
|
||||
self.vm.set_console()
|
||||
kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
|
||||
'console=ttyAMA0')
|
||||
|
@ -310,7 +302,7 @@ class BootLinuxConsole(Test):
|
|||
def test_arm_emcraft_sf2(self):
|
||||
"""
|
||||
:avocado: tags=arch:arm
|
||||
:avocado: tags=machine:emcraft_sf2
|
||||
:avocado: tags=machine:emcraft-sf2
|
||||
:avocado: tags=endian:little
|
||||
"""
|
||||
uboot_url = ('https://raw.githubusercontent.com/'
|
||||
|
@ -324,7 +316,6 @@ class BootLinuxConsole(Test):
|
|||
spi_hash = '85f698329d38de63aea6e884a86fbde70890a78a'
|
||||
spi_path = self.fetch_asset(spi_url, asset_hash=spi_hash)
|
||||
|
||||
self.vm.set_machine('emcraft-sf2')
|
||||
self.vm.set_console()
|
||||
kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE
|
||||
self.vm.add_args('-kernel', uboot_path,
|
||||
|
@ -351,7 +342,6 @@ class BootLinuxConsole(Test):
|
|||
kernel_path = self.extract_from_deb(deb_path, '/boot/kernel7.img')
|
||||
dtb_path = self.extract_from_deb(deb_path, '/boot/bcm2709-rpi-2-b.dtb')
|
||||
|
||||
self.vm.set_machine('raspi2')
|
||||
self.vm.set_console()
|
||||
kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
|
||||
serial_kernel_cmdline[uart_id])
|
||||
|
@ -393,7 +383,6 @@ class BootLinuxConsole(Test):
|
|||
initrd_path = os.path.join(self.workdir, 'rootfs.cpio')
|
||||
archive.gzip_uncompress(initrd_path_gz, initrd_path)
|
||||
|
||||
self.vm.set_machine('smdkc210')
|
||||
self.vm.set_console()
|
||||
kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
|
||||
'earlycon=exynos4210,0x13800000 earlyprintk ' +
|
||||
|
@ -414,7 +403,7 @@ class BootLinuxConsole(Test):
|
|||
def test_s390x_s390_ccw_virtio(self):
|
||||
"""
|
||||
:avocado: tags=arch:s390x
|
||||
:avocado: tags=machine:s390_ccw_virtio
|
||||
:avocado: tags=machine:s390-ccw-virtio
|
||||
"""
|
||||
kernel_url = ('https://archives.fedoraproject.org/pub/archive'
|
||||
'/fedora-secondary/releases/29/Everything/s390x/os/images'
|
||||
|
@ -422,7 +411,6 @@ class BootLinuxConsole(Test):
|
|||
kernel_hash = 'e8e8439103ef8053418ef062644ffd46a7919313'
|
||||
kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
|
||||
|
||||
self.vm.set_machine('s390-ccw-virtio')
|
||||
self.vm.set_console()
|
||||
kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=sclp0'
|
||||
self.vm.add_args('-nodefaults',
|
||||
|
@ -444,7 +432,6 @@ class BootLinuxConsole(Test):
|
|||
|
||||
uncompressed_kernel = archive.uncompress(kernel_path, self.workdir)
|
||||
|
||||
self.vm.set_machine('clipper')
|
||||
self.vm.set_console()
|
||||
kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=ttyS0'
|
||||
self.vm.add_args('-vga', 'std',
|
||||
|
@ -465,7 +452,6 @@ class BootLinuxConsole(Test):
|
|||
kernel_hash = '3fe04abfc852b66653b8c3c897a59a689270bc77'
|
||||
kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
|
||||
|
||||
self.vm.set_machine('pseries')
|
||||
self.vm.set_console()
|
||||
kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=hvc0'
|
||||
self.vm.add_args('-kernel', kernel_path,
|
||||
|
@ -487,7 +473,6 @@ class BootLinuxConsole(Test):
|
|||
kernel_path = self.extract_from_deb(deb_path,
|
||||
'/boot/vmlinux-5.3.0-1-m68k')
|
||||
|
||||
self.vm.set_machine('q800')
|
||||
self.vm.set_console()
|
||||
kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
|
||||
'console=ttyS0 vga=off')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue