summaryrefslogtreecommitdiffstats
path: root/tests/ts/fdisk/doslabel
diff options
context:
space:
mode:
authorZdenek Behan2009-08-03 03:46:27 +0200
committerKarel Zak2009-08-17 12:25:05 +0200
commit28290b756d5409efcab56d863780b9ce52ea4592 (patch)
tree82ba76edf8ae2a98aece7beacf7e1d2c6e241cf1 /tests/ts/fdisk/doslabel
parentfsck.8: formatting (diff)
downloadkernel-qcow2-util-linux-28290b756d5409efcab56d863780b9ce52ea4592.tar.gz
kernel-qcow2-util-linux-28290b756d5409efcab56d863780b9ce52ea4592.tar.xz
kernel-qcow2-util-linux-28290b756d5409efcab56d863780b9ce52ea4592.zip
tests: fdisk doslabel test also checks changing partition type
* Changed apostrophes around test commands to quotes, this makes vim syntax highlighting more happy, and makes the newlines stand out. * Added check for changing partition type. After the change is done and checked, the partition is deleted and re-created to not mess with the other md5's already in place... Signed-off-by: Zdenek Behan <rain@matfyz.cz>
Diffstat (limited to 'tests/ts/fdisk/doslabel')
-rwxr-xr-xtests/ts/fdisk/doslabel29
1 files changed, 20 insertions, 9 deletions
diff --git a/tests/ts/fdisk/doslabel b/tests/ts/fdisk/doslabel
index a7ea576dc..5aba4927e 100755
--- a/tests/ts/fdisk/doslabel
+++ b/tests/ts/fdisk/doslabel
@@ -21,15 +21,16 @@ TS_DESC="doslabel tests"
ts_init "$*"
# cmd to change number of cylinders to 1024 and changes system id to 0x1
-FDISK_CMD_INIT='x\nc\n1024\ni\n0x1\nr\n'
-FDISK_CMD_WRITE_CLOSE='w\nq\n'
-FDISK_CMD_CREATE_DOSLABEL='o\n' #create dos label
-FDISK_CMD_CREATE_PRIMARY='n\np\n1\n\n+1M\n' # create primary partition 1 of size 1MB
-FDISK_CMD_CREATE_EXTENDED='n\ne\n2\n\n+10\n' # create extended partition 2 of size 11 cylinders
-FDISK_CMD_CREATE_LOGICAL='n\nl\n\n+1\n' # create next logical partition of size 2 cyl
-FDISK_CMD_DELETE_LOGICALS='d\n6\nd\n5\nd\n6\d5\n' # delete middle, head, tail, last partitions
-FDISK_CMD_DELETE_PRIMARY='d\n1\n' # delete first primary
-FDISK_CMD_DELETE_EXTENDED='d\n2\n' # delete second primary
+FDISK_CMD_INIT="x\nc\n1024\ni\n0x1\nr\n"
+FDISK_CMD_WRITE_CLOSE="w\nq\n"
+FDISK_CMD_CREATE_DOSLABEL="o\n" #create dos label
+FDISK_CMD_CREATE_PRIMARY="n\np\n1\n\n+1M\n" # create primary partition 1 of size 1MB
+FDISK_CMD_CHANGE_PARTTYPE="t\nbf\n" # change partition type to "bf - solaris", this requires that there is only one partition to change
+FDISK_CMD_CREATE_EXTENDED="n\ne\n2\n\n+10\n" # create extended partition 2 of size 11 cylinders
+FDISK_CMD_CREATE_LOGICAL="n\nl\n\n+1\n" # create next logical partition of size 2 cyl
+FDISK_CMD_DELETE_LOGICALS="d\n6\nd\n5\nd\n6\d5\n" # delete middle, head, tail, last partitions
+FDISK_CMD_DELETE_PRIMARY="d\n1\n" # delete first primary
+FDISK_CMD_DELETE_EXTENDED="d\n2\n" # delete second primary
#set -x
@@ -49,6 +50,16 @@ echo -e "${FDISK_CMD_INIT}${FDISK_CMD_CREATE_PRIMARY}${FDISK_CMD_WRITE_CLOSE}" |
$TS_CMD_FDISK ${TEST_IMAGE_NAME} &> /dev/null
ts_image_md5sum 2>&1 >> $TS_OUTPUT
+ts_log "Set partition type"
+echo -e "${FDISK_CMD_INIT}${FDISK_CMD_CHANGE_PARTTYPE}${FDISK_CMD_WRITE_CLOSE}" | \
+ $TS_CMD_FDISK ${TEST_IMAGE_NAME} &> /dev/null
+ts_image_md5sum 2>&1 >> $TS_OUTPUT
+
+ts_log "Re-create primary partition"
+echo -e "${FDISK_CMD_INIT}d\n${FDISK_CMD_CREATE_PRIMARY}${FDISK_CMD_WRITE_CLOSE}" | \
+ $TS_CMD_FDISK ${TEST_IMAGE_NAME} &> /dev/null
+ts_image_md5sum 2>&1 >> $TS_OUTPUT
+
ts_log "Create extended partition"
echo -e "${FDISK_CMD_INIT}${FDISK_CMD_CREATE_EXTENDED}${FDISK_CMD_WRITE_CLOSE}" | \
$TS_CMD_FDISK ${TEST_IMAGE_NAME} &> /dev/null