Skip to content

Commit

Permalink
Merge pull request #4725 from Soulofdestiny/medium_not_available
Browse files Browse the repository at this point in the history
s390x: Collect linuxrc logs in post_fail_hook
  • Loading branch information
okurz committed Mar 29, 2018
2 parents a1fba36 + e004403 commit b24dcb9
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 2 deletions.
24 changes: 23 additions & 1 deletion tests/installation/bootloader_s390.pm
Expand Up @@ -173,9 +173,9 @@ EO_frickin_boot_parms
output_delim => qr/Loading Installation System/,
timeout => 300
) || die "Installation system was not found";
my $display_type;

# set up display_mode for textinstall
my $display_type;
if (check_var("VIDEOMODE", "text")) {
$display_type = "SSH";
}
Expand Down Expand Up @@ -301,4 +301,26 @@ sub run {
$self->result('ok');
}

sub post_fail_hook {
my $s3270 = console('x3270');
my $r;

# Make sure that the screen is updated
$s3270->sequence_3270("ENTER", "ENTER");
if (check_screen 'linuxrc', 10) {
# Start linuxrc shell
$s3270->sequence_3270(qw(String("x") ENTER String("3") ENTER));
assert_screen 'linuxrc-shell';

# collect linuxrc logs
$s3270->sequence_3270("String(\"cat /var/log/linuxrc.log && echo 'LINUXRC_LOG_SAVED'\")", "ENTER");

$r = $s3270->expect_3270(
output_delim => qr/LINUXRC_LOG_SAVED/,
timeout => 60
);
$r ? record_info 'Logs collected', 'Linuxrc logs can be found in autoinst-log.txt' : die "Could not save linuxrc logs";
}
}

1;
16 changes: 15 additions & 1 deletion tests/installation/bootloader_zkvm.pm
Expand Up @@ -19,7 +19,7 @@ use warnings;
use bootloader_setup;
use registration;
use testapi;
use utils 'OPENQA_FTP_URL';
use utils qw(OPENQA_FTP_URL type_line_svirt);

sub set_svirt_domain_elements {
my ($svirt) = shift;
Expand Down Expand Up @@ -92,5 +92,19 @@ sub run {
}
}
}
sub post_fail_hook {
reset_consoles;
select_console 'svirt';

# Enter Linuxrc extra mode
type_line_svirt 'x', expect => 'Linuxrc extras';

# Start linuxrc shell
type_line_svirt '3', expect => 'ttysclp0:install';

# Collect Linuxrc logs
type_line_svirt "'cat /var/log/linuxrc.log > /dev/$serialdev && echo 'LINUXRC_LOG_SAVED' > /dev/$serialdev'";
wait_serial "LINUXRC_LOG_SAVED" ? record_info 'Logs collected', 'Linuxrc logs can be found in serial0.txt' : die "could not collect linuxrc logs";
}

1;

0 comments on commit b24dcb9

Please sign in to comment.