summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/expected/fdisk/mbr-dos-mode158
-rwxr-xr-xtests/ts/fdisk/mbr-dos-mode33
2 files changed, 191 insertions, 0 deletions
diff --git a/tests/expected/fdisk/mbr-dos-mode b/tests/expected/fdisk/mbr-dos-mode
index 666f5c018..16de4d596 100644
--- a/tests/expected/fdisk/mbr-dos-mode
+++ b/tests/expected/fdisk/mbr-dos-mode
@@ -2,23 +2,181 @@ Initialize empty image
f1c9645dbc14efddc7d8a322685f26eb mbr-dos-mode.img
Create new DOS partition table
57e721e38d1266c2df055067c18f2cf9 mbr-dos-mode.img
+
+---layout----------
+__ts_dev__: 10 MB, 10485760 bytes, 20480 sectors
+255 heads, 63 sectors/track, 1 cylinders
+Units = cylinders of 16065 * 512 = 8225280 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / 512 bytes
+Disk identifier: 0x00000001
+
+ Device Boot Start End Blocks Id System
+-------------------
+
Create primary partition
ae4f9b12f4a768849f72ea36938c30c7 mbr-dos-mode.img
+
+---layout----------
+__ts_dev__: 10 MB, 10485760 bytes, 20480 sectors
+255 heads, 63 sectors/track, 1 cylinders
+Units = cylinders of 16065 * 512 = 8225280 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / 512 bytes
+Disk identifier: 0x00000001
+
+ Device Boot Start End Blocks Id System
+__ts_dev__1 1 1 8001 83 Linux
+-------------------
+
Set partition type
4a5dba818f9962a82a086d8b99b89a17 mbr-dos-mode.img
+
+---layout----------
+__ts_dev__: 10 MB, 10485760 bytes, 20480 sectors
+255 heads, 63 sectors/track, 1 cylinders
+Units = cylinders of 16065 * 512 = 8225280 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / 512 bytes
+Disk identifier: 0x00000001
+
+ Device Boot Start End Blocks Id System
+__ts_dev__1 1 1 8001 bf Solaris
+-------------------
+
Set primary partition active
c30e9c761b71cf95c67e758b93706ac5 mbr-dos-mode.img
+
+---layout----------
+__ts_dev__: 10 MB, 10485760 bytes, 20480 sectors
+255 heads, 63 sectors/track, 1 cylinders
+Units = cylinders of 16065 * 512 = 8225280 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / 512 bytes
+Disk identifier: 0x00000001
+
+ Device Boot Start End Blocks Id System
+__ts_dev__1 * 1 1 8001 bf Solaris
+-------------------
+
Re-create primary partition
ae4f9b12f4a768849f72ea36938c30c7 mbr-dos-mode.img
+
+---layout----------
+__ts_dev__: 10 MB, 10485760 bytes, 20480 sectors
+255 heads, 63 sectors/track, 1 cylinders
+Units = cylinders of 16065 * 512 = 8225280 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / 512 bytes
+Disk identifier: 0x00000001
+
+ Device Boot Start End Blocks Id System
+__ts_dev__1 1 1 8001 83 Linux
+-------------------
+
Create extended partition
76987a00b353687cd1dba3ddea9d66f9 mbr-dos-mode.img
+
+---layout----------
+__ts_dev__: 10 MB, 10485760 bytes, 20480 sectors
+255 heads, 63 sectors/track, 1 cylinders
+Units = cylinders of 16065 * 512 = 8225280 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / 512 bytes
+Disk identifier: 0x00000001
+
+ Device Boot Start End Blocks Id System
+__ts_dev__1 1 1 8001 83 Linux
+__ts_dev__2 2 12 88357+ 5 Extended
+-------------------
+
Create logical partitions
a1cd6708e4a6d2e5f6bc9d5c0da0cf3b mbr-dos-mode.img
+
+---layout----------
+__ts_dev__: 57 MB, 57577472 bytes, 112456 sectors
+255 heads, 63 sectors/track, 7 cylinders
+Units = cylinders of 16065 * 512 = 8225280 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / 512 bytes
+Disk identifier: 0x00000001
+
+ Device Boot Start End Blocks Id System
+__ts_dev__1 1 1 8001 83 Linux
+__ts_dev__2 2 12 88357+ 5 Extended
+__ts_dev__5 2 3 16033+ 83 Linux
+__ts_dev__6 4 5 16033+ 83 Linux
+__ts_dev__7 6 7 16033+ 83 Linux
+__ts_dev__8 8 9 16033+ 83 Linux
+-------------------
+
Delete logical partitions
4c6937d529ace5661fb82efb9394154a mbr-dos-mode.img
+
+---layout----------
+__ts_dev__: 57 MB, 57577472 bytes, 112456 sectors
+255 heads, 63 sectors/track, 7 cylinders
+Units = cylinders of 16065 * 512 = 8225280 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / 512 bytes
+Disk identifier: 0x00000001
+
+ Device Boot Start End Blocks Id System
+__ts_dev__1 1 1 8001 83 Linux
+__ts_dev__2 2 12 88357+ 5 Extended
+__ts_dev__5 6 7 16033+ 83 Linux
+-------------------
+
Create another logical partition
9589eaaed698d2402945ab3e513c1eb4 mbr-dos-mode.img
+
+---layout----------
+__ts_dev__: 57 MB, 57577472 bytes, 112456 sectors
+255 heads, 63 sectors/track, 7 cylinders
+Units = cylinders of 16065 * 512 = 8225280 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / 512 bytes
+Disk identifier: 0x00000001
+
+ Device Boot Start End Blocks Id System
+__ts_dev__1 1 1 8001 83 Linux
+__ts_dev__2 2 12 88357+ 5 Extended
+__ts_dev__5 6 7 16033+ 83 Linux
+__ts_dev__6 2 3 16033+ 83 Linux
+
+Partition table entries are not in disk order
+-------------------
+
Delete primary partition
1e6d646e5df66a2664cfbbb13fa9a08a mbr-dos-mode.img
+
+---layout----------
+__ts_dev__: 57 MB, 57577472 bytes, 112456 sectors
+255 heads, 63 sectors/track, 7 cylinders
+Units = cylinders of 16065 * 512 = 8225280 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / 512 bytes
+Disk identifier: 0x00000001
+
+ Device Boot Start End Blocks Id System
+__ts_dev__2 2 12 88357+ 5 Extended
+__ts_dev__5 6 7 16033+ 83 Linux
+__ts_dev__6 2 3 16033+ 83 Linux
+
+Partition table entries are not in disk order
+-------------------
+
Delete extended partition
fc3cdb12326656d7996b09b6f76973e7 mbr-dos-mode.img
+
+---layout----------
+__ts_dev__: 57 MB, 57577472 bytes, 112456 sectors
+255 heads, 63 sectors/track, 7 cylinders
+Units = cylinders of 16065 * 512 = 8225280 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / 512 bytes
+Disk identifier: 0x00000001
+
+ Device Boot Start End Blocks Id System
+-------------------
+
diff --git a/tests/ts/fdisk/mbr-dos-mode b/tests/ts/fdisk/mbr-dos-mode
index c2b0baa8a..8226b574b 100755
--- a/tests/ts/fdisk/mbr-dos-mode
+++ b/tests/ts/fdisk/mbr-dos-mode
@@ -37,6 +37,17 @@ FDISK_CMD_DELETE_EXTENDED="d\n2\n" # delete second primary
#set -x
+function print_layout {
+ echo -ne "\n---layout----------" >> $TS_OUTPUT
+ $TS_CMD_FDISK -c=dos -u=cylinders -l ${TEST_IMAGE_NAME} | sed 's/^.*\.img/__ts_dev__/g' >> $TS_OUTPUT 2>&1
+ echo -ne "-------------------\n\n" >> $TS_OUTPUT
+ return 1
+}
+
+#
+# Note that fdisk will enlarge the disk image (to 57MB) because the logical
+# partitions are out of the original range (10MB).
+#
ts_log "Initialize empty image"
TEST_IMAGE_NAME=$(ts_image_init 10)
ts_image_md5sum >> $TS_OUTPUT 2>&1
@@ -48,54 +59,76 @@ echo -e "${FDISK_CMD_INIT}${FDISK_CMD_CREATE_DOSLABEL}${FDISK_CMD_INIT}${FDISK_C
| $TS_CMD_FDISK -c=dos -u=cylinders ${TEST_IMAGE_NAME} &> /dev/null
ts_image_md5sum >> $TS_OUTPUT 2>&1
+print_layout
+
ts_log "Create primary partition"
echo -e "${FDISK_CMD_INIT}${FDISK_CMD_CREATE_PRIMARY}${FDISK_CMD_WRITE_CLOSE}" | \
$TS_CMD_FDISK -c=dos -u=cylinders ${TEST_IMAGE_NAME} &> /dev/null
ts_image_md5sum >> $TS_OUTPUT 2>&1
+print_layout
+
ts_log "Set partition type"
echo -e "${FDISK_CMD_INIT}${FDISK_CMD_CHANGE_PARTTYPE}${FDISK_CMD_WRITE_CLOSE}" | \
$TS_CMD_FDISK -c=dos -u=cylinders ${TEST_IMAGE_NAME} &> /dev/null
ts_image_md5sum >> $TS_OUTPUT 2>&1
+print_layout
+
ts_log "Set primary partition active"
echo -e "${FDISK_CMD_INIT}${FDISK_CMD_SET_ACTIVE}${FDISK_CMD_WRITE_CLOSE}" | \
$TS_CMD_FDISK -c=dos -u=cylinders ${TEST_IMAGE_NAME} &> /dev/null
ts_image_md5sum >> $TS_OUTPUT 2>&1
+print_layout
+
ts_log "Re-create primary partition"
echo -e "${FDISK_CMD_INIT}d\n${FDISK_CMD_CREATE_PRIMARY}${FDISK_CMD_WRITE_CLOSE}" | \
$TS_CMD_FDISK -c=dos -u=cylinders ${TEST_IMAGE_NAME} &> /dev/null
ts_image_md5sum >> $TS_OUTPUT 2>&1
+print_layout
+
ts_log "Create extended partition"
echo -e "${FDISK_CMD_INIT}${FDISK_CMD_CREATE_EXTENDED}${FDISK_CMD_WRITE_CLOSE}" | \
$TS_CMD_FDISK -c=dos -u=cylinders ${TEST_IMAGE_NAME} &> /dev/null
ts_image_md5sum >> $TS_OUTPUT 2>&1
+print_layout
+
ts_log "Create logical partitions"
echo -e "${FDISK_CMD_INIT}${FDISK_CMD_CREATE_LOGICAL}${FDISK_CMD_CREATE_LOGICAL}${FDISK_CMD_CREATE_LOGICAL}${FDISK_CMD_CREATE_LOGICAL}${FDISK_CMD_WRITE_CLOSE}" \
| $TS_CMD_FDISK -c=dos -u=cylinders ${TEST_IMAGE_NAME} &> /dev/null
ts_image_md5sum >> $TS_OUTPUT 2>&1
+print_layout
+
ts_log "Delete logical partitions"
echo -e "${FDISK_CMD_INIT}${FDISK_CMD_DELETE_LOGICALS}${FDISK_CMD_WRITE_CLOSE}" \
| $TS_CMD_FDISK -c=dos -u=cylinders ${TEST_IMAGE_NAME} &> /dev/null
ts_image_md5sum >> $TS_OUTPUT 2>&1
+print_layout
+
ts_log "Create another logical partition"
echo -e "${FDISK_CMD_INIT}${FDISK_CMD_CREATE_LOGICAL}${FDISK_CMD_WRITE_CLOSE}" \
| $TS_CMD_FDISK -c=dos -u=cylinders ${TEST_IMAGE_NAME} &> /dev/null
ts_image_md5sum >> $TS_OUTPUT 2>&1
+print_layout
+
ts_log "Delete primary partition"
echo -e "${FDISK_CMD_INIT}${FDISK_CMD_DELETE_PRIMARY}${FDISK_CMD_WRITE_CLOSE}" \
| $TS_CMD_FDISK -c=dos -u=cylinders ${TEST_IMAGE_NAME} &> /dev/null
ts_image_md5sum >> $TS_OUTPUT 2>&1
+print_layout
+
ts_log "Delete extended partition"
echo -e "${FDISK_CMD_INIT}${FDISK_CMD_DELETE_EXTENDED}${FDISK_CMD_WRITE_CLOSE}" \
| $TS_CMD_FDISK -c=dos -u=cylinders ${TEST_IMAGE_NAME} &> /dev/null
ts_image_md5sum >> $TS_OUTPUT 2>&1
+print_layout
+
ts_finalize