summaryrefslogtreecommitdiff
path: root/tests/run_cgpt_tests.sh
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@chromium.org>2012-08-24 17:52:01 -0700
committerGerrit <chrome-bot@google.com>2012-08-24 20:43:28 -0700
commitda77e6953c96f9bb52a04dc32b337066144879aa (patch)
tree4cf0e87afa0909a70ba901a737c07d2acca3f631 /tests/run_cgpt_tests.sh
parent263ffdfdd710a33a2a12ee33179f088292b2864f (diff)
downloadvboot-da77e6953c96f9bb52a04dc32b337066144879aa.tar.gz
cgpt: Fix error in modifying size of an existing partition
Modifying the size of an existing partition without modifying the start as well assumed the start was at block 0. Sometimes it was caught, often it wasn't. Fix the error, add a test to catch the problem. BUG=chrome-os-partner:13090 BRANCH=all TEST=manual make && make runtests Change-Id: I4f5a5031a90a3e78d886ed3573f61305316a3f1f Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/31418 Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'tests/run_cgpt_tests.sh')
-rwxr-xr-xtests/run_cgpt_tests.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/run_cgpt_tests.sh b/tests/run_cgpt_tests.sh
index 97f540ce..445070a4 100755
--- a/tests/run_cgpt_tests.sh
+++ b/tests/run_cgpt_tests.sh
@@ -105,6 +105,31 @@ Y=$($CGPT show -s -i $RANDOM_NUM ${DEV})
[ "$X $Y" = "$RANDOM_START $RANDOM_SIZE" ] || error
+echo "Change the beginning..."
+DATA_START=$((DATA_START + 10))
+$CGPT add -i 1 -b ${DATA_START} ${DEV} || error
+X=$($CGPT show -b -i 1 ${DEV})
+[ "$X" = "$DATA_START" ] || error
+
+echo "Change the size..."
+DATA_SIZE=$((DATA_SIZE + 10))
+$CGPT add -i 1 -s ${DATA_SIZE} ${DEV} || error
+X=$($CGPT show -s -i 1 ${DEV})
+[ "$X" = "$DATA_SIZE" ] || error
+
+echo "Change the type..."
+$CGPT add -i 1 -t reserved ${DEV} || error
+X=$($CGPT show -t -i 1 ${DEV} | tr 'A-Z' 'a-z')
+[ "$X" = "$FUTURE_GUID" ] || error
+# arbitrary value
+$CGPT add -i 1 -t 610a563a-a55c-4ae0-ab07-86e5bb9db67f ${DEV} || error
+X=$($CGPT show -t -i 1 ${DEV})
+[ "$X" = "610A563A-A55C-4AE0-AB07-86E5BB9DB67F" ] || error
+$CGPT add -i 1 -t data ${DEV} || error
+X=$($CGPT show -t -i 1 ${DEV} | tr 'A-Z' 'a-z')
+[ "$X" = "$DATA_GUID" ] || error
+
+
echo "Set the boot partition.."
$CGPT boot -i ${KERN_NUM} ${DEV} >/dev/null