run: make bomb test ready for auto tests
This commit is contained in:
parent
2e58428b51
commit
071ca39407
|
@ -21,17 +21,19 @@ install_config {
|
||||||
<any-service> <parent/> <any-child/> </any-service>
|
<any-service> <parent/> <any-child/> </any-service>
|
||||||
</default-route>
|
</default-route>
|
||||||
<start name="timer">
|
<start name="timer">
|
||||||
<resource name="RAM" quantum="512K"/>
|
<resource name="RAM" quantum="768K"/>
|
||||||
<provides><service name="Timer"/></provides>
|
<provides><service name="Timer"/></provides>
|
||||||
</start>
|
</start>
|
||||||
<start name="bomb" priority="-1">
|
<start name="bomb" priority="-1">
|
||||||
<resource name="RAM" quantum="2G"/>
|
<resource name="RAM" quantum="2G"/>
|
||||||
|
<config rounds="20"/>
|
||||||
</start>
|
</start>
|
||||||
</config>}
|
</config>}
|
||||||
|
|
||||||
build_boot_image "core init bomb timer"
|
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."
|
||||||
|
|
|
@ -27,6 +27,9 @@
|
||||||
#include <rm_session/connection.h>
|
#include <rm_session/connection.h>
|
||||||
#include <timer_session/connection.h>
|
#include <timer_session/connection.h>
|
||||||
|
|
||||||
|
#include <os/config.h>
|
||||||
|
#include <util/xml_node.h>
|
||||||
|
|
||||||
using namespace Genode;
|
using namespace Genode;
|
||||||
|
|
||||||
|
|
||||||
|
@ -213,6 +216,12 @@ Timer::Session *timer()
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
unsigned long rounds = 5;
|
||||||
|
|
||||||
|
try {
|
||||||
|
config()->xml_node().attribute("rounds").value(&rounds);
|
||||||
|
} catch(...) { }
|
||||||
|
|
||||||
printf("--- bomb started ---\n");
|
printf("--- bomb started ---\n");
|
||||||
|
|
||||||
/* connect to core's cap service used for creating parent capabilities */
|
/* connect to core's cap service used for creating parent capabilities */
|
||||||
|
@ -236,7 +245,7 @@ int main(int argc, char **argv)
|
||||||
sleep_forever();
|
sleep_forever();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (unsigned round = 1; ; ++round) {
|
for (unsigned round = 1; round < rounds ; ++round) {
|
||||||
for (unsigned i = children; i; --i)
|
for (unsigned i = children; i; --i)
|
||||||
start_child("bomb", &cap, amount, &parent_services);
|
start_child("bomb", &cap, amount, &parent_services);
|
||||||
|
|
||||||
|
@ -258,9 +267,11 @@ int main(int argc, char **argv)
|
||||||
else break;
|
else break;
|
||||||
}
|
}
|
||||||
|
|
||||||
PINF("Done.");
|
PINF("[%03d] Done.", round);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PINF("Done. Going to sleep");
|
||||||
|
|
||||||
sleep_forever();
|
sleep_forever();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue