From: Karel Zak Date: Thu, 16 Apr 2015 16:01:32 +0000 (+0200) Subject: tests: add old dump for sfdisk X-Git-Tag: v2.27-rc1~263 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2daf61b734f00e69da576844258d3cc437359604;p=thirdparty%2Futil-linux.git tests: add old dump for sfdisk Signed-off-by: Karel Zak --- diff --git a/tests/expected/sfdisk/dos-dump-gaps b/tests/expected/sfdisk/dos-dump-gaps new file mode 100644 index 0000000000..85870301ae --- /dev/null +++ b/tests/expected/sfdisk/dos-dump-gaps @@ -0,0 +1,24 @@ +Checking that no-one is using this disk right now ... OK + +Disk : 50 MiB, 52428800 bytes, 102400 sectors +Units: sectors of 1 * 512 = 512 bytes +Sector size (logical/physical): 512 bytes / 4096 bytes +I/O size (minimum/optimal): 4096 bytes / 32768 bytes + +>>> Script header accepted. +>>> Created a new . +Created a new . +2: Ignoring partition. +3: Created a new . +4: Ignoring partition. +All partitions used. + +New situation: + +Device Boot Start End Sectors Size Id Type +1 * 2048 52046 49999 24.4M 83 Linux +3 52048 102046 49999 24.4M 83 Linux + +The partition table has been altered. +Calling ioctl() to re-read partition table. +Syncing disks. diff --git a/tests/expected/sfdisk/dos-dump-old b/tests/expected/sfdisk/dos-dump-old new file mode 100644 index 0000000000..e6835f9b36 --- /dev/null +++ b/tests/expected/sfdisk/dos-dump-old @@ -0,0 +1,23 @@ +Checking that no-one is using this disk right now ... OK + +Disk : 50 MiB, 52428800 bytes, 102400 sectors +Units: sectors of 1 * 512 = 512 bytes +Sector size (logical/physical): 512 bytes / 4096 bytes +I/O size (minimum/optimal): 4096 bytes / 32768 bytes + +>>> Script header accepted. +>>> Created a new . +Created a new . +2: Ignoring partition. +3: Ignoring partition. +4: Ignoring partition. +All partitions used. + +New situation: + +Device Boot Start End Sectors Size Id Type +1 * 2048 52046 49999 24.4M 83 Linux + +The partition table has been altered. +Calling ioctl() to re-read partition table. +Syncing disks. diff --git a/tests/ts/sfdisk/dos b/tests/ts/sfdisk/dos index 8277ddcfac..467e540f48 100755 --- a/tests/ts/sfdisk/dos +++ b/tests/ts/sfdisk/dos @@ -21,7 +21,7 @@ TS_DESC="MBR" . $TS_TOPDIR/functions.sh ts_init "$*" -ts_check_test_command "$TS_CMD_FDISK" +ts_check_test_command "$TS_CMD_SFDISK" ts_check_test_command "$TS_CMD_WIPEFS" ts_skip_nonroot @@ -125,5 +125,25 @@ udevadm settle ts_finalize_subtest +ts_init_subtest "dump-old" +$TS_CMD_WIPEFS -a ${TS_DEVICE} &> /dev/null +udevadm settle +$TS_CMD_SFDISK ${TS_DEVICE} < $TS_SELF/files/dump-old >> $TS_OUTPUT 2>&1 +udevadm settle +ts_fdisk_clean $TS_DEVICE +udevadm settle +ts_finalize_subtest + + +ts_init_subtest "dump-gaps" +$TS_CMD_WIPEFS -a ${TS_DEVICE} &> /dev/null +udevadm settle +$TS_CMD_SFDISK ${TS_DEVICE} < $TS_SELF/files/dump-gaps >> $TS_OUTPUT 2>&1 +udevadm settle +ts_fdisk_clean $TS_DEVICE +udevadm settle +ts_finalize_subtest + + rmmod scsi_debug ts_finalize diff --git a/tests/ts/sfdisk/files/dump-gaps b/tests/ts/sfdisk/files/dump-gaps new file mode 100644 index 0000000000..3aff9cadcd --- /dev/null +++ b/tests/ts/sfdisk/files/dump-gaps @@ -0,0 +1,7 @@ +# partition table of /dev/sdc +unit: sectors + +/dev/sdc1 : start= 2048, size= 49999, Id=83, bootable +/dev/sdc2 : start= 0, size= 0, Id= 0 +/dev/sdc3 : start= 52048, size= 49999, Id=83 +/dev/sdc4 : start= 0, size= 0, Id= 0 diff --git a/tests/ts/sfdisk/files/dump-old b/tests/ts/sfdisk/files/dump-old new file mode 100644 index 0000000000..7708e5ec90 --- /dev/null +++ b/tests/ts/sfdisk/files/dump-old @@ -0,0 +1,7 @@ +# partition table of /dev/sdc +unit: sectors + +/dev/sdc1 : start= 2048, size= 49999, Id=83, bootable +/dev/sdc2 : start= 0, size= 0, Id= 0 +/dev/sdc3 : start= 0, size= 0, Id= 0 +/dev/sdc4 : start= 0, size= 0, Id= 0 diff --git a/tests/ts/sfdisk/gpt b/tests/ts/sfdisk/gpt index 252691f46a..de1184c944 100755 --- a/tests/ts/sfdisk/gpt +++ b/tests/ts/sfdisk/gpt @@ -21,7 +21,7 @@ TS_DESC="GPT" . $TS_TOPDIR/functions.sh ts_init "$*" -ts_check_test_command "$TS_CMD_FDISK" +ts_check_test_command "$TS_CMD_SFDISK" ts_check_test_command "$TS_CMD_WIPEFS" ts_skip_nonroot