diff mbox series

[v1,8/8] automation: add RISC-V smoke test

Message ID 90078a83982b37846e9845c8ffc50c92f3be1f47.1673009740.git.oleksii.kurochko@gmail.com (mailing list archive)
State Superseded
Headers show
Series Basic early_printk and smoke test implementation | expand

Commit Message

Oleksii Kurochko Jan. 6, 2023, 1:14 p.m. UTC
Add check if there is a message 'Hello from C env' presents
in log file to be sure that stack is set and C part of early printk
is working.

Also qemu-system-riscv was added to riscv64.dockerfile as it is
required for RISC-V smoke test.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 automation/build/archlinux/riscv64.dockerfile |  3 ++-
 automation/scripts/qemu-smoke-riscv64.sh      | 20 +++++++++++++++++++
 2 files changed, 22 insertions(+), 1 deletion(-)
 create mode 100755 automation/scripts/qemu-smoke-riscv64.sh

Comments

Andrew Cooper Jan. 6, 2023, 3:05 p.m. UTC | #1
On 06/01/2023 1:14 pm, Oleksii Kurochko wrote:
> Add check if there is a message 'Hello from C env' presents
> in log file to be sure that stack is set and C part of early printk
> is working.
>
> Also qemu-system-riscv was added to riscv64.dockerfile as it is
> required for RISC-V smoke test.
>
> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> ---
>  automation/build/archlinux/riscv64.dockerfile |  3 ++-
>  automation/scripts/qemu-smoke-riscv64.sh      | 20 +++++++++++++++++++
>  2 files changed, 22 insertions(+), 1 deletion(-)
>  create mode 100755 automation/scripts/qemu-smoke-riscv64.sh

Looking through the entire series, aren't we missing a hunk to test.yml
to wire up the smoke test?

It wants to live in this patch along with the introduction of
qemu-smoke-riscv64.sh

However, the modification to the dockerfile want breaking out and
submitted separately.  It will involve rebuilding and redeploying the
container, which is a) fine to do separately, and b) a necessary
prerequisite for anyone else to take this series and test it.

~Andrew
Oleksii Kurochko Jan. 9, 2023, 9:11 a.m. UTC | #2
On Fri, 2023-01-06 at 15:05 +0000, Andrew Cooper wrote:
> On 06/01/2023 1:14 pm, Oleksii Kurochko wrote:
> > Add check if there is a message 'Hello from C env' presents
> > in log file to be sure that stack is set and C part of early printk
> > is working.
> > 
> > Also qemu-system-riscv was added to riscv64.dockerfile as it is
> > required for RISC-V smoke test.
> > 
> > Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> > ---
> >  automation/build/archlinux/riscv64.dockerfile |  3 ++-
> >  automation/scripts/qemu-smoke-riscv64.sh      | 20
> > +++++++++++++++++++
> >  2 files changed, 22 insertions(+), 1 deletion(-)
> >  create mode 100755 automation/scripts/qemu-smoke-riscv64.sh
> 
> Looking through the entire series, aren't we missing a hunk to
> test.yml
> to wire up the smoke test?
> 
Missed that. Will update test.yml in the next patch series.
> It wants to live in this patch along with the introduction of
> qemu-smoke-riscv64.sh
> 
> However, the modification to the dockerfile want breaking out and
> submitted separately.  It will involve rebuilding and redeploying the
> container, which is a) fine to do separately, and b) a necessary
> prerequisite for anyone else to take this series and test it.
> 
I am going to send a patch with the dockerfle modification today.
Thanks.

> ~Andrew
~ Oleksii
diff mbox series

Patch

diff --git a/automation/build/archlinux/riscv64.dockerfile b/automation/build/archlinux/riscv64.dockerfile
index ff8b2b955d..375c78ecd5 100644
--- a/automation/build/archlinux/riscv64.dockerfile
+++ b/automation/build/archlinux/riscv64.dockerfile
@@ -9,7 +9,8 @@  RUN pacman --noconfirm --needed -Syu \
     inetutils \
     riscv64-linux-gnu-binutils \
     riscv64-linux-gnu-gcc \
-    riscv64-linux-gnu-glibc
+    riscv64-linux-gnu-glibc \
+    qemu-system-riscv
 
 # Add compiler path
 ENV CROSS_COMPILE=riscv64-linux-gnu-
diff --git a/automation/scripts/qemu-smoke-riscv64.sh b/automation/scripts/qemu-smoke-riscv64.sh
new file mode 100755
index 0000000000..e0f06360bc
--- /dev/null
+++ b/automation/scripts/qemu-smoke-riscv64.sh
@@ -0,0 +1,20 @@ 
+#!/bin/bash
+
+set -ex
+
+# Run the test
+rm -f smoke.serial
+set +e
+
+timeout -k 1 2 \
+qemu-system-riscv64 \
+    -M virt \
+    -smp 1 \
+    -nographic \
+    -m 2g \
+    -kernel binaries/xen \
+    |& tee smoke.serial
+
+set -e
+(grep -q "Hello from C env" smoke.serial) || exit 1
+exit 0