mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-19 08:02:15 -06:00
tests/functional/test_acpi_bits: Turn the test into a QemuSystemTest
By using QemuSystemTest as a base class, we can use the set_machine() command to check whether the required machine is available in the binary (otherwise this test is failing when QEMU has been compiled without the default 'pc' machine type). Message-ID: <20241128115019.591362-1-thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Ani Sinha <anisinha@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
This commit is contained in:
parent
72b88908d1
commit
fe455260b0
1 changed files with 5 additions and 4 deletions
|
@ -50,7 +50,7 @@ from typing import (
|
||||||
)
|
)
|
||||||
from qemu.machine import QEMUMachine
|
from qemu.machine import QEMUMachine
|
||||||
from unittest import skipIf
|
from unittest import skipIf
|
||||||
from qemu_test import QemuBaseTest, Asset
|
from qemu_test import QemuSystemTest, Asset
|
||||||
|
|
||||||
deps = ["xorriso", "mformat"] # dependent tools needed in the test setup/box.
|
deps = ["xorriso", "mformat"] # dependent tools needed in the test setup/box.
|
||||||
supported_platforms = ['x86_64'] # supported test platforms.
|
supported_platforms = ['x86_64'] # supported test platforms.
|
||||||
|
@ -127,7 +127,7 @@ class QEMUBitsMachine(QEMUMachine): # pylint: disable=too-few-public-methods
|
||||||
@skipIf(not supported_platform() or missing_deps(),
|
@skipIf(not supported_platform() or missing_deps(),
|
||||||
'unsupported platform or dependencies (%s) not installed' \
|
'unsupported platform or dependencies (%s) not installed' \
|
||||||
% ','.join(deps))
|
% ','.join(deps))
|
||||||
class AcpiBitsTest(QemuBaseTest): #pylint: disable=too-many-instance-attributes
|
class AcpiBitsTest(QemuSystemTest): #pylint: disable=too-many-instance-attributes
|
||||||
"""
|
"""
|
||||||
ACPI and SMBIOS tests using biosbits.
|
ACPI and SMBIOS tests using biosbits.
|
||||||
"""
|
"""
|
||||||
|
@ -284,7 +284,7 @@ class AcpiBitsTest(QemuBaseTest): #pylint: disable=too-many-instance-attributes
|
||||||
self.logger.info('iso file %s successfully generated.', iso_file)
|
self.logger.info('iso file %s successfully generated.', iso_file)
|
||||||
|
|
||||||
def setUp(self): # pylint: disable=arguments-differ
|
def setUp(self): # pylint: disable=arguments-differ
|
||||||
super().setUp('qemu-system-')
|
super().setUp()
|
||||||
self.logger = self.log
|
self.logger = self.log
|
||||||
|
|
||||||
self._baseDir = Path(__file__).parent
|
self._baseDir = Path(__file__).parent
|
||||||
|
@ -354,6 +354,7 @@ class AcpiBitsTest(QemuBaseTest): #pylint: disable=too-many-instance-attributes
|
||||||
def test_acpi_smbios_bits(self):
|
def test_acpi_smbios_bits(self):
|
||||||
"""The main test case implementation."""
|
"""The main test case implementation."""
|
||||||
|
|
||||||
|
self.set_machine('pc')
|
||||||
iso_file = os.path.join(self.workdir,
|
iso_file = os.path.join(self.workdir,
|
||||||
'bits-%d.iso' %self.BITS_INTERNAL_VER)
|
'bits-%d.iso' %self.BITS_INTERNAL_VER)
|
||||||
|
|
||||||
|
@ -388,4 +389,4 @@ class AcpiBitsTest(QemuBaseTest): #pylint: disable=too-many-instance-attributes
|
||||||
self.parse_log()
|
self.parse_log()
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
QemuBaseTest.main()
|
QemuSystemTest.main()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue