Skip to content

twister: check if qemu binary file exists and if it is executable, and throws an error message if it is not #35386

@wangnuannuan

Description

@wangnuannuan

When the qemu binary file doesn't exist or it is unexecutable, the cmake will not throw error message when build, it will throw error when run command west build -t run.

$ west build -t run
-- west build: running target run
[0/1] To exit from QEMU enter: 'CTRL+a, x'[QEMU] CPU: archs
/bin/sh: /u/svc-arcoss_auto/tools/zephyr-sdk/0.12.3/sysroots/x86_64-pokysdk-linux/usr/bin/qemu-system-arc: Permission denied
FAILED: zephyr/CMakeFiles/run
cd /SCRATCH/jingru/zephyr-project/build && /u/svc-arcoss_auto/tools/zephyr-sdk/0.12.3/sysroots/x86_64-pokysdk-linux/usr/bin/qemu-system-arc -cpu archs -m 8M -nographic -no-reboot -monitor none -global cpu.firq=false -global cpu.num-irqlevels=15 -global cpu.num-irq=25 -global cpu.ext-irq=20 -global cpu.freq_hz=10000000 -global cpu.timer0=true -global cpu.timer1=true -global cpu.has-mpu=true -global cpu.mpu-numreg=16 -net none -pidfile qemu.pid -chardev stdio,id=con,mux=on -serial chardev:con -mon chardev=con,mode=readline -icount shift=6,align=off,sleep=off -rtc clock=vm -kernel /SCRATCH/jingru/zephyr-project/build/zephyr/zephyr.elf
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: /u/jingru/.local/bin/cmake --build /SCRATCH/jingru/zephyr-project/build --target run

Also the twister can't detect this error, then the twister will hang forever.

+ timeout 18000 zephyr/scripts/twister -v --platform qemu_arc_em
INFO    - Zephyr version: v2.6.0-rc1-30-g660d1478c61c
INFO    - JOBS: 20
INFO    - Using 'zephyr' toolchain.
INFO    - Building initial testcase list...
INFO    - 1265 test scenarios (1210 configurations) selected, 899 configurations discarded due to filters.
INFO    - Adding tasks to the queue...
INFO    - Added initial list of jobs to queue
INFO    -   1/311 qemu_arc_em               samples/subsys/shell/shell_module/sample.shell.shell_module.minimal_rtt SKIPPED (filter)
INFO    -   2/311 qemu_arc_em               samples/subsys/mgmt/osdp/control_panel/sample.mgmt.osdp.control_panel SKIPPED (filter)
INFO    -   3/311 qemu_arc_em               samples/subsys/mgmt/osdp/peripheral_device/sample.mgmt.osdp.peripheral_device SKIPPED (filter)
INFO    -   4/311 qemu_arc_em               samples/subsys/logging/logger/sample.logger.rtt    SKIPPED (filter)
INFO    -   5/311 qemu_arc_em               samples/subsys/logging/dictionary/sample.logger.basic.dictionary.fpu.long_double SKIPPED (filter)
INFO    -   6/311 qemu_arc_em               samples/subsys/logging/dictionary/sample.logger.basic.dictionary.fpu SKIPPED (filter)
INFO    -   7/311 qemu_arc_em               samples/subsys/shell/shell_module/sample.shell.shell_module.minimal PASSED (build)
INFO    -   8/311 qemu_arc_em               samples/subsys/shell/shell_module/sample.shell.shell_module.login PASSED (build)
INFO    -   9/311 qemu_arc_em               samples/subsys/shell/shell_module/sample.shell.shell_module PASSED (build)
INFO    -  10/311 qemu_arc_em               samples/subsys/shell/shell_module/sample.shell.shell_module.getopt PASSED (build)
INFO    -  11/311 qemu_arc_em               samples/subsys/logging/dictionary/sample.logger.basic.dictionary PASSED (build)
INFO    -  12/311 qemu_arc_em               samples/subsys/console/getchar/sample.console.getchar PASSED (build)
INFO    -  13/311 qemu_arc_em               samples/subsys/logging/logger/sample.logger.usermode PASSED (build)
INFO    -  14/311 qemu_arc_em               samples/subsys/console/echo/sample.console.echo    PASSED (build)
INFO    -  15/311 qemu_arc_em               samples/subsys/console/getline/sample.console.getline PASSED (build)
INFO    -  16/311 qemu_arc_em               samples/sensor/thermometer/sample.sensor.thermometer PASSED (build)
INFO    -  17/311 qemu_arc_em               samples/sensor/sensor_shell/sample.sensor.shell    PASSED (build)
+ [[ 124 == 124 ]]
+ echo 'twister timeout'
twister timeout
+ true

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementChanges/Updates/Additions to existing features

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions