From cb035c7737006dfeab5ffaf2aedb846d92313b7e Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Wed, 12 Dec 2018 12:28:23 -0800 Subject: [PATCH] Still fixing up this serial logging stuff Signed-off-by: Adam Williamson --- lib/anacondatest.pm | 36 ++++++++++++++++++------------------ lib/installedtest.pm | 18 +++++++++--------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/lib/anacondatest.pm b/lib/anacondatest.pm index ed810836..036a0b6b 100644 --- a/lib/anacondatest.pm +++ b/lib/anacondatest.pm @@ -29,24 +29,24 @@ sub post_fail_hook { # 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"; + script_run 'printf "\n** X.LOG **\n" > /dev/' . $serialdev; + script_run "cat /tmp/X.log > /dev/${serialdev}"; + script_run 'printf "\n** ANACONDA.LOG **\n" > /dev/' . $serialdev; + script_run "cat /tmp/anaconda.log > /dev/${serialdev}"; + script_run 'printf "\n** PACKAGING.LOG **\n" > /dev/' . $serialdev; + script_run "cat /tmp/packaging.log > /dev/${serialdev}"; + script_run 'printf "\n** STORAGE.LOG **\n" > /dev/' . $serialdev; + script_run "cat /tmp/storage.log > /dev/${serialdev}"; + script_run 'printf "\n** SYSLOG **\n" > /dev/' . $serialdev; + script_run "cat /tmp/syslog > /dev/${serialdev}"; + script_run 'printf "\n** PROGRAM.LOG **\n" > /dev/' . $serialdev; + script_run "cat /tmp/program.log > /dev/${serialdev}"; + script_run 'printf "\n** DNF.LOG **\n" > /dev/' . $serialdev; + script_run "cat /tmp/dnf.log > /dev/${serialdev}"; + script_run 'printf "\n** DNF.LIBREPO.LOG **\n" > /dev/' . $serialdev; + script_run "cat /tmp/dnf.librepo.log > /dev/${serialdev}"; + script_run 'printf "\n** DNF.RPM.LOG **\n" > /dev/' . $serialdev; + script_run "cat /tmp/dnf.rpm.log > /dev/${serialdev}"; return; } diff --git a/lib/installedtest.pm b/lib/installedtest.pm index 13791e22..cb68a75f 100644 --- a/lib/installedtest.pm +++ b/lib/installedtest.pm @@ -41,15 +41,15 @@ sub post_fail_hook { # 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"; + if ((script_run "rpm -q tar") || (script_run "ping -c 2 ${hostip}")) { + script_run 'printf "\n** IP ADDR **\n" > /dev/' . $serialdev; + script_run "ip addr > /dev/${serialdev} 2>&1"; + script_run 'printf "\n** IP ROUTE **\n" > /dev/' . $serialdev; + script_run "ip route > /dev/${serialdev} 2>&1"; + script_run 'printf "\n** NETWORKMANAGER.SERVICE STATUS **\n" > /dev/' . $serialdev; + script_run "systemctl --no-pager status NetworkManager.service > /dev/${serialdev} 2>&1"; + script_run 'printf "\n** JOURNAL **\n" > /dev/' . $serialdev; + script_run "journalctl -b --no-pager > /dev/${serialdev}"; return; }