2013-06-05 09:42:21 +00:00
|
|
|
#
|
|
|
|
# \brief Test of Block session interface provided by server/part_blk
|
|
|
|
#
|
|
|
|
|
2017-05-13 21:18:15 +00:00
|
|
|
requires_installation_of parted
|
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
|
|
|
|
2017-05-13 21:18:15 +00:00
|
|
|
set img_file ata.raw
|
|
|
|
set img_path "bin/$img_file"
|
|
|
|
|
|
|
|
if { [file exists $img_path] == 0 } then {
|
|
|
|
set block_count 20480
|
|
|
|
|
2014-01-24 12:50:46 +00:00
|
|
|
# create empty block device file
|
2017-05-13 21:18:15 +00:00
|
|
|
catch { exec dd if=/dev/zero of=$img_path bs=512 count=$block_count }
|
2014-01-24 12:50:46 +00:00
|
|
|
|
|
|
|
# create two primary partitions (one is extented) and two logical paritions
|
2017-05-13 21:18:15 +00:00
|
|
|
puts "using parted to partition disk image"
|
|
|
|
catch {
|
|
|
|
exec parted -s $img_path mklabel msdos
|
|
|
|
exec parted -s $img_path mkpart primary fat32 2048s 4095s
|
|
|
|
exec parted -s $img_path mkpart extended 4096s 20479s
|
|
|
|
exec parted -s $img_path mkpart logical fat32 6144s 10239s
|
|
|
|
exec parted -s $img_path mkpart logical fat32 12288s 20479s
|
|
|
|
}
|
2014-01-24 12:50:46 +00:00
|
|
|
}
|
|
|
|
|
2011-12-22 15:19:25 +00:00
|
|
|
create_boot_directory
|
|
|
|
|
|
|
|
#
|
|
|
|
# Generate config
|
|
|
|
#
|
|
|
|
|
2017-05-13 21:18:15 +00:00
|
|
|
append 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>
|
2017-05-07 20:36:11 +00:00
|
|
|
<default caps="100"/>
|
2011-12-22 15:19:25 +00:00
|
|
|
<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>
|
2017-05-13 21:18:15 +00:00
|
|
|
<config file="} $img_file {" block_size="512"/>
|
2013-12-05 14:02:44 +00:00
|
|
|
</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>
|
2017-05-13 21:18:15 +00:00
|
|
|
<config use_gpt="yes">
|
2016-11-24 14:28:32 +00:00
|
|
|
<policy label_prefix="test-part1" partition="6"/>
|
|
|
|
<policy label_prefix="test-part2" partition="1"/>
|
2011-12-22 15:19:25 +00:00
|
|
|
</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> }
|
|
|
|
|
2017-05-13 21:18:15 +00:00
|
|
|
install_config $config
|
|
|
|
|
2011-12-22 15:19:25 +00:00
|
|
|
#
|
|
|
|
# Boot modules
|
|
|
|
#
|
|
|
|
|
2017-05-13 21:18:15 +00:00
|
|
|
append boot_modules { core ld.lib.so init timer rom_blk part_blk test-blk-cli }
|
|
|
|
append boot_modules $img_file
|
|
|
|
|
|
|
|
build_boot_image $boot_modules
|
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
|
2017-05-13 21:18:15 +00:00
|
|
|
exec rm $img_path
|