tests/acceptance: Let the framework handle "cpu:VALUE" tagged tests

The tests that are already tagged with "cpu:VALUE" don't need to add
"-cpu VALUE" to the list of arguments of the vm object because the avocado_qemu
framework is able to handle it automatically.

Reviewed-by: Cleber Rosa <crosa@redhat.com>
Tested-by: Cleber Rosa <crosa@redhat.com>
Reviewed-by: Willian Rampazzo <willianr@redhat.com>
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
Message-Id: <20210430133414.39905-4-wainersm@redhat.com>
Signed-off-by: Cleber Rosa <crosa@redhat.com>
This commit is contained in:
Wainer dos Santos Moschetta 2021-04-30 10:34:10 -03:00 committed by Cleber Rosa
parent 8a7c1fdecb
commit d377ba4852
6 changed files with 8 additions and 16 deletions

View File

@ -79,7 +79,6 @@ class BootLinuxAarch64(LinuxTest):
""" """
self.require_accelerator("tcg") self.require_accelerator("tcg")
self.vm.add_args("-accel", "tcg") self.vm.add_args("-accel", "tcg")
self.vm.add_args("-cpu", "max")
self.vm.add_args("-machine", "virt,gic-version=2") self.vm.add_args("-machine", "virt,gic-version=2")
self.add_common_args() self.add_common_args()
self.launch_and_wait(set_up_ssh_connection=False) self.launch_and_wait(set_up_ssh_connection=False)
@ -92,7 +91,6 @@ class BootLinuxAarch64(LinuxTest):
""" """
self.require_accelerator("tcg") self.require_accelerator("tcg")
self.vm.add_args("-accel", "tcg") self.vm.add_args("-accel", "tcg")
self.vm.add_args("-cpu", "max")
self.vm.add_args("-machine", "virt,gic-version=3") self.vm.add_args("-machine", "virt,gic-version=3")
self.add_common_args() self.add_common_args()
self.launch_and_wait(set_up_ssh_connection=False) self.launch_and_wait(set_up_ssh_connection=False)
@ -104,7 +102,6 @@ class BootLinuxAarch64(LinuxTest):
""" """
self.require_accelerator("kvm") self.require_accelerator("kvm")
self.vm.add_args("-accel", "kvm") self.vm.add_args("-accel", "kvm")
self.vm.add_args("-cpu", "host")
self.vm.add_args("-machine", "virt,gic-version=host") self.vm.add_args("-machine", "virt,gic-version=host")
self.add_common_args() self.add_common_args()
self.launch_and_wait(set_up_ssh_connection=False) self.launch_and_wait(set_up_ssh_connection=False)

View File

@ -48,7 +48,6 @@ class BootXenBase(LinuxKernelTest):
xen_command_line = self.XEN_COMMON_COMMAND_LINE xen_command_line = self.XEN_COMMON_COMMAND_LINE
self.vm.add_args('-machine', 'virtualization=on', self.vm.add_args('-machine', 'virtualization=on',
'-cpu', 'cortex-a57',
'-m', '768', '-m', '768',
'-kernel', xen_path, '-kernel', xen_path,
'-append', xen_command_line, '-append', xen_command_line,

View File

@ -62,7 +62,6 @@ class MaltaMachineFramebuffer(Test):
kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
'clocksource=GIC console=tty0 console=ttyS0') 'clocksource=GIC console=tty0 console=ttyS0')
self.vm.add_args('-kernel', kernel_path, self.vm.add_args('-kernel', kernel_path,
'-cpu', 'I6400',
'-smp', '%u' % cpu_cores_count, '-smp', '%u' % cpu_cores_count,
'-vga', 'std', '-vga', 'std',
'-append', kernel_command_line) '-append', kernel_command_line)

View File

@ -156,8 +156,7 @@ class ReplayKernelNormal(ReplayKernelBase):
'console=ttyAMA0') 'console=ttyAMA0')
console_pattern = 'VFS: Cannot open root device' console_pattern = 'VFS: Cannot open root device'
self.run_rr(kernel_path, kernel_command_line, console_pattern, self.run_rr(kernel_path, kernel_command_line, console_pattern)
args=('-cpu', 'cortex-a53'))
def test_arm_virt(self): def test_arm_virt(self):
""" """
@ -301,7 +300,7 @@ class ReplayKernelNormal(ReplayKernelBase):
tar_url = ('https://www.qemu-advent-calendar.org' tar_url = ('https://www.qemu-advent-calendar.org'
'/2018/download/day19.tar.xz') '/2018/download/day19.tar.xz')
file_path = self.fetch_asset(tar_url, asset_hash=tar_hash) file_path = self.fetch_asset(tar_url, asset_hash=tar_hash)
self.do_test_advcal_2018(file_path, 'uImage', ('-cpu', 'e5500')) self.do_test_advcal_2018(file_path, 'uImage')
def test_ppc_g3beige(self): def test_ppc_g3beige(self):
""" """
@ -348,8 +347,7 @@ class ReplayKernelNormal(ReplayKernelBase):
tar_url = ('https://www.qemu-advent-calendar.org' tar_url = ('https://www.qemu-advent-calendar.org'
'/2018/download/day02.tar.xz') '/2018/download/day02.tar.xz')
file_path = self.fetch_asset(tar_url, asset_hash=tar_hash) file_path = self.fetch_asset(tar_url, asset_hash=tar_hash)
self.do_test_advcal_2018(file_path, 'santas-sleigh-ride.elf', self.do_test_advcal_2018(file_path, 'santas-sleigh-ride.elf')
args=('-cpu', 'dc233c'))
@skipUnless(os.getenv('AVOCADO_TIMEOUT_EXPECTED'), 'Test might timeout') @skipUnless(os.getenv('AVOCADO_TIMEOUT_EXPECTED'), 'Test might timeout')
class ReplayKernelSlow(ReplayKernelBase): class ReplayKernelSlow(ReplayKernelBase):

View File

@ -207,4 +207,4 @@ class ReverseDebugging_AArch64(ReverseDebugging):
kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash) kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
self.reverse_debugging( self.reverse_debugging(
args=('-kernel', kernel_path, '-cpu', 'cortex-a53')) args=('-kernel', kernel_path))

View File

@ -25,7 +25,7 @@ class PluginKernelBase(LinuxKernelTest):
KERNEL_COMMON_COMMAND_LINE = 'printk.time=1 panic=-1 ' KERNEL_COMMON_COMMAND_LINE = 'printk.time=1 panic=-1 '
def run_vm(self, kernel_path, kernel_command_line, def run_vm(self, kernel_path, kernel_command_line,
plugin, plugin_log, console_pattern, args): plugin, plugin_log, console_pattern, args=None):
vm = self.get_vm() vm = self.get_vm()
vm.set_console() vm.set_console()
@ -80,8 +80,7 @@ class PluginKernelNormal(PluginKernelBase):
self.run_vm(kernel_path, kernel_command_line, self.run_vm(kernel_path, kernel_command_line,
"tests/plugin/libinsn.so", plugin_log.name, "tests/plugin/libinsn.so", plugin_log.name,
console_pattern, console_pattern)
args=('-cpu', 'cortex-a53'))
with plugin_log as lf, \ with plugin_log as lf, \
mmap.mmap(lf.fileno(), 0, access=mmap.ACCESS_READ) as s: mmap.mmap(lf.fileno(), 0, access=mmap.ACCESS_READ) as s:
@ -108,7 +107,7 @@ class PluginKernelNormal(PluginKernelBase):
self.run_vm(kernel_path, kernel_command_line, self.run_vm(kernel_path, kernel_command_line,
"tests/plugin/libinsn.so", plugin_log.name, "tests/plugin/libinsn.so", plugin_log.name,
console_pattern, console_pattern,
args=('-cpu', 'cortex-a53', '-icount', 'shift=1')) args=('-icount', 'shift=1'))
with plugin_log as lf, \ with plugin_log as lf, \
mmap.mmap(lf.fileno(), 0, access=mmap.ACCESS_READ) as s: mmap.mmap(lf.fileno(), 0, access=mmap.ACCESS_READ) as s:
@ -134,7 +133,7 @@ class PluginKernelNormal(PluginKernelBase):
self.run_vm(kernel_path, kernel_command_line, self.run_vm(kernel_path, kernel_command_line,
"tests/plugin/libmem.so,arg=both", plugin_log.name, "tests/plugin/libmem.so,arg=both", plugin_log.name,
console_pattern, console_pattern,
args=('-cpu', 'cortex-a53', '-icount', 'shift=1')) args=('-icount', 'shift=1'))
with plugin_log as lf, \ with plugin_log as lf, \
mmap.mmap(lf.fileno(), 0, access=mmap.ACCESS_READ) as s: mmap.mmap(lf.fileno(), 0, access=mmap.ACCESS_READ) as s: