From 307dd5768c48c20382e060da869b6598cb7f857b Mon Sep 17 00:00:00 2001 From: Christian Helmuth Date: Sat, 13 May 2017 23:41:51 +0200 Subject: [PATCH] Test for part_blk with GPT Issue #1576 --- repos/os/run/part_blk.inc | 132 ++++++++++++++++++++++++++++++++++ repos/os/run/part_blk.run | 117 +----------------------------- repos/os/run/part_blk_gpt.run | 3 + tool/autopilot.list | 1 + 4 files changed, 138 insertions(+), 115 deletions(-) create mode 100644 repos/os/run/part_blk.inc create mode 100644 repos/os/run/part_blk_gpt.run diff --git a/repos/os/run/part_blk.inc b/repos/os/run/part_blk.inc new file mode 100644 index 000000000..44e9cd89d --- /dev/null +++ b/repos/os/run/part_blk.inc @@ -0,0 +1,132 @@ +# +# \brief Test of Block session interface provided by server/part_blk +# + +requires_installation_of parted + +# +# Build +# + +build { + core init + drivers/timer + server/rom_blk + server/part_blk + test/blk/cli +} + +set img_file ata.$mode.raw +set img_path bin/$img_file + +if { ![file exists $img_path] } then { + set block_count 20480 + + # create empty block device file + catch { exec dd if=/dev/zero of=$img_path bs=512 count=$block_count } + + # create two primary partitions (one is extented) and two logical paritions + puts "using parted to partition disk image" + + if { $mode == "mbr" } { + 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 + } else { + exec parted -s $img_path mklabel gpt + exec parted -s $img_path mkpart 1 fat32 2048s 4095s + exec parted -s $img_path mkpart 2 fat32 4096s 20446s + } +} + +create_boot_directory + +# +# Generate config +# + +append config { + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } +if { $mode == "mbr" } { + append config { + + + + } +} else { + append config { + + + + } +} + +append config { + + + + + + + + + + + + + + + + } + +install_config $config + +# +# Boot modules +# + +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 + +# +# Qemu +# + +append qemu_args " -nographic -m 128 " + +run_genode_until "Tests finished successfully.*\n.*Tests finished successfully.*\n" 100 +exec rm $img_path diff --git a/repos/os/run/part_blk.run b/repos/os/run/part_blk.run index 44b8e74f8..a2f33636f 100644 --- a/repos/os/run/part_blk.run +++ b/repos/os/run/part_blk.run @@ -1,116 +1,3 @@ -# -# \brief Test of Block session interface provided by server/part_blk -# +set mode mbr -requires_installation_of parted - -# -# Build -# - -build { - core init - drivers/timer - server/rom_blk - server/part_blk - test/blk/cli -} - -set img_file ata.raw -set img_path "bin/$img_file" - -if { [file exists $img_path] == 0 } then { - set block_count 20480 - - # create empty block device file - catch { exec dd if=/dev/zero of=$img_path bs=512 count=$block_count } - - # create two primary partitions (one is extented) and two logical paritions - 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 - } -} - -create_boot_directory - -# -# Generate config -# - -append config { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - } - -install_config $config - -# -# Boot modules -# - -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 - -# -# Qemu -# - -append qemu_args " -nographic -m 128 " - -run_genode_until "Tests finished successfully.*\n.*Tests finished successfully.*\n" 100 -exec rm $img_path +source ${genode_dir}/repos/os/run/part_blk.inc diff --git a/repos/os/run/part_blk_gpt.run b/repos/os/run/part_blk_gpt.run new file mode 100644 index 000000000..dbc5f82fc --- /dev/null +++ b/repos/os/run/part_blk_gpt.run @@ -0,0 +1,3 @@ +set mode gpt + +source ${genode_dir}/repos/os/run/part_blk.inc diff --git a/tool/autopilot.list b/tool/autopilot.list index f7bd4011f..9fa04a779 100644 --- a/tool/autopilot.list +++ b/tool/autopilot.list @@ -41,6 +41,7 @@ resource_request resource_yield gdb_monitor part_blk +part_blk_gpt xml_generator blk_cache rump_ext2