run: make bomb test ready for auto tests

This commit is contained in:
Alexander Boettcher 2013-08-05 12:16:43 +02:00 committed by Norman Feske
parent 2e58428b51
commit 071ca39407
2 changed files with 18 additions and 5 deletions

View File

@ -21,17 +21,19 @@ install_config {
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<start name="timer">
<resource name="RAM" quantum="512K"/>
<resource name="RAM" quantum="768K"/>
<provides><service name="Timer"/></provides>
</start>
<start name="bomb" priority="-1">
<resource name="RAM" quantum="2G"/>
<config rounds="20"/>
</start>
</config>}
build_boot_image "core init bomb timer"
append qemu_args "-nographic -m 64"
append qemu_args "-nographic -m 128"
run_genode_until forever
run_genode_until "Done\. Going to sleep\." 300
puts "Test succeeded."

View File

@ -27,6 +27,9 @@
#include <rm_session/connection.h>
#include <timer_session/connection.h>
#include <os/config.h>
#include <util/xml_node.h>
using namespace Genode;
@ -213,6 +216,12 @@ Timer::Session *timer()
int main(int argc, char **argv)
{
unsigned long rounds = 5;
try {
config()->xml_node().attribute("rounds").value(&rounds);
} catch(...) { }
printf("--- bomb started ---\n");
/* connect to core's cap service used for creating parent capabilities */
@ -236,7 +245,7 @@ int main(int argc, char **argv)
sleep_forever();
}
for (unsigned round = 1; ; ++round) {
for (unsigned round = 1; round < rounds ; ++round) {
for (unsigned i = children; i; --i)
start_child("bomb", &cap, amount, &parent_services);
@ -258,9 +267,11 @@ int main(int argc, char **argv)
else break;
}
PINF("Done.");
PINF("[%03d] Done.", round);
}
PINF("Done. Going to sleep");
sleep_forever();
return 0;
}