mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-27 01:11:06 +00:00
959df5d46b
On Linux, we want to attach additional attributes to processes, i.e., the chroot location, the designated UID, and GID. Instead of polluting the generic code with such Linux-specific platform details, I introduced the new 'Native_pd_args' type, which can be customized for each platform. The platform-dependent policy of init is factored out in the new 'pd_args' library. The new 'base-linux/run/lx_pd_args.run' script can be used to validate the propagation of those attributes into core. Note that this patch does not add the interpretation of the new UID and PID attributes by core. This will be subject of a follow-up patch. Related to #510.
60 lines
1.3 KiB
Plaintext
60 lines
1.3 KiB
Plaintext
#
|
|
# \brief Test for supplying Linux-specific PD-session arguments to core
|
|
# \author Norman Feske
|
|
# \date 2012-11-21
|
|
#
|
|
|
|
build "core init test/printf"
|
|
|
|
assert_spec linux
|
|
|
|
create_boot_directory
|
|
|
|
install_config {
|
|
<config>
|
|
<parent-provides>
|
|
<service name="LOG"/>
|
|
<service name="RAM"/>
|
|
<service name="CAP"/>
|
|
<service name="PD"/>
|
|
<service name="RM"/>
|
|
<service name="CPU"/>
|
|
<service name="ROM"/>
|
|
</parent-provides>
|
|
<default-route>
|
|
<any-service> <parent/> </any-service>
|
|
</default-route>
|
|
<start name="init" uid="11">
|
|
<resource name="RAM" quantum="10M"/>
|
|
<config>
|
|
<parent-provides>
|
|
<service name="LOG"/>
|
|
</parent-provides>
|
|
<start name="test-printf" root="/tmp/somewhere" uid="33" gid="44">
|
|
<resource name="RAM" quantum="10M"/>
|
|
</start>
|
|
</config>
|
|
</start>
|
|
</config>
|
|
}
|
|
|
|
build_boot_image "core init test-printf"
|
|
|
|
#
|
|
# The chroot to '/tmp/somewhere' is expected to fail. We just want to validate
|
|
# that the PD-session arguments are properly propagated into core. Hence, we
|
|
# can take the error message as exit condition of the test run.
|
|
#
|
|
run_genode_until {chroot path does not point to valid directory} 10
|
|
|
|
# keep only the lines containing the relevant core output
|
|
grep_output {^ .*:}
|
|
|
|
compare_output_to {
|
|
uid: 11
|
|
root: /tmp/somewhere
|
|
uid: 11
|
|
gid: 44
|
|
}
|
|
|