From 1b4128d3d907de1b6634a0f657b16c567a9cdcda Mon Sep 17 00:00:00 2001 From: Christian Helmuth Date: Thu, 2 Nov 2017 16:38:00 +0100 Subject: [PATCH] Adapt sub_rm test to current Linux 32-bit As noted above the former enum for the local-attachment address we discovered address clashes on current Linux installations, esp. 32-bit runtime on 64-bit Linux. The local_attach_addr is now configurable in the run script and the memory maps heuristics were removed. --- repos/base/run/sub_rm.run | 47 ++++++------------------------ repos/base/src/test/sub_rm/main.cc | 5 ++-- 2 files changed, 12 insertions(+), 40 deletions(-) diff --git a/repos/base/run/sub_rm.run b/repos/base/run/sub_rm.run index 0f96b7a6e..4f6dd9528 100644 --- a/repos/base/run/sub_rm.run +++ b/repos/base/run/sub_rm.run @@ -2,7 +2,11 @@ build "core init test/sub_rm" create_boot_directory -set config { +proc local_attach_addr {} { return "0x70000000" } +proc attach_twice_forbidden {} { if { [have_spec linux] } { return true } else { return false } } +proc support_attach_sub_any {} { if { [have_spec linux] } { return false } else { return true } } + +append config { @@ -15,13 +19,11 @@ set config { - } - -append_if [have_spec linux] config { - } - -append config { + + } @@ -33,34 +35,3 @@ build_boot_image "core ld.lib.so init test-sub_rm" append qemu_args "-nographic " run_genode_until {.*--- end of sub-rm test ---.*} 20 - -if {([have_spec linux] && [have_spec x86_32])} { - set maps [exec cat /proc/[exec pidof test-sub_rm]/maps] - - puts "\nmemory map after test completion follows:\n" - puts "$maps\n" - - # - # Validate some properties of the final mmap - # - if {![regexp {60000000-60040000 ---p} $maps]} { - puts "Error: detaching from sub RM session failed" - exit -1 - } - if {![regexp {60040000-60044000 rw.s} $maps]} { - puts "Error: populating already attached sub RM session failed" - exit -1 - } - if {![regexp {60080000-60083000 rw.s 00001000} $maps]} { - puts "Error: using offset parameter to sub RM attach did not work" - exit -1 - } - if {![regexp {600c0000-600c2000 rw.s 00001000} $maps]} { - puts "Error: using offset and size parameters to sub RM attach did not work" - exit -1 - } - if {![regexp -- {-60100000 ---p} $maps]} { - puts "Error: attached sub RM session exceeds region boundary" - exit -1 - } -} diff --git a/repos/base/src/test/sub_rm/main.cc b/repos/base/src/test/sub_rm/main.cc index d8553b316..83a62c41e 100644 --- a/repos/base/src/test/sub_rm/main.cc +++ b/repos/base/src/test/sub_rm/main.cc @@ -115,9 +115,10 @@ void Component::construct(Env &env) * Technically, this could let the test fail (if Linux decides to mmap the * vdso page to this location. reason ... keeping fingers crossed. */ - enum { LOCAL_ATTACH_ADDR = 0x60000000 }; + addr_t const local_attach_addr = + config.xml().attribute_value("local_attach_addr", (addr_t)0); char *sub_rm_base = env.rm().attach_at(sub_rm.dataspace(), - LOCAL_ATTACH_ADDR); + local_attach_addr); log("validate pattern in sub rm"); validate_pattern_at(test_pattern(), sub_rm_base + DS_SUB_OFFSET);