genode/repos/os/run/timeout.run
Martin Stein 5fec4a2166 timeout test: raise error tolerance on nova + qemu
On QEMU, NOVA uses the pretty unstable TSC emulation as primary time
source. Thus, timeouts do not trigger with the common precision (< 50
ms). Use an error tolerance of 200 ms for this platform constellation.

Ref #2400
2017-06-29 11:59:49 +02:00

88 lines
2.1 KiB
Plaintext

#
# Build
#
#
# Wether the platform allows for timeouts that trigger with a precision < 50 milliseconds
#
proc precise_timeouts { } {
#
# On QEMU, NOVA uses the pretty unstable TSC emulation as primary time source.
#
if {[have_include "power_on/qemu"] && [have_spec nova]} { return false }
return true
}
#
# Wether the platform allows for a timestamp that has a precision < 1 millisecond
#
proc precise_time { } {
#
# On QEMU, timing is not stable enough for microseconds precision
#
if {[have_include "power_on/qemu"]} { return false }
#
# On ARM, we do not have a component-local time source in hardware. The ARM
# performance counter has no reliable frequency as the ARM idle command
# halts the counter. Thus, we do not use local time interpolation on ARM.
# Except we're on the HW kernel. In this case we can read out the kernel
# time instead.
#
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 precise_time="} [precise_time] {"
precise_timeouts="} [precise_timeouts] {"/>
</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}