action #45842
closed[all] select_serial_terminal on qemu can fail due to global VIRTIO_CONSOLE=1
0%
Description
Right now VIRTIO_CONSOLE=1 can and is used everywhere because to trigger virtio console you had to use select_virtio_console().
If select_serial_terminal() should replace select_virtio_console() then VIRTIO_CONSOLE=1 should be test specific. [1]
I extended select_serial_terminal() to cover also ipmi [2] and tests started use vitio console due to global VIRTIO_CONSOLE=1 and failed.
What are other solutions ?
[1] https://github.com/os-autoinst/os-autoinst-distri-opensuse/commit/03d181cd507c1c8d4b594984b00549d9df5453ce
[2] https://github.com/os-autoinst/os-autoinst-distri-opensuse/pull/6488
Updated by pvorel almost 6 years ago
VIRTIO_CONSOLE=1
(i.e. 1 => on) is default, but you can set VIRTIO_CONSOLE=0
for a test and that switch off virtio.
Virtio does not work with needles and screenshots.
I guess me or Richie should write some guide how to migrate tests to virtio console (which API functions aren't supported for virtio).
Updated by okurz almost 6 years ago
Well, that's clear that you would not be able to "check screens" on a virtio serial terminal but isn't the issue about "select_serial_terminal" failing? That should work, or not?
Updated by pvorel almost 6 years ago
@okurz What do you mean by select_serial_terminal
is failing?
The only problem is that some tests are using select_serial_terminal
with needles and screenshots, which aren't supported. This is improper usage, but it's probably not that obvious. That's why it IMHO should be documented.
Other option is to print big warning when these unsupported functions are used. WDYT?
@dzedro Isn't the title is misleading? VIRTIO_CONSOLE=1
is default configuration, but it can be switched off for particular test by setting VIRTIO_CONSOLE=0
or even switching to non-virtio console before calling unsupported functions.
Updated by dzedro almost 6 years ago
Title is exactly describing the problem, but change it, because there are multiple problems.
Having VIRTIO_CONSOLE=1 set by default and then setting VIRTIO_CONSOLE=0 is at least questionable approach.
Updated by pvorel almost 6 years ago
select_serial_terminal()
was meant for tests which does not need needles and screenshots.
For functions which needs that and are using just qemu backend might be best approach to keep using original select_console('root-console')
.
It's still useful for tests on different backends, as it detects correct console, that's why it respect VIRTIO_CONSOLE=0
.
Whole idea about default VIRTIO_CONSOLE=1
is that virtio is default on, but tests aren't forced to use it.
Updated by dzedro almost 6 years ago
No assert/check screen is basic speedup of virtio, this issue had nothing to do with it.
VIRTIO_CONSOLE=1 was default and used as global, but you change it to be determined in code,
which can't work with VIRTIO_CONSOLE=1 set globally by default, and adding VIRTIO_CONSOLE=0 to fix it is like scratching your head around.
Updated by pvorel almost 6 years ago
According to the chat with dzero, there can be problems because system_prepare.pm:
https://openqa.opensuse.org/tests/841593#step/system_prepare/1
I see the problem that consoletest is not ready to use virtio console. In spite of the name it depends on asserts: consoletest_setup.pm uses check_console_font
, which uses assert_screen
https://github.com/os-autoinst/os-autoinst-distri-opensuse/blob/master/lib/utils.pm#L339
https://openqa.opensuse.org/tests/841593#step/consoletest_setup/9
There might be more problems.
So either don't use consoletest or fix it to be able to run with virtio as well (don't run check_console_font for virtio; does it need to be run for all tests using consoletest?).
Updated by pvorel almost 6 years ago
- Related to coordination #44843: [qe-core][functional][epic] Cleanup the use of serial-/virtio-/ssh-consoles in our tests (was: use $self->select_serial_terminal instead of checking IPMI in every module) added
Updated by dzedro almost 6 years ago
Main reason of failures was system_prepare
I will try to add VIRTIO_CONSOLE=0 to affected tests
Updated by dzedro almost 6 years ago
This are jobs on osd which failed on test system_prepare, because they were run in virtio_console due to PR I will look for another failures and add VIRTIO_CONSOLE=0 also on ooo
But there are tests which are not always using virtio console, I think there should be still option to use virtio console when needed as it was until now.
2362194
2362201
2362162
2362154
2362225
2362188
2362274
2362416
2362443
2362421
2362438
2362453
2362452
2362432
2362428
2362463
2362464
2362430
2362440
2362446
2362418
2362444
2362486
2362479
2362485
2362478
2362503
2362493
2362496
2362504
2362512
2362483
2362513
2362502
2362506
2362510
2362494
2362488
2362524
2362527
2362526
2362544
2362543
2362534
2362537
2362546
2362547
2362535
2362529
2362557
2362552
2362550
2362561
2362569
2362573
2362575
2362591
2362584
2362583
2362608
2362609
2362606
2362601
2362600
2362576
2362605
2362594
2362572
2362571
Updated by pvorel almost 6 years ago
Uh, what an impressive list :)
dzedro wrote:
But there are tests which are not always using virtio console, I think there should be still option to use virtio console when needed as it was until now.
So, how about keep select_console('root-console')
where it is needed (using assets?). Then you can use virtio, where it's possible.
IMHO it's ok to combine virtio and normal console.
Updated by dzedro almost 6 years ago
Why we need select_serial_terminal, wrapper for simple select_console 'root-virtio-terminal or virtio-terminal' or whatever console
?
Maybe I'm missing something, but any test can use console which he likes, if e.g. LTP is always better and faster with virtio then use select_console 'root-virtio-terminal' and we don't need to force use VIRTIO_CONSOLE=0 and create wrappers for select_console.
Good example is mau-extratests, basically every test is starting with select_console 'some-console';
if the tests want to use virtio console then select_console 'root-virtio-terminal'
can be used.
Updated by dzedro almost 6 years ago
I see, select_serial_terminal
is useful for test running on multiple backends, but then main goal of select_serial_terminal
should be to select virtio console and on backend which does not support it, use fallback root-console. Right now is select_serial_terminal
just some wrapper which is selecting virtio or root console based on value of VIRTIO_CONSOLE
, which is IMHO wrong.
Updated by pvorel almost 6 years ago
dzedro wrote:
I see,
select_serial_terminal
is useful for test running on multiple backends, but then main goal ofselect_serial_terminal
should be to select virtio console and on backend which does not support it, use fallback root-console. Right now isselect_serial_terminal
just some wrapper which is selecting virtio or root console based on value ofVIRTIO_CONSOLE
, which is IMHO wrong.
Virtio console is the only serial console implementation atm, but there is ongoing development to have serial console on svirt, see:
https://progress.opensuse.org/issues/36457
https://github.com/os-autoinst/os-autoinst/pull/1048
it's just haven been finished, I'm going to add PR that adds and uses sut-serial
console.
Previous name for select_serial_terminal()
was select_virtio_console()
, with the same functionality (i.e. handling more backends than qemu) and that was confusing name.
Updated by dzedro almost 6 years ago
I understand virtio is the only working console and desired state is to have serial console on all backends.
select_serial_terminal() it's just rename for all backends, but before [1] was goal to select virtio/serial console and now [2] it's choosing between serial or root/user console which does not look like primary purpose of select_serial_terminal or what was select_virtio_console() before.
[1] https://github.com/os-autoinst/os-autoinst-distri-opensuse/commit/13018da1b065f9f0c76ba6c05ccfd3fe18e102ff#diff-202b6b62531ad5ac248280ffc8c75598
[2] https://github.com/os-autoinst/os-autoinst-distri-opensuse/blob/master/lib/opensusebasetest.pm#L618
Updated by pvorel almost 6 years ago
Well, it evolved. Originally it was just 'root-console' vs. 'root-virtio-terminal'. But then, I added support for S390_ZKVM
and that was a start for supporting more backends. In [1], there was also ipmi
backend supported, so it was wrong name for function anyway.
I think it'd be good to agree on single solution, but if you need some other functionality similar to what was before, feel free to create PR and ping me on it.
Updated by okurz over 3 years ago
- Priority changed from Normal to Low
This ticket was set to "Normal" priority but was not updated within 730 days which is 2 times the period of the SLO for "Normal" tickets (365 days) as described on https://progress.opensuse.org/projects/openqatests/wiki/Wiki#SLOs-service-level-objectives . The ticket will be set to the next lower priority of "Low".