Commit 5bb887c9 authored by Harald Sitter's avatar Harald Sitter

unify live session reboots and force reset the system if necessary

ISO still get stuck on reboot sometimes. I've tried for days to get this
properly fixed up now and failed miserably. I am almost entirely certain
it has to do with dodgy unit order of casper.service, but I can't figure
out what exactly is wrong or what it should be like. ultimatley
casper.service is a bit garbage because it needs to run some time between
plymouth starting and final happening, when exactly is hard to find out
and also this is shitty to test since the only way to semi reliably
reproduce it is via openqa.... so, instead simply force a reset of the
power if the sytem didn't properly reboot after ~20 seconds of us hitting
enter on the 'hit enter' screen.
it sucks massively from a test reliability POV, but it's the only way I see
to prevent flakeyness
parent 23b416ee
......@@ -273,4 +273,39 @@ sub boot {
$testapi::password = $password;
}
# TODO: could maybe be renamed to reboot and also grow an impl in basetest, then
# use them interchangably. However, this doesn't actually trigger a reboot,
# but conducts it, so it's somewhat different from a regular reboot in
# basetest. Muse on this a bit.
sub live_reboot {
assert_screen "live-remove-medium", 60;
# The message actually comes up before input is read, make sure to send rets
# until the system reboots or we've waited a bit of time. We'll then
# continue and would fail on the first start test if the system in fact
# never rebooted.
my $counter = 20;
while (check_screen('live-remove-medium', 1)) {
if (!$counter--) {
last;
}
eject_cd;
send_key 'ret';
sleep 1;
}
# There's a bug in the unit ordering which prevents reboot from working
# every once in a while. I utterly failed to debug what exactly is wrong,
# but it sucks enormously in code that isn't even maintained by us.
# So, to mitigate this problem w'll force a reset if the remove medium
# screen is still up after having tried to reboot nicely.
# - sitter, Sept. 2018
if (check_screen('live-remove-medium', 1)) {
eject_cd;
sleep 1;
power 'reset';
}
reset_consoles;
}
1;
......@@ -108,9 +108,7 @@ sub run {
assert_and_click "calamares-installer-restart-now";
assert_screen "live-remove-medium", 60;
eject_cd;
send_key "ret";
$self->live_reboot;
reset_consoles;
......
......@@ -128,22 +128,7 @@ sub run {
assert_screen "installer-restart", 640;
assert_and_click "installer-restart-now";
assert_screen "live-remove-medium", 60;
# The message actually comes up before input is read, make sure to send rets
# until the system reboots or we've waited a bit of time. We'll then
# continue and would fail on the first start test if the system in fact
# never rebooted.
my $counter = 20;
while (check_screen('live-remove-medium', 1)) {
if (!$counter--) {
last;
}
eject_cd;
send_key 'ret';
sleep 1;
}
reset_consoles;
$self->live_reboot;
# Set installation data.
$testapi::username = $user;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment