genode/repos/os/run/part_blk.run

105 lines
2.4 KiB
Plaintext
Raw Normal View History

#
# \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
}
2011-12-22 15:19:25 +00:00
#
# Build
#
build {
core init
drivers/timer
server/rom_blk
server/part_blk
test/blk/cli
2011-12-22 15:19:25 +00:00
}
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 }
}
2011-12-22 15:19:25 +00:00
create_boot_directory
#
# Generate config
#
install_config {
2011-12-22 15:19:25 +00:00
<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>
2011-12-22 15:19:25 +00:00
<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>
2011-12-22 15:19:25 +00:00
</route>
<config>
<policy label="test-part1" partition="6"/>
<policy label="test-part2" partition="1"/>
</config>
</start>
<start name="test-part1">
<binary name="test-blk-cli"/>
<resource name="RAM" quantum="5M" />
2011-12-22 15:19:25 +00:00
<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" />
2011-12-22 15:19:25 +00:00
<route>
<any-service> <child name="part_blk" /> <parent/> <any-child/> </any-service>
</route>
</start>
</config> }
2011-12-22 15:19:25 +00:00
#
# Boot modules
#
build_boot_image { core init timer rom_blk part_blk test-blk-cli ata.raw }
2011-12-22 15:19:25 +00:00
#
# Qemu
#
append qemu_args " -nographic -m 128 "
2011-12-22 15:19:25 +00:00
run_genode_until "Tests finished successfully.*\n.*Tests finished successfully.*\n" 100
exec rm bin/ata.raw