diff --git a/lib/anacondatest.pm b/lib/anacondatest.pm index feb46331..1e2b2ae6 100644 --- a/lib/anacondatest.pm +++ b/lib/anacondatest.pm @@ -25,6 +25,31 @@ sub post_fail_hook { save_screenshot; $self->root_console(); + # if we don't have tar or a network connection, we'll try and at + # least send out *some* kinda info via the serial line + my $hostip = $testapi::host_ip(); + if (script_run "ping -c 2 ${hostip}") { + script_run 'printf "\n** X.LOG **\n" > /dev/ttyS0'; + script_run "cat /tmp/X.log > /dev/ttyS0"; + script_run 'printf "\n** ANACONDA.LOG **\n" > /dev/ttyS0'; + script_run "cat /tmp/anaconda.log > /dev/ttyS0"; + script_run 'printf "\n** PACKAGING.LOG **\n" > /dev/ttyS0'; + script_run "cat /tmp/packaging.log > /dev/ttyS0"; + script_run 'printf "\n** STORAGE.LOG **\n" > /dev/ttyS0'; + script_run "cat /tmp/storage.log > /dev/ttyS0"; + script_run 'printf "\n** SYSLOG **\n" > /dev/ttyS0'; + script_run "cat /tmp/syslog > /dev/ttyS0"; + script_run 'printf "\n** PROGRAM.LOG **\n" > /dev/ttyS0'; + script_run "cat /tmp/program.log > /dev/ttyS0"; + script_run 'printf "\n** DNF.LOG **\n" > /dev/ttyS0'; + script_run "cat /tmp/dnf.log > /dev/ttyS0"; + script_run 'printf "\n** DNF.LIBREPO.LOG **\n" > /dev/ttyS0'; + script_run "cat /tmp/dnf.librepo.log > /dev/ttyS0"; + script_run 'printf "\n** DNF.RPM.LOG **\n" > /dev/ttyS0'; + script_run "cat /tmp/dnf.rpm.log > /dev/ttyS0"; + return; + } + upload_logs "/tmp/X.log", failok=>1; upload_logs "/tmp/anaconda.log", failok=>1; upload_logs "/tmp/packaging.log", failok=>1; diff --git a/lib/installedtest.pm b/lib/installedtest.pm index 26de22db..c7cf862c 100644 --- a/lib/installedtest.pm +++ b/lib/installedtest.pm @@ -37,7 +37,21 @@ sub post_fail_hook { # rely on dnf always working (it fails in emergency mode, not sure # why), so try it, then check if we have tar script_run "dnf -y install tar", 180; - assert_script_run "rpm -q tar"; + + # if we don't have tar or a network connection, we'll try and at + # least send out *some* kinda info via the serial line + my $hostip = $testapi::host_ip(); + if (script_run "rpm -q tar" || script_run "ping -c 2 ${hostip}") { + script_run 'printf "\n** IP ADDR **\n" > /dev/ttyS0'; + script_run "ip addr > /dev/ttyS0 2>&1"; + script_run 'printf "\n** IP ROUTE **\n" > /dev/ttyS0'; + script_run "ip route > /dev/ttyS0 2>&1"; + script_run 'printf "\n** NETWORKMANAGER.SERVICE STATUS **\n" > /dev/ttyS0'; + script_run "systemctl --no-pager status NetworkManager.service > /dev/ttyS0 2>&1"; + script_run 'printf "\n** JOURNAL **\n" > /dev/ttyS0'; + script_run "journalctl -b --no-pager > /dev/ttyS0"; + return; + } # Note: script_run returns the exit code, so the logic looks weird. # We're testing that the directory exists and contains something.