2013-06-05 09:42:21 +00:00
|
|
|
#
|
|
|
|
# \brief Test of Block session interface provided by server/part_blk
|
|
|
|
#
|
|
|
|
|
|
|
|
set block_count 20480
|
|
|
|
|
2014-01-24 12:50:46 +00:00
|
|
|
if [catch { set sfdisk [ exec which sfdisk ] }] {
|
|
|
|
puts "sfdisk needs to be installed!"
|
|
|
|
exit 1
|
2013-12-05 14:02:44 +00:00
|
|
|
}
|
2013-06-04 13:47:33 +00:00
|
|
|
|
2011-12-22 15:19:25 +00:00
|
|
|
#
|
|
|
|
# Build
|
|
|
|
#
|
|
|
|
|
2013-12-05 14:02:44 +00:00
|
|
|
build {
|
2013-06-04 13:47:33 +00:00
|
|
|
core init
|
|
|
|
drivers/timer
|
2013-12-05 14:02:44 +00:00
|
|
|
server/rom_blk
|
2013-06-04 13:47:33 +00:00
|
|
|
server/part_blk
|
2013-12-05 14:02:44 +00:00
|
|
|
test/blk/cli
|
2011-12-22 15:19:25 +00:00
|
|
|
}
|
2014-01-24 12:50:46 +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
|
|
|
|
#
|
|
|
|
|
2013-12-05 14:02:44 +00:00
|
|
|
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>
|
2013-12-05 14:02:44 +00:00
|
|
|
<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>
|
2013-12-05 14:02:44 +00:00
|
|
|
<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">
|
2013-12-05 14:02:44 +00:00
|
|
|
<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">
|
2013-12-05 14:02:44 +00:00
|
|
|
<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>
|
2013-06-04 13:47:33 +00:00
|
|
|
</config> }
|
|
|
|
|
2011-12-22 15:19:25 +00:00
|
|
|
#
|
|
|
|
# Boot modules
|
|
|
|
#
|
|
|
|
|
2013-12-05 14:02:44 +00:00
|
|
|
build_boot_image { core init timer rom_blk part_blk test-blk-cli ata.raw }
|
2011-12-22 15:19:25 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Qemu
|
|
|
|
#
|
|
|
|
|
2013-12-05 14:02:44 +00:00
|
|
|
append qemu_args " -nographic -m 128 "
|
2011-12-22 15:19:25 +00:00
|
|
|
|
2014-05-05 12:07:25 +00:00
|
|
|
run_genode_until "Tests finished successfully.*\n.*Tests finished successfully.*\n" 100
|
2013-12-05 14:02:44 +00:00
|
|
|
exec rm bin/ata.raw
|