--- /dev/null
+Checking that no-one is using this disk right now ... OK
+
+Disk <removed>: 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 <removed>.
+Created a new <removed>.
+<removed>2: Ignoring partition.
+<removed>3: Created a new <removed>.
+<removed>4: Ignoring partition.
+All partitions used.
+
+New situation:
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 * 2048 52046 49999 24.4M 83 Linux
+<removed>3 52048 102046 49999 24.4M 83 Linux
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
--- /dev/null
+Checking that no-one is using this disk right now ... OK
+
+Disk <removed>: 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 <removed>.
+Created a new <removed>.
+<removed>2: Ignoring partition.
+<removed>3: Ignoring partition.
+<removed>4: Ignoring partition.
+All partitions used.
+
+New situation:
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 * 2048 52046 49999 24.4M 83 Linux
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
. $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
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
--- /dev/null
+# 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
--- /dev/null
+# 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
. $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