add: more verbosity for drive tests

This commit is contained in:
Peter Šurda 2021-02-28 09:40:32 +01:00
parent 2b7647b56d
commit 06a29c2dfa
Signed by: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87

View File

@ -13,35 +13,33 @@ function test_partitioning()
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"
assertEquals "setup_drive" "$(cat tests/data/parted.dat)" "$output"
rename_partition "$img" 2 "root $test_version"
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"
assertEquals "rename_partition" "$(cat tests/data/rename.dat)" "$output"
version_from_partnum "$img" 2
assertEquals "$test_version" "$version"
version_from_partnum "$img" 3
assertEquals "$min_version" "$version"
version_from_partnum "$img" 4
assertEquals "$max_version" "$version"
assertEquals "version_from_partnum 2""$test_version" "$version"
find_unused "$img"
assertEquals 3 "$unused"
assertEquals "find_unused" 3 "$unused"
rename_partition "$img" 3 "root $min_version"
find_oldest "$img"
assertEquals "$min_version" "$oldest"
assertEquals "find_oldest" "$min_version" "$oldest"
version_from_partnum "$img" 3
assertEquals "version_from partnum 3" "$min_version" "$version"
rename_partition "$img" 4 "root $max_version"
find_newest "$img"
assertEquals "$max_version" "$newest"
assertEquals "find_newest" "$max_version" "$newest"
version_from_partnum "$img" 4
assertEquals "version_from_partnum 4" "$max_version" "$version"
partition_list "$img"
assertEquals "1 2 3 4 5" "$partitions"
assertEquals "partition_list" "1 2 3 4 5" "$partitions"
rm -f "$img"
}