genode/repos/os/run/timeout.run
Martin Stein 23337eb6e7 run/timeout: run also on arm w/o hw and qemu
On platforms were we do not have local time interpolation we can simply
skip the first test stage in the timeout test. This way, we can at least
test the rest.

Fixes #2435
2017-05-31 17:50:28 +02:00

69 lines
1.8 KiB
Plaintext

#
# Build
#
#
# Do not high precision time on ARM with kernels other than HW and on QEMU
#
# On ARM, we do not have a component-local hardware time-source. The ARM
# performance counter has no reliable frequency as the ARM idle command
# halts the counter. Thus, we do not do local time interpolation on ARM.
# Except we're on the HW kernel. In this case we can read out the kernel
# time instead. On QEMU, the time emulation is not precise enough.
#
proc high_precision_time { } {
if {[get_cmd_switch --autopilot] && [have_include "power_on/qemu"]} { return false }
if {[expr [have_spec arm] && ![have_spec hw]]} { return false }
return true
}
build "core init drivers/platform drivers/timer test/timeout test/cpufreq"
#
# Boot image
#
create_boot_directory
append config {
<config>
<parent-provides>
<service name="ROM"/>
<service name="IRQ"/>
<service name="IO_MEM"/>
<service name="IO_PORT"/>
<service name="PD"/>
<service name="RM"/>
<service name="CPU"/>
<service name="LOG"/>
</parent-provides>
<default-route>
<any-service><parent/><any-child/></any-service>
</default-route>
<default caps="100"/>
<start name="timer">
<resource name="RAM" quantum="10M"/>
<provides><service name="Timer"/></provides>
</start>
<start name="test">
<binary name="test-timeout"/>
<resource name="RAM" quantum="250M"/>
<config high_precision_time="} [high_precision_time] {"/>
</start>
</config>
}
install_config $config
build_boot_image "core ld.lib.so init timer test-timeout"
#
# Execution
#
append qemu_args "-nographic "
run_genode_until "child \"test\" exited with exit value.*\n" 900
grep_output {\[init\] child "test" exited with exit value}
compare_output_to {[init] child "test" exited with exit value 0}