[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen master] automation: remove CR characters from serial output



commit b576497e3b7d3f986d4624993c3b12051818115d
Author:     Roger Pau Monne <roger.pau@xxxxxxxxxx>
AuthorDate: Tue Nov 21 17:03:52 2023 +0100
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Wed Nov 22 13:37:17 2023 +0000

    automation: remove CR characters from serial output
    
    The gitlab CI webpage seems to have issues displaying the \CR\CR\LF "\r\r\n"
    sequence on the web interface used as line returns by the Linux kernel 
serial
    output.  This leads to the QEMU tests output looking like:
    
    (XEN) Guest Loglevel: Nothing (Rate-limited: Errors and warnings)
    (XEN) *** Serial input to DOM0 (type 'CTRL-a' three times to switch input)
    (XEN) Freed 664kB init memory
    mapping kernel into physical memory
    about to get started...
    qemu-system-x86_64: terminating on signal 15 from pid 52 (timeout)
    
    This not helpful, so strip the CR characters from the output that goes to
    stdout, leaving the output in the serial output file untouched.
    
    All usages of `tee` are adjusted to strip CR from the output.
    
    Fixes: 3030a73bf849 ('automation: add a QEMU based x86_64 Dom0/DomU test')
    Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
    Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>
---
 automation/scripts/qemu-alpine-x86_64.sh          | 5 ++++-
 automation/scripts/qemu-smoke-dom0-arm32.sh       | 3 ++-
 automation/scripts/qemu-smoke-dom0-arm64.sh       | 3 ++-
 automation/scripts/qemu-smoke-dom0less-arm32.sh   | 3 ++-
 automation/scripts/qemu-smoke-dom0less-arm64.sh   | 3 ++-
 automation/scripts/qemu-smoke-riscv64.sh          | 2 +-
 automation/scripts/qemu-xtf-dom0less-arm64.sh     | 3 ++-
 automation/scripts/qubes-x86-64.sh                | 2 +-
 automation/scripts/xilinx-smoke-dom0less-arm64.sh | 2 +-
 9 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/automation/scripts/qemu-alpine-x86_64.sh 
b/automation/scripts/qemu-alpine-x86_64.sh
index 8c8d0b0cd7..a1c41c030a 100755
--- a/automation/scripts/qemu-alpine-x86_64.sh
+++ b/automation/scripts/qemu-alpine-x86_64.sh
@@ -84,7 +84,10 @@ qemu-system-x86_64 \
     -monitor none -serial stdio \
     -nographic \
     -device virtio-net-pci,netdev=n0 \
-    -netdev user,id=n0,tftp=binaries,bootfile=/pxelinux.0 |& tee smoke.serial
+    -netdev user,id=n0,tftp=binaries,bootfile=/pxelinux.0 |& \
+        # Remove carriage returns from the stdout output, as gitlab
+        # interface chokes on them
+        tee smoke.serial | sed 's/\r//'
 
 set -e
 (grep -q "Domain-0" smoke.serial && grep -q "BusyBox" smoke.serial) || exit 1
diff --git a/automation/scripts/qemu-smoke-dom0-arm32.sh 
b/automation/scripts/qemu-smoke-dom0-arm32.sh
index e6f303064a..281cae38b4 100755
--- a/automation/scripts/qemu-smoke-dom0-arm32.sh
+++ b/automation/scripts/qemu-smoke-dom0-arm32.sh
@@ -91,7 +91,8 @@ timeout -k 1 720 \
    -no-reboot \
    -device virtio-net-pci,netdev=n0 \
    -netdev user,id=n0,tftp=./ \
-   -bios /usr/lib/u-boot/qemu_arm/u-boot.bin |& tee ${serial_log}
+   -bios /usr/lib/u-boot/qemu_arm/u-boot.bin |& \
+      tee ${serial_log} | sed 's/\r//'
 
 set -e
 (grep -q "Domain-0" ${serial_log} && grep -q "^/ #" ${serial_log}) || exit 1
diff --git a/automation/scripts/qemu-smoke-dom0-arm64.sh 
b/automation/scripts/qemu-smoke-dom0-arm64.sh
index 0bf5cfdc61..bb3d3a6a81 100755
--- a/automation/scripts/qemu-smoke-dom0-arm64.sh
+++ b/automation/scripts/qemu-smoke-dom0-arm64.sh
@@ -104,7 +104,8 @@ timeout -k 1 720 \
     -no-reboot \
     -device virtio-net-pci,netdev=n0 \
     -netdev user,id=n0,tftp=binaries \
-    -bios /usr/lib/u-boot/qemu_arm64/u-boot.bin |& tee smoke.serial
+    -bios /usr/lib/u-boot/qemu_arm64/u-boot.bin |& \
+        tee smoke.serial | sed 's/\r//'
 
 set -e
 (grep -q "Domain-0" smoke.serial && grep -q "BusyBox" smoke.serial) || exit 1
diff --git a/automation/scripts/qemu-smoke-dom0less-arm32.sh 
b/automation/scripts/qemu-smoke-dom0less-arm32.sh
index fb8f044a51..737adaf1a9 100755
--- a/automation/scripts/qemu-smoke-dom0less-arm32.sh
+++ b/automation/scripts/qemu-smoke-dom0less-arm32.sh
@@ -137,7 +137,8 @@ timeout -k 1 240 \
     -no-reboot \
     -device virtio-net-pci,netdev=n0 \
     -netdev user,id=n0,tftp=./ \
-    -bios /usr/lib/u-boot/qemu_arm/u-boot.bin |& tee ${serial_log}
+    -bios /usr/lib/u-boot/qemu_arm/u-boot.bin |& \
+        tee ${serial_log} | sed 's/\r//'
 
 set -e
 (grep -q "${dom0_prompt}" ${serial_log} && grep -q "${passed}" ${serial_log}) 
|| exit 1
diff --git a/automation/scripts/qemu-smoke-dom0less-arm64.sh 
b/automation/scripts/qemu-smoke-dom0less-arm64.sh
index 75f575424a..b5ce7efdd4 100755
--- a/automation/scripts/qemu-smoke-dom0less-arm64.sh
+++ b/automation/scripts/qemu-smoke-dom0less-arm64.sh
@@ -201,7 +201,8 @@ timeout -k 1 240 \
     -no-reboot \
     -device virtio-net-pci,netdev=n0 \
     -netdev user,id=n0,tftp=binaries \
-    -bios /usr/lib/u-boot/qemu_arm64/u-boot.bin |& tee smoke.serial
+    -bios /usr/lib/u-boot/qemu_arm64/u-boot.bin |& \
+        tee smoke.serial | sed 's/\r//'
 
 set -e
 (grep -q "^Welcome to Alpine Linux" smoke.serial && grep -q "${passed}" 
smoke.serial) || exit 1
diff --git a/automation/scripts/qemu-smoke-riscv64.sh 
b/automation/scripts/qemu-smoke-riscv64.sh
index 4008191302..f90df3c051 100755
--- a/automation/scripts/qemu-smoke-riscv64.sh
+++ b/automation/scripts/qemu-smoke-riscv64.sh
@@ -13,7 +13,7 @@ qemu-system-riscv64 \
     -nographic \
     -m 2g \
     -kernel binaries/xen \
-    |& tee smoke.serial
+    |& tee smoke.serial | sed 's/\r//'
 
 set -e
 (grep -q "All set up" smoke.serial) || exit 1
diff --git a/automation/scripts/qemu-xtf-dom0less-arm64.sh 
b/automation/scripts/qemu-xtf-dom0less-arm64.sh
index 3ec9cf74e1..0c4578eda6 100755
--- a/automation/scripts/qemu-xtf-dom0less-arm64.sh
+++ b/automation/scripts/qemu-xtf-dom0less-arm64.sh
@@ -61,7 +61,8 @@ timeout -k 1 120 \
     -no-reboot \
     -device virtio-net-pci,netdev=n0 \
     -netdev user,id=n0,tftp=binaries \
-    -bios /usr/lib/u-boot/qemu_arm64/u-boot.bin |& tee smoke.serial
+    -bios /usr/lib/u-boot/qemu_arm64/u-boot.bin |& \
+        tee smoke.serial | sed 's/\r//'
 
 set -e
 (grep -q "${passed}" smoke.serial) || exit 1
diff --git a/automation/scripts/qubes-x86-64.sh 
b/automation/scripts/qubes-x86-64.sh
index 51323b1ae0..adec0f1f25 100755
--- a/automation/scripts/qubes-x86-64.sh
+++ b/automation/scripts/qubes-x86-64.sh
@@ -200,7 +200,7 @@ cp -f binaries/dom0-rootfs.cpio.gz $TFTP/initrd-dom0
 # the console
 mkfifo /tmp/console-stdin
 cat /tmp/console-stdin |\
-ssh $CONTROLLER console | tee smoke.serial &
+ssh $CONTROLLER console | tee smoke.serial | sed 's/\r//' &
 
 # start the system pointing at gitlab-ci predefined config
 ssh $CONTROLLER gitlabci poweron
diff --git a/automation/scripts/xilinx-smoke-dom0less-arm64.sh 
b/automation/scripts/xilinx-smoke-dom0less-arm64.sh
index 075305241c..2bf786f6ee 100755
--- a/automation/scripts/xilinx-smoke-dom0less-arm64.sh
+++ b/automation/scripts/xilinx-smoke-dom0less-arm64.sh
@@ -136,7 +136,7 @@ cd $START
 # connect to serial
 set +e
 stty -F /dev/ttyUSB0 115200
-timeout -k 1 120 nohup sh -c "cat /dev/ttyUSB0 | tee smoke.serial"
+timeout -k 1 120 nohup sh -c "cat /dev/ttyUSB0 | tee smoke.serial | sed 
's/\r//'"
 
 # stop the board
 cd /scratch/gitlab-runner
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.