action #45146
opencoordination #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)
[qe-core][functional] Replace wrappers of wrappers for consoles with proper 'select_console' calls
0%
Description
Motivation¶
See #44843#note-4 . We should use proper consoles from os-autoinst and not write wrappers of wrappers as consoles should provide already enough abstraction.
Acceptance criteria¶
- AC1: Tasks 1 and 2 are done.
Tasks¶
- Handle all remote consoles in the activate_console method: https://github.com/os-autoinst/os-autoinst-distri-opensuse/blob/master/lib/susedistribution.pm#L681
- Refactor the code so that it properly uses select_console('root-console') without wrappers nor if-else conditions.
Updated by mgriessmeier over 5 years ago
- Target version changed from Milestone 23 to Milestone 25
moving to M25
Updated by SLindoMansilla about 5 years ago
- Description updated (diff)
- Status changed from New to Workable
- Priority changed from High to Normal
- Target version changed from Milestone 25 to Milestone 26
As spoken in the grooming meeting
Updated by jorauch about 5 years ago
- Status changed from Workable to In Progress
Task 1 should be done by replacing https://github.com/os-autoinst/os-autoinst-distri-opensuse/blob/master/lib/susedistribution.pm#L681 with || is_remote_backend
So now I need to find all the wrappers
Updated by szarate about 5 years ago
@jorauch just to be 100% clear: You mean current line 685 right? :)
Updated by jorauch about 5 years ago
- Status changed from In Progress to Feedback
Created:
https://github.com/os-autoinst/os-autoinst-distri-opensuse/pull/7951
Waiting for feedback
Updated by SLindoMansilla about 5 years ago
- Status changed from Feedback to Workable
Feedback provided in PR, removing from feedback queue
Updated by jorauch about 5 years ago
- Status changed from Workable to In Progress
Updated by SLindoMansilla about 5 years ago
PR merged, waiting for verification on OSD
Updated by jorauch about 5 years ago
- Related to action #54650: [functional][u] test fails in boot_to_desktop added
Updated by jorauch about 5 years ago
- Status changed from In Progress to Feedback
After the emergency PR has been merged we should be done with this ticket?
Updated by SLindoMansilla about 5 years ago
jorauch wrote:
After the emergency PR has been merged we should be done with this ticket?
After the verification on OSD, yes
Updated by jorauch about 5 years ago
- Status changed from Feedback to Resolved
Nothing broke the last 11 days, I guess that counts as verification
Updated by pvorel about 5 years ago
Could be next step of this to use select_serial_terminal() (instead of select_console 'root-console'), which is wrapper trying to handle everything. It's adjustable with variables (VIRTIO_CONSOLE=0 to disable virtio console; SERIAL_CONSOLE=0 to disable svirt serial console).
Nobody is forced to use virtio console / serial console, but on the other hand it's much faster and we hear complains about lack of resources (osd workers being under heavy load).
Updated by okurz about 5 years ago
pvorel wrote:
Could be next step of this to use select_serial_terminal() (instead of select_console 'root-console')
the idea was actually the opposite, to use select_console 'whatever-console-you-define'
instead of the wrapper. Of course the console "whatever-console-you-define" can exactly be the serial terminal whenever configured. As we can freely create the consoles and activate them within the test code all this should be possible without needing to change any os-autoinst code.
Updated by pvorel about 5 years ago
But simple select_console 'root-console' just ignores the fact that some people want virtio console. Having wrapper which just select "proper console" makes tests more portable and avoid if/else code in tests.
When I created select_serial_terminal() I wanted to have smart way to select console. I also thought that speed of openQA is important thus virtio console should be used as much as it can (i.e. when needles can be avoided, which should IMHO be in consoletests, but tests/console/consoletest_setup.pm does needle matching due testing fonts, it's a question if this must be done in every test).
But that was wrong assumption, as there are probably more tests which needs needles (maybe there could be workaround in needles functions to switch to root-console, do the matching and then switch back).
But now I understand it, that select_console 'root-console' is for all tests matching needles and select_serial_terminal() for kernel and any console tests (which don't work with needles).
Assuming that there is now no need to have any wrapper for needles based testing regardless used backend? (will select_console 'root-console' always work on any backend without any other helper function).
Than the state should be documented, so it's clear.
Updated by okurz about 5 years ago
- Status changed from Resolved to Feedback
I hope you all agree that it makes sense to keep this ticket open when the discussion is not yet resolved? Setting to "Feedback".
@pvorel Sure, I agree with all your points regarding a smart way to select consoles based on needs and preferring the faster serial terminal where possible. I think we are not too far from our goal. Maybe it can be as simple as reworking the function select_serial_terminal()
into an according console selection? Maybe this needs to be moved to os-autoinst and also makes sense to have there for the benefit of multiple test distributions. So that e.g. select_console 'root-serial-terminal'
would do what select_serial_terminal()
does so far? Same for select_console 'user-serial-terminal'
replacing select_user_serial_terminal
?
Updated by pvorel about 5 years ago
okurz wrote:
I hope you all agree that it makes sense to keep this ticket open when the discussion is not yet resolved? Setting to "Feedback".
+1
@pvorel Sure, I agree with all your points regarding a smart way to select consoles based on needs and preferring the faster serial terminal where possible. I think we are not too far from our goal. Maybe it can be as simple as reworking the function
select_serial_terminal()
into an according console selection?
I don't understand how you want to achieve it.
The goal for select_serial_terminal()
was not to have parameters, but set preferences via variables (thus code is simple).
I'd be for keeping select_console()
and select_serial_terminal()
as it is + add select_needles_console()
(need better way), which would be equivalent of select_console 'user-serial-terminal'
(e.g. both ways use wrapper, not just console based testing).
But that might be strange/radical idea.
Maybe this needs to be moved to os-autoinst and also makes sense to have there for the benefit of multiple test distributions.
So that e.g.
select_console 'root-serial-terminal'
would do whatselect_serial_terminal()
does so far? Same forselect_console 'user-serial-terminal'
replacingselect_user_serial_terminal
?
I originally wanted to have it in the library. But it depends on variables which are set only in our testing repository, that's why it's there. IMHO generally there are some parts in our test repo which should be in the library, but are in test repo due the difficulty to make changes in the library. To put it into library, the decision would have to be some general mechanism or at least on variables which aren't specific on our testing repository.
Updated by okurz about 5 years ago
hm, this sounds like we have a conflicting proposal to the os-autoinst design. I suggest you wait for coolo's return and ask for his opinion on the architectural design.
Updated by SLindoMansilla about 5 years ago
- Assignee changed from jorauch to okurz
Assigning to okurz until discussion is resolved.
Feel free to reassign.
Updated by okurz about 5 years ago
- Assignee changed from okurz to pvorel
I feel like pvorel is way more active in the implementation so over to him
Updated by mgriessmeier about 5 years ago
- Target version changed from Milestone 26 to Milestone 27
Updated by mgriessmeier about 5 years ago
- Target version changed from Milestone 27 to Milestone 28
Updated by mgriessmeier over 4 years ago
- Target version changed from Milestone 28 to Milestone 31
any update?
Updated by pvorel over 4 years ago
- Assignee deleted (
pvorel)
Removing myself. I've expressed my opinion in comment 18 and 20. I'm all for further simplification, moving code to functions instead of adding if/else clauses into tests, I just don't see the point how to move code of select_serial_terminal() (wrapper) into select_console().
If anybody implements something I'll be glad to review && test.
Updated by SLindoMansilla over 4 years ago
- Status changed from Feedback to New
- Assignee set to SLindoMansilla
Updated by tjyrinki_suse almost 4 years ago
- Subject changed from [functional][u] Replace wrappers of wrappers for consoles with proper 'select_console' calls to [qe-core][functional] Replace wrappers of wrappers for consoles with proper 'select_console' calls
Updated by SLindoMansilla over 3 years ago
- Assignee deleted (
SLindoMansilla)
No time to work on this :(
Updated by pvorel over 3 years ago
BTW: just a comment: I still think moving back to select_console this would be step back. select_serial_terminal() allows to avoid many if conditions (currently used in 287 tests). It'd be great to have similar functionality in os-autoinst but consoles are based on distros git, thus not possible.
Updated by okurz over 3 years ago
Sure it would be possible to define custom console classes within the test distribution and use that one with select_console
. The source location of the files does not matter as we already include from the lib/
folder of the test distribution
Updated by slo-gin about 2 years ago
This ticket was set to Normal priority but was not updated within the SLO period. Please consider picking up this ticket or just set the ticket to the next lower priority.
Updated by slo-gin 6 months ago
This ticket was set to Normal priority but was not updated within the SLO period. Please consider picking up this ticket or just set the ticket to the next lower priority.