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

Re: [XEN PATCH] CI: Rework RISCV smoke test



On Thu, 9 Nov 2023, Andrew Cooper wrote:
> On 09/11/2023 3:49 pm, Anthony PERARD wrote:
> > Currently, the test rely on QEMU and Xen finishing the boot in under
> > two seconds. That's both very long and very short. Xen usually managed
> > to print "All set up" under a second. Unless for some reason we try to
> > run the test on a machine that's busy doing something else.
> >
> > Rework the test to exit as soon as Xen is done.
> >
> > There's two `tail -f`, the first one is there simply to monitor test
> > progress in GitLab console. The second one is used to detect the test
> > result as soon as QEMU add it to the file. Both `tail` exit as soon as
> > QEMU exit.
> >
> > If QEMU fails at start, and exit early, both `tail` will simply exit,
> > resulting in a failure.
> >
> > If the line we are looking for is never printed, the `timeout` on the
> > second `tail` will force the test to exit with an error.
> >
> > Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
> 
> Looks plausible, but all these qemu-smoke scripts are pretty similar,
> and copied from one-another.
> 
> We should make this change consistently to all testing (there's nothing
> RISC-V specific about why this test is failing on this runner), and it
> would be really nice if we could try to make it a bit more common than
> it currently is.

One idea you might like is do to the following (this was developed by
Oleksandr).

---

# Run the test
rm -f smoke.serial
set +e
export qemu_cmd="./binaries/qemu-system-aarch64 \
    -machine virtualization=true \
    -cpu cortex-a57 -machine type=virt \
    -m 2048 -monitor none -serial stdio \
    -smp 2 \
    -no-reboot \
    -device virtio-net-pci,netdev=n0 \
    -netdev user,id=n0,tftp=binaries \
    -bios /usr/lib/u-boot/qemu_arm64/u-boot.bin"

export qemu_arg="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 
0x40000000"
export qemu_log="smoke.serial"
export LOG_MSG="Run /init as init process"
timeout -k 1 60 ./automation/scripts/qemu_key.sh

### qemu_key.sh is using "expect", see below. I think we should be able
### to achieve the same by using expect to close on the expected string
### (instead of waiting for eof)

#!/usr/bin/expect -f

set timeout -1

log_file -a $env(qemu_log)

match_max 10000

eval spawn $env(qemu_cmd)

expect "=>"

send "$env(qemu_arg)\r"

expect "$env(LOG_MSG)\r"

send "$env(XEN_CMD)\r"

expect eof



 


Rackspace

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