diff --git a/repos/os/run/report_rom.run b/repos/os/run/report_rom.run
index 4aeae05989..c54a640d5b 100644
--- a/repos/os/run/report_rom.run
+++ b/repos/os/run/report_rom.run
@@ -7,15 +7,15 @@ install_config {
-
-
+
+
+
-
-
-
-
+
+
+
@@ -26,15 +26,20 @@ install_config {
-
-
+
+
+
+
+
+
-
-
+
+
@@ -56,15 +61,19 @@ compare_output_to {
[init -> test-report_rom] Reporter: brightness 10
[init -> test-report_rom] ROM client: request brightness report
[init -> test-report_rom] ->
+ [init -> test-report_rom]
[init -> test-report_rom] Reporter: updated brightness to 77
[init -> test-report_rom] ROM client: wait for update notification
[init -> test-report_rom] ROM client: got signal
[init -> test-report_rom] ROM client: request updated brightness report
[init -> test-report_rom] ->
+ [init -> test-report_rom]
[init -> test-report_rom] Reporter: close report session
[init -> test-report_rom] ROM client: wait for update notification
- [init -> test-report_rom] ROM client: detected vanished report
+ [init -> test-report_rom] ROM client: ROM is available despite report was closed - OK
[init -> test-report_rom] Reporter: start reporting (while the ROM client still listens)
[init -> test-report_rom] ROM client: wait for update notification
+ [init -> test-report_rom] ROM client: try to open the same report again
+ [init -> test-report_rom] ROM client: catched Parent::Service_denied - OK
[init -> test-report_rom] --- test-report_rom finished ---
}
diff --git a/repos/os/src/server/report_rom/report_service.h b/repos/os/src/server/report_rom/report_service.h
index 9600af851d..1b9989fe95 100644
--- a/repos/os/src/server/report_rom/report_service.h
+++ b/repos/os/src/server/report_rom/report_service.h
@@ -53,6 +53,15 @@ struct Report::Session_component : Genode::Rpc_object, Rom::Writer
return i;
}
+ Rom::Module &_create_module(Rom::Module::Name const &name)
+ {
+ try {
+ return _registry.lookup(*this, name);
+ } catch (...) {
+ throw Genode::Root::Invalid_args();
+ }
+ }
+
public:
Session_component(Rom::Module::Name const &name, size_t buffer_size,
@@ -60,7 +69,7 @@ struct Report::Session_component : Genode::Rpc_object, Rom::Writer
:
_registry(registry),
_ds(Genode::env()->ram_session(), buffer_size),
- _module(_registry.lookup(*this, name)),
+ _module(_create_module(name)),
_verbose(verbose)
{ }
diff --git a/repos/os/src/test/report_rom/main.cc b/repos/os/src/test/report_rom/main.cc
index d187b63aff..1bd9009797 100644
--- a/repos/os/src/test/report_rom/main.cc
+++ b/repos/os/src/test/report_rom/main.cc
@@ -47,7 +47,7 @@ int main(int argc, char **argv)
report_brightness(brightness_reporter, 10);
printf("ROM client: request brightness report\n");
- Attached_rom_dataspace brightness_rom("test-report_rom/brightness");
+ Attached_rom_dataspace brightness_rom("brightness");
ASSERT(brightness_rom.is_valid());
@@ -72,8 +72,8 @@ int main(int argc, char **argv)
sig_rec.wait_for_signal();
brightness_rom.update();
- ASSERT(!brightness_rom.is_valid());
- printf("ROM client: detected vanished report\n");
+ ASSERT(brightness_rom.is_valid());
+ printf("ROM client: ROM is available despite report was closed - OK\n");
printf("Reporter: start reporting (while the ROM client still listens)\n");
brightness_reporter.enabled(true);
@@ -82,6 +82,16 @@ int main(int argc, char **argv)
printf("ROM client: wait for update notification\n");
sig_rec.wait_for_signal();
+ try {
+ printf("ROM client: try to open the same report again\n");
+ Reporter again("brightness");
+ again.enabled(true);
+ PERR("expected Service_denied");
+ return -3;
+ } catch (Genode::Parent::Service_denied) {
+ printf("ROM client: catched Parent::Service_denied - OK\n");
+ }
+
printf("--- test-report_rom finished ---\n");
sig_rec.dissolve(&sig_ctx);
diff --git a/tool/autopilot.list b/tool/autopilot.list
index 18372d6d58..f6c2810645 100644
--- a/tool/autopilot.list
+++ b/tool/autopilot.list
@@ -54,3 +54,4 @@ cpu_quota
stdcxx
nic_loopback
platform
+report_rom