sysdeploy/tests/drive.sh

26 lines
619 B
Bash
Executable File

#!/bin/bash
function test_partitioning()
{
local img
img=$(mktemp -u)
dd if=/dev/zero of="$img" bs=1M seek=16384 count=0 2> /dev/null
setup_drive "$img"
output=$(parted -ms "$img" -- print)
sed -i "s|T_E_M_P|$img|g;" tests/data/parted.dat
assertEquals "$(cat tests/data/parted.dat)" "$output"
rename_partition "$img" 2 "root renamed"
output=$(parted -ms "$img" -- print)
sed -i "s|T_E_M_P|$img|g;" tests/data/rename.dat
assertEquals "$(cat tests/data/rename.dat)" "$output"
rm -f "$img"
}
function oneTimeSetUp()
{
. drive.inc
}
# Load shUnit2.
. /usr/bin/shunit2