mirror of
https://github.com/genodelabs/genode.git
synced 2025-05-22 02:07:47 +00:00
This patch unconditionally applies the labeling of sessions and thereby removes the most common use case of 'Child_policy::filter_session_args'. Furthermore, the patch removes an ambiguity of the session labels of sessions created by the parent of behalf of its child, e.g., the PD session created as part of 'Child' now has the label "<child-name>" whereas an unlabeled PD-session request originating from the child has the label "<child-name> -> ". This way, the routing-policy of 'Child_policy::resolve_session_request' can differentiate both cases. As a consequence, the stricter labeling must now be considered wherever a precise label was specified as a key for a session route or a server- side policy selection. The simplest way to adapt those cases is to use a 'label_prefix' instead of the 'label' attribute. Alternatively, the 'label' attribute may used by appending " -> " (note the whitespace). Fixes #2171
105 lines
2.4 KiB
Plaintext
105 lines
2.4 KiB
Plaintext
#
|
|
# \brief Test of Block session interface provided by server/part_blk
|
|
#
|
|
|
|
set block_count 20480
|
|
|
|
if [catch { set sfdisk [ exec which sfdisk ] }] {
|
|
puts "sfdisk needs to be installed!"
|
|
exit 1
|
|
}
|
|
|
|
#
|
|
# Build
|
|
#
|
|
|
|
build {
|
|
core init
|
|
drivers/timer
|
|
server/rom_blk
|
|
server/part_blk
|
|
test/blk/cli
|
|
}
|
|
|
|
if { [file exists bin/ata.raw] == 0 } then {
|
|
# create empty block device file
|
|
catch { exec dd if=/dev/zero of=bin/ata.raw bs=512 count=$block_count }
|
|
|
|
# create two primary partitions (one is extented) and two logical paritions
|
|
puts "using sfdisk to partition disk image, requires root privileges"
|
|
catch { exec echo "2048,4096,c\n4096,16386,5\n0,0\n0,0\n6144,4096,c\n12288,8192,c\n" | $sfdisk -uS -f bin/ata.raw }
|
|
}
|
|
|
|
create_boot_directory
|
|
|
|
#
|
|
# Generate config
|
|
#
|
|
|
|
install_config {
|
|
<config prio_levels="1" verbose="yes">
|
|
<parent-provides>
|
|
<service name="ROM"/>
|
|
<service name="RAM"/>
|
|
<service name="IRQ"/>
|
|
<service name="IO_MEM"/>
|
|
<service name="IO_PORT"/>
|
|
<service name="PD"/>
|
|
<service name="RM"/>
|
|
<service name="CPU"/>
|
|
<service name="LOG"/>
|
|
</parent-provides>
|
|
<default-route>
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
</default-route>
|
|
<start name="timer">
|
|
<resource name="RAM" quantum="1M"/>
|
|
<provides><service name="Timer"/></provides>
|
|
</start>
|
|
<start name="rom_blk">
|
|
<resource name="RAM" quantum="32M"/>
|
|
<provides><service name="Block"/></provides>
|
|
<config file="ata.raw" block_size="512"/>
|
|
</start>
|
|
<start name="part_blk">
|
|
<resource name="RAM" quantum="10M" />
|
|
<provides><service name="Block" /></provides>
|
|
<route>
|
|
<any-service><child name="rom_blk"/> <parent/><any-child/></any-service>
|
|
</route>
|
|
<config>
|
|
<policy label_prefix="test-part1" partition="6"/>
|
|
<policy label_prefix="test-part2" partition="1"/>
|
|
</config>
|
|
</start>
|
|
<start name="test-part1">
|
|
<binary name="test-blk-cli"/>
|
|
<resource name="RAM" quantum="5M" />
|
|
<route>
|
|
<any-service> <child name="part_blk" /> <parent/> <any-child/> </any-service>
|
|
</route>
|
|
</start>
|
|
<start name="test-part2">
|
|
<binary name="test-blk-cli"/>
|
|
<resource name="RAM" quantum="5M" />
|
|
<route>
|
|
<any-service> <child name="part_blk" /> <parent/> <any-child/> </any-service>
|
|
</route>
|
|
</start>
|
|
</config> }
|
|
|
|
#
|
|
# Boot modules
|
|
#
|
|
|
|
build_boot_image { core init timer rom_blk part_blk test-blk-cli ata.raw }
|
|
|
|
#
|
|
# Qemu
|
|
#
|
|
|
|
append qemu_args " -nographic -m 128 "
|
|
|
|
run_genode_until "Tests finished successfully.*\n.*Tests finished successfully.*\n" 100
|
|
exec rm bin/ata.raw
|