diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2019-09-20 19:17:54 +0200 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2019-09-20 19:21:31 +0200 |
commit | c33962e0de664bb977d234f7b31ebd00823b139d (patch) | |
tree | d2081def0c41f1a47359edf2466e716789c9e395 | |
parent | d5ab008b35dc691c22b8b643a96b8d178a0328e3 (diff) | |
download | genimage-c33962e0de664bb977d234f7b31ebd00823b139d.tar.gz genimage-c33962e0de664bb977d234f7b31ebd00823b139d.tar.xz |
test: check hd images with 'sfdisk -V'
It will complain about a corrupt secondary GPT table. Unfortunately, the
return value remains zero, so we need to check the output.
Ignore messages about unused empty space at the end of the device.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rwxr-xr-x | test/basic-images.test | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/basic-images.test b/test/basic-images.test index 4554b7a..52e2f22 100755 --- a/test/basic-images.test +++ b/test/basic-images.test @@ -89,6 +89,14 @@ check_size() { fi } +sfdisk_validate() { + if [ -n "$(sfdisk -q -V "${1}" 2>&1 | grep -v unallocated)" ]; then + echo "'sfdisk -V' failed with:" + sfdisk -V "${1}" 2>&1 + return 1 + fi +} + exec_test_set_prereq() { command -v "${1}" > /dev/null && test_set_prereq "${1/./_}" } @@ -199,6 +207,7 @@ test_expect_success fdisk,sfdisk "hdimage" " setup_test_images && run_genimage hdimage.config test.hdimage && check_size images/test.hdimage 10485760 && + sfdisk_validate images/test.hdimage && # check the this identifier fdisk -l images/test.hdimage | grep identifier: > hdimage.fdisk && # check partitions; filter output to handle different sfdisk versions @@ -225,6 +234,7 @@ test_expect_success fdisk-gpt,sfdisk-gpt "hdimage4" " setup_test_images && run_genimage hdimage4.config test.hdimage && check_size images/test.hdimage 7356928 && + sfdisk_validate images/test.hdimage && # check the this identifier fdisk -l images/test.hdimage | grep identifier: > hdimage4.fdisk && # check partitions; filter output to handle different sfdisk versions |