On Wed, Nov 16, 2022 at 6:02 PM Ani Sinha <a...@anisinha.ca> wrote: > > On Wed, Nov 16, 2022 at 3:07 PM Alex Bennée <alex.ben...@linaro.org> wrote: > > > > > > Ani Sinha <a...@anisinha.ca> writes: > > > > > On Wed, Nov 16, 2022 at 4:17 AM Alex Bennée <alex.ben...@linaro.org> > > > wrote: > > >> > > >> > > >> John Snow <js...@redhat.com> writes: > > >> > > >> > Instead of using a hardcoded timeout, just rely on Avocado's built-in > > >> > test case timeout. This helps avoid timeout issues on machines where 60 > > >> > seconds is not sufficient. > > >> > > > >> > Signed-off-by: John Snow <js...@redhat.com> > > >> > --- > > >> > tests/avocado/acpi-bits.py | 10 ++-------- > > >> > 1 file changed, 2 insertions(+), 8 deletions(-) > > >> > > > >> > diff --git a/tests/avocado/acpi-bits.py b/tests/avocado/acpi-bits.py > > >> > index 8745a58a766..ac13e22dc93 100644 > > >> > --- a/tests/avocado/acpi-bits.py > > >> > +++ b/tests/avocado/acpi-bits.py > > >> > @@ -385,12 +385,6 @@ def test_acpi_smbios_bits(self): > > >> > self._vm.launch() > > >> > # biosbits has been configured to run all the specified test > > >> > suites > > >> > # in batch mode and then automatically initiate a vm shutdown. > > >> > - # sleep for maximum of one minute > > >> > - max_sleep_time = time.monotonic() + 60 > > >> > - while self._vm.is_running() and time.monotonic() < > > >> > max_sleep_time: > > >> > - time.sleep(1) > > >> > - > > >> > - self.assertFalse(time.monotonic() > max_sleep_time, > > >> > - 'The VM seems to have failed to shutdown in > > >> > time') > > >> > - > > >> > > >> We might want some wait for consoles as well depending on what is output > > >> during the run. > > > > > > actually I think you won't get anything on the console since grub is > > > not configured to use the serial console. I tried "-serial stdio" a > > > while back without any output. > > > > Grub is certainly capable of serial output but I think the grub.cfg > > needs changes to support that. It would definitely be an improvement if > > we could enable serial output because currently the test is totally mute > > while running which is unlike every other test in avocado. > > sounds reasonable. bits seems to have its own way to set up grub > serial port redirect and I tried something quickly but it didn't quite > work. Need to spend more time looking at it.
just when I wrote this, it seems my hack finally worked! Will need more testing before pushing. commit 58513f19ac7b537da0769a732ff0d93d6d93d3b0 (HEAD -> qemu-bits) Author: Ani Sinha <a...@anisinha.ca> Date: Wed Nov 16 17:37:51 2022 +0530 serial port redirection test Signed-off-by: Ani Sinha <a...@anisinha.ca> diff --git a/python/init.py b/python/init.py index 8fde344..1e36d51 100644 --- a/python/init.py +++ b/python/init.py @@ -85,7 +85,7 @@ def early_init(): except Exception as e: print "Error parsing Serial Port Console Redirect (SPCR) table:" print e - + serial_cmd = "serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1" with import_annotation("os"): import os with init_annotation("os"):