From a5445cd2e5e1f942384d4fbb4aa66eb7a46df311 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 9 Feb 2010 16:24:51 +0100 Subject: [PATCH] tests: fix and update old fdisk tests Signed-off-by: Karel Zak --- tests/expected/fdisk/oddinput | 1 + tests/ts/fdisk/doslabel | 24 ++++++++++++------------ tests/ts/fdisk/oddinput | 2 +- tests/ts/fdisk/sunlabel | 16 ++++++++-------- 4 files changed, 22 insertions(+), 21 deletions(-) diff --git a/tests/expected/fdisk/oddinput b/tests/expected/fdisk/oddinput index f1bfda55..e05713c6 100644 --- a/tests/expected/fdisk/oddinput +++ b/tests/expected/fdisk/oddinput @@ -7,6 +7,7 @@ Disk testimage: 0 MB, 0 bytes 255 heads, 63 sectors/track, 0 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: 0x00000000 Nonexistant file diff --git a/tests/ts/fdisk/doslabel b/tests/ts/fdisk/doslabel index a7c259ea..762cdaac 100755 --- a/tests/ts/fdisk/doslabel +++ b/tests/ts/fdisk/doslabel @@ -37,63 +37,63 @@ FDISK_CMD_DELETE_EXTENDED="d\n2\n" # delete second primary ts_log "Initialize empty image" TEST_IMAGE_NAME=$(ts_image_init 10) -ts_image_md5sum 2>&1 >> $TS_OUTPUT +ts_image_md5sum >> $TS_OUTPUT 2>&1 # need to run init twice, to change system ID after new label, otherwise system # ID will be random and will screw up md5's ts_log "Create new DOS partition table" echo -e "${FDISK_CMD_INIT}${FDISK_CMD_CREATE_DOSLABEL}${FDISK_CMD_INIT}${FDISK_CMD_WRITE_CLOSE}" \ | $TS_CMD_FDISK ${TEST_IMAGE_NAME} &> /dev/null -ts_image_md5sum 2>&1 >> $TS_OUTPUT +ts_image_md5sum >> $TS_OUTPUT 2>&1 ts_log "Create primary partition" 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_image_md5sum >> $TS_OUTPUT 2>&1 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_image_md5sum >> $TS_OUTPUT 2>&1 ts_log "Set primary partition active" echo -e "${FDISK_CMD_INIT}${FDISK_CMD_SET_ACTIVE}${FDISK_CMD_WRITE_CLOSE}" | \ $TS_CMD_FDISK ${TEST_IMAGE_NAME} &> /dev/null -ts_image_md5sum 2>&1 >> $TS_OUTPUT +ts_image_md5sum >> $TS_OUTPUT 2>&1 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_image_md5sum >> $TS_OUTPUT 2>&1 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 -ts_image_md5sum 2>&1 >> $TS_OUTPUT +ts_image_md5sum >> $TS_OUTPUT 2>&1 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 ${TEST_IMAGE_NAME} &> /dev/null -ts_image_md5sum 2>&1 >> $TS_OUTPUT +ts_image_md5sum >> $TS_OUTPUT 2>&1 ts_log "Delete logical partitions" echo -e "${FDISK_CMD_INIT}${FDISK_CMD_DELETE_LOGICALS}${FDISK_CMD_WRITE_CLOSE}" \ | $TS_CMD_FDISK ${TEST_IMAGE_NAME} &> /dev/null -ts_image_md5sum 2>&1 >> $TS_OUTPUT +ts_image_md5sum >> $TS_OUTPUT 2>&1 ts_log "Create another logical partition" echo -e "${FDISK_CMD_INIT}${FDISK_CMD_CREATE_LOGICAL}${FDISK_CMD_WRITE_CLOSE}" \ | $TS_CMD_FDISK ${TEST_IMAGE_NAME} &> /dev/null -ts_image_md5sum 2>&1 >> $TS_OUTPUT +ts_image_md5sum >> $TS_OUTPUT 2>&1 ts_log "Delete primary partition" echo -e "${FDISK_CMD_INIT}${FDISK_CMD_DELETE_PRIMARY}${FDISK_CMD_WRITE_CLOSE}" \ | $TS_CMD_FDISK ${TEST_IMAGE_NAME} &> /dev/null -ts_image_md5sum 2>&1 >> $TS_OUTPUT +ts_image_md5sum >> $TS_OUTPUT 2>&1 ts_log "Delete extended partition" echo -e "${FDISK_CMD_INIT}${FDISK_CMD_DELETE_EXTENDED}${FDISK_CMD_WRITE_CLOSE}" \ | $TS_CMD_FDISK ${TEST_IMAGE_NAME} &> /dev/null -ts_image_md5sum 2>&1 >> $TS_OUTPUT +ts_image_md5sum >> $TS_OUTPUT 2>&1 ts_finalize diff --git a/tests/ts/fdisk/oddinput b/tests/ts/fdisk/oddinput index c8698416..9d5c4762 100755 --- a/tests/ts/fdisk/oddinput +++ b/tests/ts/fdisk/oddinput @@ -24,7 +24,7 @@ ts_init "$*" ts_log "Initialize empty image" TEST_IMAGE_NAME=$(ts_image_init 10) -ts_image_md5sum 2>&1 >> $TS_OUTPUT +ts_image_md5sum >> $TS_OUTPUT 2>&1 ts_log "Empty image listing" # this should report empty partition table # TEST_IMAGE_NAME has absolute path, and is by definition different on each computer, we need to sed it away diff --git a/tests/ts/fdisk/sunlabel b/tests/ts/fdisk/sunlabel index 9c2b0188..6bf7e0ed 100755 --- a/tests/ts/fdisk/sunlabel +++ b/tests/ts/fdisk/sunlabel @@ -34,41 +34,41 @@ FDISK_CMD_CREATE_SECONDARY="n\n2\n128\n\n" # create secondary partition cylinder ts_log "Initialize empty image" TEST_IMAGE_NAME=$(ts_image_init 10) -ts_image_md5sum 2>&1 >> $TS_OUTPUT +ts_image_md5sum >> $TS_OUTPUT 2>&1 ts_log "Create new SUN partition table" echo -e "${FDISK_CMD_INIT}${FDISK_CMD_DELETEALL}${FDISK_CMD_WRITE_CLOSE}" \ | $TS_CMD_FDISK ${TEST_IMAGE_NAME} &> /dev/null -ts_image_md5sum 2>&1 >> $TS_OUTPUT +ts_image_md5sum >> $TS_OUTPUT 2>&1 ts_log "Create first partition" echo -e "${FDISK_CMD_CREATE_PRIMARY}${FDISK_CMD_WRITE_CLOSE}" | \ $TS_CMD_FDISK ${TEST_IMAGE_NAME} &> /dev/null -ts_image_md5sum 2>&1 >> $TS_OUTPUT +ts_image_md5sum >> $TS_OUTPUT 2>&1 ts_log "Set partition sysid" echo -e "${FDISK_CMD_CHANGE_SYSID}${FDISK_CMD_WRITE_CLOSE}" | \ $TS_CMD_FDISK ${TEST_IMAGE_NAME} &> /dev/null -ts_image_md5sum 2>&1 >> $TS_OUTPUT +ts_image_md5sum >> $TS_OUTPUT 2>&1 ts_log "Set first partition readonly" echo -e "${FDISK_CMD_TOGGLE_READONLY}${FDISK_CMD_WRITE_CLOSE}" | \ $TS_CMD_FDISK ${TEST_IMAGE_NAME} &> /dev/null -ts_image_md5sum 2>&1 >> $TS_OUTPUT +ts_image_md5sum >> $TS_OUTPUT 2>&1 ts_log "Set first partition mountable" echo -e "${FDISK_CMD_TOGGLE_MOUNTABLE}${FDISK_CMD_WRITE_CLOSE}" | \ $TS_CMD_FDISK ${TEST_IMAGE_NAME} &> /dev/null -ts_image_md5sum 2>&1 >> $TS_OUTPUT +ts_image_md5sum >> $TS_OUTPUT 2>&1 ts_log "Create second partition" echo -e "${FDISK_CMD_CREATE_SECONDARY}${FDISK_CMD_WRITE_CLOSE}" | \ $TS_CMD_FDISK ${TEST_IMAGE_NAME} &> /dev/null -ts_image_md5sum 2>&1 >> $TS_OUTPUT +ts_image_md5sum >> $TS_OUTPUT 2>&1 ts_log "Delete all partitions" echo -e "${FDISK_CMD_DELETEALL}${FDISK_CMD_WRITE_CLOSE}" | \ $TS_CMD_FDISK ${TEST_IMAGE_NAME} &> /dev/null -ts_image_md5sum 2>&1 >> $TS_OUTPUT +ts_image_md5sum >> $TS_OUTPUT 2>&1 ts_finalize -- 2.39.5