diff --git a/repos/os/run/bomb.run b/repos/os/run/bomb.run index cf5ab48faf..5d3cce8d62 100644 --- a/repos/os/run/bomb.run +++ b/repos/os/run/bomb.run @@ -1,8 +1,18 @@ build "core init test/bomb drivers/timer" -create_boot_directory +set timeout 240 +set rounds 20 -install_config { + +if {[have_include "power_on/qemu"]} { + append qemu_args "-nographic -m 128" +} else { + # foc is really slow on native hardware executing this test - limit rounds + if {[have_spec foc_x86_32]} { set rounds 6 } + if {[have_spec foc_x86_64]} { set rounds 6 } +} + +set config { @@ -21,20 +31,28 @@ install_config { + - - + + } + +append config " + " + +append config { } +create_boot_directory + +install_config $config + build_boot_image "core init bomb timer" -append qemu_args "-nographic -m 128" - -run_genode_until "Done\. Going to sleep\." 300 +run_genode_until "Done\. Going to sleep\." $timeout puts "Test succeeded." diff --git a/repos/os/src/test/bomb/main.cc b/repos/os/src/test/bomb/main.cc index 5a4f021845..ea9ab5fb20 100644 --- a/repos/os/src/test/bomb/main.cc +++ b/repos/os/src/test/bomb/main.cc @@ -278,6 +278,14 @@ int main(int argc, char **argv) /* is init our parent? */ if (!timer()) sleep_forever(); + /* don't ask parent for further resources if we ran out of memory */ + static Signal_receiver sig_rec; + static Signal_context sig_ctx_res_avail; + if (round == 0) { + /* prevent to block for resource upgrades caused by clients */ + env()->parent()->resource_avail_sigh(sig_rec.manage(&sig_ctx_res_avail)); + } + timer()->msleep(sleeptime); PINF("[%03d] It's time to kill all my children...", round); @@ -296,8 +304,8 @@ int main(int argc, char **argv) PINF("[%03d] Done.", round); } - /* master if rounds != 0 */ - if (rounds != 0) + /* master if we have a timer connection */ + if (timer()) PINF("Done. Going to sleep"); sleep_forever();