Project

General

Profile

Actions

action #45146

open

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)

[qe-core][functional] Replace wrappers of wrappers for consoles with proper 'select_console' calls

Added by okurz over 5 years ago. Updated 30 days ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Enhancement to existing tests
Target version:
SUSE QA - Milestone 31
Start date:
2018-12-13
Due date:
% Done:

0%

Estimated time:
Difficulty:

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

  1. Handle all remote consoles in the activate_console method: https://github.com/os-autoinst/os-autoinst-distri-opensuse/blob/master/lib/susedistribution.pm#L681
  2. Refactor the code so that it properly uses select_console('root-console') without wrappers nor if-else conditions.

Related issues 1 (0 open1 closed)

Related to openQA Tests - action #54650: [functional][u] test fails in boot_to_desktopResolvedjorauch2019-07-25

Actions
Actions #1

Updated by mgriessmeier about 5 years ago

  • Target version changed from Milestone 23 to Milestone 25

moving to M25

Actions #2

Updated by szarate almost 5 years ago

  • Priority changed from Normal to High

To be re-refined :)

Actions #3

Updated by SLindoMansilla almost 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

Actions #4

Updated by jorauch almost 5 years ago

  • Assignee set to jorauch
Actions #5

Updated by jorauch almost 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

Actions #6

Updated by szarate almost 5 years ago

@jorauch just to be 100% clear: You mean current line 685 right? :)

Actions #7

Updated by jorauch almost 5 years ago

Indeed, I mean the new Line 685

Actions #8

Updated by jorauch over 4 years ago

  • Status changed from In Progress to Feedback
Actions #9

Updated by SLindoMansilla over 4 years ago

  • Status changed from Feedback to Workable

Feedback provided in PR, removing from feedback queue

Actions #10

Updated by jorauch over 4 years ago

  • Status changed from Workable to In Progress
Actions #11

Updated by SLindoMansilla over 4 years ago

PR merged, waiting for verification on OSD

Actions #12

Updated by jorauch over 4 years ago

  • Related to action #54650: [functional][u] test fails in boot_to_desktop added
Actions #13

Updated by jorauch over 4 years ago

  • Status changed from In Progress to Feedback

After the emergency PR has been merged we should be done with this ticket?

Actions #14

Updated by SLindoMansilla over 4 years ago

jorauch wrote:

After the emergency PR has been merged we should be done with this ticket?

After the verification on OSD, yes

Actions #15

Updated by jorauch over 4 years ago

  • Status changed from Feedback to Resolved

Nothing broke the last 11 days, I guess that counts as verification

Actions #16

Updated by pvorel over 4 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).

Actions #17

Updated by okurz over 4 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.

Actions #18

Updated by pvorel over 4 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.

Actions #19

Updated by okurz over 4 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?

Actions #20

Updated by pvorel over 4 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 what select_serial_terminal() does so far? Same for select_console 'user-serial-terminal' replacing select_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.

Actions #21

Updated by okurz over 4 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.

Actions #22

Updated by SLindoMansilla over 4 years ago

  • Assignee changed from jorauch to okurz

Assigning to okurz until discussion is resolved.
Feel free to reassign.

Actions #23

Updated by okurz over 4 years ago

  • Assignee changed from okurz to pvorel

I feel like pvorel is way more active in the implementation so over to him

Actions #24

Updated by mgriessmeier over 4 years ago

  • Target version changed from Milestone 26 to Milestone 27
Actions #25

Updated by mgriessmeier over 4 years ago

  • Target version changed from Milestone 27 to Milestone 28
Actions #26

Updated by mgriessmeier over 4 years ago

  • Target version changed from Milestone 28 to Milestone 31

any update?

Actions #27

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.

Actions #28

Updated by SLindoMansilla almost 4 years ago

  • Status changed from Feedback to New
  • Assignee set to SLindoMansilla
Actions #29

Updated by tjyrinki_suse over 3 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
Actions #30

Updated by SLindoMansilla about 3 years ago

  • Assignee deleted (SLindoMansilla)

No time to work on this :(

Actions #31

Updated by pvorel about 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.

Actions #32

Updated by okurz about 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

Actions #33

Updated by slo-gin over 1 year 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.

Actions #34

Updated by slo-gin 30 days 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.

Actions

Also available in: Atom PDF