From 5a9573130556db089c7615649b95a74851125474 Mon Sep 17 00:00:00 2001 From: Peter Surda Date: Fri, 26 Feb 2021 22:41:37 +0100 Subject: [PATCH] test: add assert to parted test --- tests/data/parted.dat | 7 +++++++ tests/drive.sh | 6 ++++-- 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 tests/data/parted.dat diff --git a/tests/data/parted.dat b/tests/data/parted.dat new file mode 100644 index 0000000..9298ef4 --- /dev/null +++ b/tests/data/parted.dat @@ -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 unused:; +3:2149MB:3221MB:1073MB::root unused:; +4:3222MB:4295MB:1073MB::root unused:; +5:4296MB:17.2GB:12.9GB::Encrypted:; diff --git a/tests/drive.sh b/tests/drive.sh index cdc2f51..910c451 100755 --- a/tests/drive.sh +++ b/tests/drive.sh @@ -4,10 +4,12 @@ function test_partitioning() { local img img=$(mktemp -u) - dd if=/dev/zero of="$img" bs=1M seek=16384 count=0 + dd if=/dev/zero of="$img" bs=1M seek=16384 count=0 2> /dev/null setup_drive "$img" - parted -ms "$img" -- print + sed -i "s|T_E_M_P|$img|g;" tests/data/parted.dat + output=$(parted -ms "$img" -- print) rm -f "$img" + assertEquals "$(cat tests/data/parted.dat)" "$output" } function oneTimeSetUp()