From 8c9142534d477fb14324e7fcfe18eca5e92d8bc1 Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Fri, 14 Jun 2024 18:27:22 +0800 Subject: [PATCH] Save ipmi sol output as log file 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. --- lib/OpenQA/Schema/Result/Jobs.pm | 2 +- lib/OpenQA/Worker/Job.pm | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/OpenQA/Schema/Result/Jobs.pm b/lib/OpenQA/Schema/Result/Jobs.pm index 258da35cee5..90827c8374d 100644 --- a/lib/OpenQA/Schema/Result/Jobs.pm +++ b/lib/OpenQA/Schema/Result/Jobs.pm @@ -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-log.txt)) { push(@$filelist_existing, $f) if -s "$testresdir/$f"; } diff --git a/lib/OpenQA/Worker/Job.pm b/lib/OpenQA/Worker/Job.pm index 0d2411d8320..d91c5ab71bc 100644 --- a/lib/OpenQA/Worker/Job.pm +++ b/lib/OpenQA/Worker/Job.pm @@ -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-log.txt)) { next unless -e "$pooldir/$file"; unlink("$pooldir/$file") or log_error("Could not unlink '$file': $!"); } @@ -454,7 +454,7 @@ sub _stop_step_4_upload ($self, $reason, $callback) { # 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) + qw(serial0 video_time.vtt serial_terminal.txt ipmisol-log virtio_console.log virtio_console1.log virtio_console_user.log) ); for my $other (@other) { my $file = "$pooldir/$other"; @@ -463,6 +463,7 @@ sub _stop_step_4_upload ($self, $reason, $callback) { # replace some file names my $ofile = $file; + $ofile =~ s/ipmisol-log/ipmisol-log.txt/; $ofile =~ s/serial0/serial0.txt/; $ofile =~ s/virtio_console(.*)\.log/serial_terminal$1.txt/; $ofile =~ s/\.log/.txt/;