genode/repos/os/run/resource_request.run
Norman Feske 8d68d3d8ac Adapt resource-request test to changes of init
The test used to rely on init's formerly built-in policy of answering
resource requests with slack memory, if available. Since init no longer
responds to resource requests in an autonomous way, we use a dynamically
configured sub-init instance as runtime for the test. This instance, in
turn, is monitored and controlled such that resource requests are
result in quota upgrades. The monitoring component is implemented in
the same test-resource_request program as the test. Both roles are
distinguished by the "role" config attribute.

This is a follow-up to "init: explicit response to resource requests".
2017-03-24 16:20:00 +01:00

56 lines
1.6 KiB
Plaintext

build "core init server/report_rom test/resource_request drivers/timer"
create_boot_directory
install_config {
<config>
<parent-provides>
<service name="ROM"/>
<service name="RAM"/>
<service name="CPU"/>
<service name="PD"/>
<service name="IRQ"/>
<service name="IO_PORT"/>
<service name="IO_MEM"/>
<service name="LOG"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<start name="timer">
<resource name="RAM" quantum="1M"/>
<provides><service name="Timer"/></provides>
</start>
<start name="report_rom">
<resource name="RAM" quantum="2M"/>
<provides> <service name="ROM"/> <service name="Report"/> </provides>
<config verbose="no">
<policy label="init -> config" report="init_monitor -> init.config"/>
<policy label="init_monitor -> state" report="init -> state"/>
</config>
</start>
<start name="init">
<resource name="RAM" quantum="10M"/>
<route>
<service name="ROM" label="config"> <child name="report_rom"/> </service>
<any-service> <parent/> <any-child/> </any-service>
</route>
</start>
<start name="init_monitor">
<binary name="test-resource_request"/>
<resource name="RAM" quantum="2M"/>
<config role="monitor"/>
<route>
<service name="ROM" label="state"> <child name="report_rom"/> </service>
<any-service> <parent/> <any-child/> </any-service>
</route>
</start>
</config>
}
build_boot_image "core ld.lib.so init timer report_rom test-resource_request"
append qemu_args "-nographic -m 128"
run_genode_until {child "test-resource_request" exited with exit value 0.*\n} 30