fix use of console in anaconda
AbandonedPublic

Authored by adamwill on Jul 21 2015, 3:53 AM.

Details

Summary

This got broken by RHBZ #1222413. Fix that, and while we're at
it, make a method for getting a console in anaconda and re-use
it in a couple of other places.

I first tried to make a sort of all-singing, all-dancing tower
of methods for switching to a console and logging in that took
parameters for tty and user and password and handled both
anaconda and installed system cases, but it rapidly got messy
and unwieldy, so let's keep it simple.

This fiddles with the various needles for 'are we at a root
console?' just enough to make the tests work again, I'm planning
a follow-up commit to remove the duplication (I think just one
sufficiently careful needle should cover all cases).

Test Plan

Run a test suite; a couple more tests (which change software
source and then check it at the console) ought to pass. Also
make sure other root console cases (failure reporting)
continue to work (ideally both live and non-live).

Diff Detail

Repository
rOPENQATESTS os-autoinst-distri-fedora
Branch
console
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 20
Build 20: arc lint + arc unit
adamwill retitled this revision from to fix use of console in anaconda.Jul 21 2015, 3:53 AM
adamwill updated this object.
adamwill edited the test plan for this revision. (Show Details)
adamwill added reviewers: jskladan, garretraziel.

Other than the comment, LGTM.

lib/anacondalog.pm
42

I have made similar (but not the same) functionality for installed system here https://bitbucket.org/rajcze/openqa_fedora/src/2e4c1c2325357068e8f2cb79bd545fa969727599/lib/fedoralog.pm?at=develop#fedoralog.pm-6. I wonder if we could (and should) merge all this functionality into one big parent class someday.

garretraziel accepted this revision.Jul 21 2015, 12:43 PM
This revision is now accepted and ready to land.Jul 21 2015, 12:43 PM
adamwill added inline comments.Jul 21 2015, 3:13 PM
lib/anacondalog.pm
42

Like I said, I started out trying to write something clever that would replace that too but it rapidly got messy - it had a method for switching to a specified VT which returned 1 if it found a login prompt and 2 if it found a logged-in screen, a method for trying several VTs until one worked, a big ugly method with parameters for username, password, tty and 'check' with lots of conditionals...it was just kind of a mess. So I thought let's go the other route and just keep it simple.

If we're being organized we might want to come up with a standard approach to extended 'test API' stuff like this and make sure both base classes (anacondalog and fedoralog) follow them (and maybe rename anacondalog and fedoralog - they're effectively our base classes for during-install tests and outside-install tests respectively, but the names don't help much), but I think those two base classes existing does mostly make sense. Perhaps we could add one more level and have them inherit from a shared parent class where we could put things outside the basetest API that all Fedora tests would share...

I've submitted a kinda alternative, more extensive version as D462, which I prefer. Leaving this open for now just in case anyone hates D462, but I think it's better.

adamwill abandoned this revision.Jul 22 2015, 6:38 PM

We went with D462 instead.