[PATCH 3/3] CI: Improve serial handling in qemu-smoke-ppc64le.sh

Andrew Cooper posted 3 patches 5 months, 4 weeks ago
[PATCH 3/3] CI: Improve serial handling in qemu-smoke-ppc64le.sh
Posted by Andrew Cooper 5 months, 4 weeks ago
Have PPC put serial to stdout like all other tests, so it shows up in the main
job log.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Michal Orzel <michal.orzel@amd.com>
CC: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
CC: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 automation/scripts/qemu-smoke-ppc64le.sh | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/automation/scripts/qemu-smoke-ppc64le.sh b/automation/scripts/qemu-smoke-ppc64le.sh
index 2adbdac87ef5..701d81107d18 100755
--- a/automation/scripts/qemu-smoke-ppc64le.sh
+++ b/automation/scripts/qemu-smoke-ppc64le.sh
@@ -2,15 +2,15 @@
 
 set -ex
 
+serial_log="$(pwd)/smoke.serial"
+
 # machine type from first arg passed directly to qemu -M
 machine=$1
 
 # Run the test
-rm -f smoke.serial
+rm -f ${serial_log}
 set +e
 
-touch smoke.serial
-
 timeout -k 1 20 \
 binaries/qemu-system-ppc64 \
     -bios binaries/skiboot.lid \
@@ -20,9 +20,10 @@ binaries/qemu-system-ppc64 \
     -vga none \
     -monitor none \
     -nographic \
-    -serial file:smoke.serial \
-    -kernel binaries/xen
+    -serial stdio \
+    -kernel binaries/xen \
+    |& tee ${serial_log} | sed 's/\r//'
 
 set -e
-(grep -q "Hello, ppc64le!" smoke.serial) || exit 1
+(grep -q "Hello, ppc64le!" ${serial_log}) || exit 1
 exit 0
-- 
2.30.2


Re: [PATCH 3/3] CI: Improve serial handling in qemu-smoke-ppc64le.sh
Posted by Stefano Stabellini 5 months, 3 weeks ago
On Wed, 29 May 2024, Andrew Cooper wrote:
> Have PPC put serial to stdout like all other tests, so it shows up in the main
> job log.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
> CC: Roger Pau Monné <roger.pau@citrix.com>
> CC: Stefano Stabellini <sstabellini@kernel.org>
> CC: Michal Orzel <michal.orzel@amd.com>
> CC: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
> CC: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> ---
>  automation/scripts/qemu-smoke-ppc64le.sh | 13 +++++++------
>  1 file changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/automation/scripts/qemu-smoke-ppc64le.sh b/automation/scripts/qemu-smoke-ppc64le.sh
> index 2adbdac87ef5..701d81107d18 100755
> --- a/automation/scripts/qemu-smoke-ppc64le.sh
> +++ b/automation/scripts/qemu-smoke-ppc64le.sh
> @@ -2,15 +2,15 @@
>  
>  set -ex
>  
> +serial_log="$(pwd)/smoke.serial"
> +
>  # machine type from first arg passed directly to qemu -M
>  machine=$1
>  
>  # Run the test
> -rm -f smoke.serial
> +rm -f ${serial_log}
>  set +e
>  
> -touch smoke.serial
> -
>  timeout -k 1 20 \
>  binaries/qemu-system-ppc64 \
>      -bios binaries/skiboot.lid \
> @@ -20,9 +20,10 @@ binaries/qemu-system-ppc64 \
>      -vga none \
>      -monitor none \
>      -nographic \
> -    -serial file:smoke.serial \
> -    -kernel binaries/xen
> +    -serial stdio \
> +    -kernel binaries/xen \
> +    |& tee ${serial_log} | sed 's/\r//'
>  
>  set -e
> -(grep -q "Hello, ppc64le!" smoke.serial) || exit 1
> +(grep -q "Hello, ppc64le!" ${serial_log}) || exit 1
>  exit 0
> -- 
> 2.30.2
>