genode/repos/os/run/timeout.run

73 lines
1.7 KiB
Plaintext

#
# Build
#
#
# Do not run on QEMU as its time emulation is not precise enough
#
if {[get_cmd_switch --autopilot] && [have_include "power_on/qemu"]} {
puts "\nRunning timeout test in autopilot on Qemu is not recommended.\n"
exit 0
}
#
# Do not run on ARM with kernels other than HW
#
# The ARM performance counter has no reliable frequency as the ARM idle command
# (often called on idle) halts the counter. Only on the HW kernel we have a syscall
# that enables us to avoid the use of the performance counter by reading the kernel
# time instead.
#
if {[expr [have_spec arm] && ![have_spec hw]]} {
puts "\n Run script is not supported on this platform.\n";
exit 0
}
build "core init drivers/platform drivers/timer test/timeout test/cpufreq"
#
# Boot image
#
create_boot_directory
install_config {
<config>
<parent-provides>
<service name="ROM"/>
<service name="RAM"/>
<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"/>
</start>
</config>
}
build_boot_image "core ld.lib.so init timer test-timeout"
#
# Execution
#
append qemu_args "-nographic -m 350"
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}