test: add partition rename test
This commit is contained in:
parent
5a95731305
commit
b0e6ce8c1b
7
tests/data/rename.dat
Normal file
7
tests/data/rename.dat
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
BYT;
|
||||||
|
T_E_M_P:17.2GB:file:512:512:gpt::;
|
||||||
|
1:1049kB:1074MB:1073MB::EFI system partition:boot, esp;
|
||||||
|
2:1075MB:2147MB:1073MB::root renamed:;
|
||||||
|
3:2149MB:3221MB:1073MB::root unused:;
|
||||||
|
4:3222MB:4295MB:1073MB::root unused:;
|
||||||
|
5:4296MB:17.2GB:12.9GB::Encrypted:;
|
|
@ -6,10 +6,14 @@ function test_partitioning()
|
||||||
img=$(mktemp -u)
|
img=$(mktemp -u)
|
||||||
dd if=/dev/zero of="$img" bs=1M seek=16384 count=0 2> /dev/null
|
dd if=/dev/zero of="$img" bs=1M seek=16384 count=0 2> /dev/null
|
||||||
setup_drive "$img"
|
setup_drive "$img"
|
||||||
sed -i "s|T_E_M_P|$img|g;" tests/data/parted.dat
|
|
||||||
output=$(parted -ms "$img" -- print)
|
output=$(parted -ms "$img" -- print)
|
||||||
rm -f "$img"
|
sed -i "s|T_E_M_P|$img|g;" tests/data/parted.dat
|
||||||
assertEquals "$(cat tests/data/parted.dat)" "$output"
|
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()
|
function oneTimeSetUp()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user