From 28809faae4da171e2a2472817e516cef5e850d24 Mon Sep 17 00:00:00 2001 From: Guillaume Delacour Date: Mon, 29 Jun 2015 21:21:17 +0000 Subject: [PATCH 1/3] Redirect dd output stderr and fails some Debian tests (DEP8 look at stderr lines) --- gdisk_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdisk_test.sh b/gdisk_test.sh index 86c36fc..3cc60ff 100755 --- a/gdisk_test.sh +++ b/gdisk_test.sh @@ -354,7 +354,7 @@ EOF ################################### # create a file to simulate a real device -dd if=/dev/zero of=$TEMP_DISK bs=1024 count=$TEMP_DISK_SIZE +dd if=/dev/zero of=$TEMP_DISK bs=1024 count=$TEMP_DISK_SIZE > /dev/null 2>&1 if [ -s $TEMP_DISK ] then From 00cce4dbb310bc09c2dc952a05b3daf502260977 Mon Sep 17 00:00:00 2001 From: Guillaume Delacour Date: Mon, 29 Jun 2015 21:27:09 +0000 Subject: [PATCH 2/3] new target test the call gdisk_test.sh script --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index 1ae018e..8c8f9fd 100644 --- a/Makefile +++ b/Makefile @@ -28,6 +28,9 @@ sgdisk: $(LIB_OBJS) sgdisk.o gptcl.o fixparts: $(MBR_LIB_OBJS) fixparts.o $(CXX) $(MBR_LIB_OBJS) fixparts.o $(LDFLAGS) -o fixparts +test: + ./gdisk_test.sh + lint: #no pre-reqs lint $(SRCS) From f8f4ea6ad3ad12a6d41fd4e6c3ec44c4eeb65f3d Mon Sep 17 00:00:00 2001 From: Guillaume Delacour Date: Mon, 29 Jun 2015 21:33:19 +0000 Subject: [PATCH 3/3] Test return code of successful empty partition table creation --- gdisk_test.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/gdisk_test.sh b/gdisk_test.sh index 3cc60ff..25e2651 100755 --- a/gdisk_test.sh +++ b/gdisk_test.sh @@ -115,9 +115,23 @@ Y w Y EOF + + ret=$? + if [ $ret -ne 0 ] + then + pretty_print "FAILED" "gdisk return $ret when creating partition table" + exit 1 + fi ;; sgdisk) $SGDISK_BIN $TEMP_DISK -${OPT_CLEAR} + + ret=$? + if [ $ret -ne 0 ] + then + pretty_print "FAILED" "sgdisk return $ret when creating partition table" + exit 1 + fi ;; esac