Skip to content

Commit

Permalink
Save ipmi sol output as log file
Browse files Browse the repository at this point in the history
IPMI SOL console output records important information about system
under test, including boot-up process, error messages, unexpected
abnormal output and etc, detailed texts of which likely might not
be recorded by screenshot or even video clip. By saving full output
of ipmi sol console to a log file, which will be uploaded at the
end of test run, investigation and examination work can be executed
much more easily and conveniently without losing any information.
  • Loading branch information
waynechen55 committed Jun 17, 2024
1 parent 412bf51 commit dea5eda
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/OpenQA/Schema/Result/Jobs.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1819,7 +1819,7 @@ sub test_resultfile_list ($self) {
for my $f (@filelist) {
push(@$filelist_existing, $f) if -e "$testresdir/$f";
}
for my $f (qw(serial_terminal.txt serial_terminal_user.txt)) {
for my $f (qw(serial_terminal.txt serial_terminal_user.txt ipmisol-serial.txt)) {
push(@$filelist_existing, $f) if -s "$testresdir/$f";
}

Expand Down
7 changes: 4 additions & 3 deletions lib/OpenQA/Worker/Job.pm
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ sub start {
# ensure log files are empty/removed
if (my $pooldir = $worker->pool_directory) {
open(my $fd, '>', "$pooldir/worker-log.txt") or log_error("Could not open worker log: $!");
foreach my $file (qw(serial0.txt autoinst-log.txt serial_terminal.txt)) {
foreach my $file (qw(serial0.txt autoinst-log.txt serial_terminal.txt ipmisol-serial.txt)) {
next unless -e "$pooldir/$file";
unlink("$pooldir/$file") or log_error("Could not unlink '$file': $!");
}
Expand Down Expand Up @@ -449,12 +449,12 @@ sub _stop_step_4_upload ($self, $reason, $callback) {
}

my @other = (
qw(serial0 video_time.vtt serial_terminal.txt ipmisol-serial virtio_console.log virtio_console1.log virtio_console_user.log),
@{find_video_files($pooldir)->map('basename')->to_array},
COMMON_RESULT_FILES,
COMMON_RESULT_FILES
# NOTE: serial_terminal.txt is from svirt backend. But also
# virtio_console.log from qemu backend is renamed to
# serial_terminal.txt below.
qw(serial0 video_time.vtt serial_terminal.txt virtio_console.log virtio_console1.log virtio_console_user.log)
);
for my $other (@other) {
my $file = "$pooldir/$other";
Expand All @@ -463,6 +463,7 @@ sub _stop_step_4_upload ($self, $reason, $callback) {

# replace some file names
my $ofile = $file;
$ofile =~ s/ipmisol-serial/ipmisol-serial.txt/;
$ofile =~ s/serial0/serial0.txt/;
$ofile =~ s/virtio_console(.*)\.log/serial_terminal$1.txt/;
$ofile =~ s/\.log/.txt/;
Expand Down

0 comments on commit dea5eda

Please sign in to comment.