* [PATCH 1/2] acpi/tests/avocado/bits: enforce 32-bit SMBIOS entry point
2023-10-27 3:21 [PATCH 0/2] Some biosbits avocado test fixes Ani Sinha
@ 2023-10-27 3:21 ` Ani Sinha
2023-10-27 3:21 ` [PATCH 2/2] acpi/tests/avocado/bits: enable console logging from bits VM Ani Sinha
2023-11-07 7:55 ` [PATCH 0/2] Some biosbits avocado test fixes Ani Sinha
2 siblings, 0 replies; 4+ messages in thread
From: Ani Sinha @ 2023-10-27 3:21 UTC (permalink / raw)
To: Ani Sinha, Michael S. Tsirkin, Cleber Rosa,
Philippe Mathieu-Daudé, Wainer dos Santos Moschetta,
Beraldo Leal
Cc: jusual, imammedo, qemu-devel
QEMU defaults to 64-bit entry point since the following commit
bf376f3020 ("hw/i386/pc: Default to use SMBIOS 3.0 for newer machine models")
The above change is applicable for all newer machine versions from version 8.1
and newer. i440fx and q35 machine versions 8.0 and older still use 32-bit entry
points.
Unfortunately, bits currently does not recognize 64-bit entry points and hence
is not able to parse SMBIOS tables. Therefore, we need to enforce 32-bit
SMBIOS entry point in QEMU command line so that bits is able to parse the
SMBIOS tables.
Once we implement the support in bits to parse 64-bit entry points, we can
remove the extra command line that is passed to enforce a 32-bit entry point.
The support can be added to the following smbios test script:
tests/avocado/acpi-bits/bits-tests/smbios.py2 in QEMU repository.
CC: jusual@redhat.com
CC: imammedo@redhat.com
Signed-off-by: Ani Sinha <anisinha@redhat.com>
---
tests/avocado/acpi-bits.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/tests/avocado/acpi-bits.py b/tests/avocado/acpi-bits.py
index eca13dc518..042007b0b8 100644
--- a/tests/avocado/acpi-bits.py
+++ b/tests/avocado/acpi-bits.py
@@ -380,6 +380,11 @@ def test_acpi_smbios_bits(self):
# consistent in terms of timing. smilatency tests have consistent
# timing requirements.
self._vm.add_args('-icount', 'auto')
+ # currently there is no support in bits for recognizing 64-bit SMBIOS
+ # entry points. QEMU defaults to 64-bit entry points since the
+ # upstream commit bf376f3020 ("hw/i386/pc: Default to use SMBIOS 3.0
+ # for newer machine models"). Therefore, enforce 32-bit entry point.
+ self._vm.add_args('-machine', 'smbios-entry-point-type=32')
args = " ".join(str(arg) for arg in self._vm.base_args()) + \
" " + " ".join(str(arg) for arg in self._vm.args)
--
2.42.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] acpi/tests/avocado/bits: enable console logging from bits VM
2023-10-27 3:21 [PATCH 0/2] Some biosbits avocado test fixes Ani Sinha
2023-10-27 3:21 ` [PATCH 1/2] acpi/tests/avocado/bits: enforce 32-bit SMBIOS entry point Ani Sinha
@ 2023-10-27 3:21 ` Ani Sinha
2023-11-07 7:55 ` [PATCH 0/2] Some biosbits avocado test fixes Ani Sinha
2 siblings, 0 replies; 4+ messages in thread
From: Ani Sinha @ 2023-10-27 3:21 UTC (permalink / raw)
To: Ani Sinha, Michael S. Tsirkin, Cleber Rosa,
Philippe Mathieu-Daudé, Wainer dos Santos Moschetta,
Beraldo Leal
Cc: jsnow, qemu-devel
Console logs from the VM can be useful for debugging when things go wrong.
Other avocado tests enables them. This change enables console logging with the
following changes:
- point to the newer bios bits image that actually enabled VM console.
- change the bits test to drain the console logs from the VM and write the
logs.
- wait for SHUTDOWN event from QEMU so that console logs can be drained out
of the socket before it is closed as a part of vm.wait().
Additionally, following two cosmetic changes have been made:
- Removed VM QEMU command line logging as avocado framework already logs it.
This is a minor cleanup along the way.
- Update my email to my work email in the avocado acpi bios bits test.
CC: jsnow@redhat.com
Signed-off-by: Ani Sinha <anisinha@redhat.com>
---
tests/avocado/acpi-bits.py | 26 ++++++++++++++++----------
1 file changed, 16 insertions(+), 10 deletions(-)
diff --git a/tests/avocado/acpi-bits.py b/tests/avocado/acpi-bits.py
index 042007b0b8..68b9e98d4e 100644
--- a/tests/avocado/acpi-bits.py
+++ b/tests/avocado/acpi-bits.py
@@ -18,7 +18,7 @@
#
#
# Author:
-# Ani Sinha <ani@anisinha.ca>
+# Ani Sinha <anisinha@redhat.com>
# pylint: disable=invalid-name
# pylint: disable=consider-using-f-string
@@ -48,6 +48,7 @@
)
from qemu.machine import QEMUMachine
from avocado import skipIf
+from avocado.utils import datadrainer as drainer
from avocado_qemu import QemuBaseTest
deps = ["xorriso", "mformat"] # dependent tools needed in the test setup/box.
@@ -141,12 +142,12 @@ def __init__(self, *args, **kwargs):
self._baseDir = None
# following are some standard configuration constants
- self._bitsInternalVer = 2020
- self._bitsCommitHash = 'b48b88ff' # commit hash must match
+ self._bitsInternalVer = 2020 # gitlab CI does shallow clones of depth 20
+ self._bitsCommitHash = 'c7920d2b' # commit hash must match
# the artifact tag below
- self._bitsTag = "qemu-bits-10182022" # this is the latest bits
+ self._bitsTag = "qemu-bits-10262023" # this is the latest bits
# release as of today.
- self._bitsArtSHA1Hash = 'b04790ac9b99b5662d0416392c73b97580641fe5'
+ self._bitsArtSHA1Hash = 'b22cdfcfc7453875297d06d626f5474ee36a343f'
self._bitsArtURL = ("https://gitlab.com/qemu-project/"
"biosbits-bits/-/jobs/artifacts/%s/"
"download?job=qemu-bits-build" %self._bitsTag)
@@ -386,15 +387,20 @@ def test_acpi_smbios_bits(self):
# for newer machine models"). Therefore, enforce 32-bit entry point.
self._vm.add_args('-machine', 'smbios-entry-point-type=32')
- args = " ".join(str(arg) for arg in self._vm.base_args()) + \
- " " + " ".join(str(arg) for arg in self._vm.args)
+ # enable console logging
+ self._vm.set_console()
+ self._vm.launch()
- self.logger.info("launching QEMU vm with the following arguments: %s",
- args)
+ self.logger.debug("Console output from bits VM follows ...")
+ c_drainer = drainer.LineLogger(self._vm.console_socket.fileno(),
+ logger=self.logger.getChild("console"),
+ stop_check=(lambda :
+ not self._vm.is_running()))
+ c_drainer.start()
- self._vm.launch()
# biosbits has been configured to run all the specified test suites
# in batch mode and then automatically initiate a vm shutdown.
# Rely on avocado's unit test timeout.
+ self._vm.event_wait('SHUTDOWN')
self._vm.wait(timeout=None)
self.parse_log()
--
2.42.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 0/2] Some biosbits avocado test fixes
2023-10-27 3:21 [PATCH 0/2] Some biosbits avocado test fixes Ani Sinha
2023-10-27 3:21 ` [PATCH 1/2] acpi/tests/avocado/bits: enforce 32-bit SMBIOS entry point Ani Sinha
2023-10-27 3:21 ` [PATCH 2/2] acpi/tests/avocado/bits: enable console logging from bits VM Ani Sinha
@ 2023-11-07 7:55 ` Ani Sinha
2 siblings, 0 replies; 4+ messages in thread
From: Ani Sinha @ 2023-11-07 7:55 UTC (permalink / raw)
Cc: John Snow, Julia Suvorova, Igor Mammedov, mst, qemu-devel, crosa,
philmd, Wainer dos Santos Moschetta, Beraldo Leal
> On 27-Oct-2023, at 8:51 AM, Ani Sinha <anisinha@redhat.com> wrote:
>
> Included are couple of bios bits test fixes.
> 32-bit SMBIOS entry point is enforced.
> Console logging is enabled.
>
> I have tested these changes in the CI pipeline here and the test seems
> to pass:
>
> https://gitlab.com/anisinha/qemu/-/jobs/5380627517
MST, are you going to queue this?
> Log:
>
> https://cdn.artifacts.gitlab-static.net/8a/b0/8ab0aa629e9c43a80356e27a440985f41da9ad10b120a410d9f070bed092fea6/2023_10_26/5380627517/5862985776/job.log?response-content-type=text%2Fplain%3B%20charset%3Dutf-8&response-content-disposition=inline&Expires=1698376660&KeyName=gprd-artifacts-cdn&Signature=ln7fYsTb8t6ch0Trsa7SHAN01QY=
>
> CC: jsnow@redhat.com
> CC: jusual@redhat.com
> CC: imammedo@redhat.com
> CC: mst@redhat.com
> CC: qemu-devel@nongnu.org
> CC: crosa@redhat.com
> CC: philmd@linaro.org
> CC: Wainer dos Santos Moschetta <wainersm@redhat.com>
> CC: Beraldo Leal <bleal@redhat.com>
>
> Ani Sinha (2):
> acpi/tests/avocado/bits: enforce 32-bit SMBIOS entry point
> acpi/tests/avocado/bits: enable console logging from bits VM
>
> tests/avocado/acpi-bits.py | 33 ++++++++++++++++++++++-----------
> 1 file changed, 22 insertions(+), 11 deletions(-)
>
> --
> 2.42.0
>
^ permalink raw reply [flat|nested] 4+ messages in thread