]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: sfdisk fill correctly gaps if default start requested
authorKarel Zak <kzak@redhat.com>
Fri, 22 May 2020 09:30:27 +0000 (11:30 +0200)
committerKarel Zak <kzak@redhat.com>
Fri, 22 May 2020 09:30:27 +0000 (11:30 +0200)
References: 83fdb880b953164fec7cc603c4ece11cb78762db
Addresses: https://github.com/karelzak/util-linux/issues/1044
Signed-off-by: Karel Zak <kzak@redhat.com>
tests/expected/sfdisk/dos-default-vs-gap1 [new file with mode: 0644]
tests/expected/sfdisk/dos-default-vs-gap2 [new file with mode: 0644]
tests/ts/sfdisk/dos

diff --git a/tests/expected/sfdisk/dos-default-vs-gap1 b/tests/expected/sfdisk/dos-default-vs-gap1
new file mode 100644 (file)
index 0000000..9539d22
--- /dev/null
@@ -0,0 +1,24 @@
+Checking that no-one is using this disk right now ... OK
+
+Disk <removed>: 50 MiB, 52428800 bytes, 102400 sectors
+Disk model: scsi_debug      
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 4096 bytes
+I/O size (minimum/optimal): 4096 bytes / <removed> bytes
+
+>>> Created a new disklabel.
+<removed>1: Created a new partition <removed>.
+<removed>2: Created a new partition <removed>.
+<removed>3: Done.
+
+New situation:
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device     Boot Start   End Sectors Size Id Type
+<removed>1        6144 16383   10240   5M 83 Linux
+<removed>2       16384 28671   12288   6M 83 Linux
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
diff --git a/tests/expected/sfdisk/dos-default-vs-gap2 b/tests/expected/sfdisk/dos-default-vs-gap2
new file mode 100644 (file)
index 0000000..e76f704
--- /dev/null
@@ -0,0 +1,30 @@
+Checking that no-one is using this disk right now ... OK
+
+Disk <removed>: 50 MiB, 52428800 bytes, 102400 sectors
+Disk model: scsi_debug      
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 4096 bytes
+I/O size (minimum/optimal): 4096 bytes / <removed> bytes
+
+>>> Created a new disklabel.
+<removed>1: Created a new partition <removed>.
+<removed>2: Created a new partition <removed>.
+<removed>3: Created a new partition <removed>.
+<removed>4: Created a new partition <removed>.
+All partitions used.
+
+New situation:
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device     Boot Start   End Sectors Size Id Type
+<removed>1        8192 14335    6144   3M 83 Linux
+<removed>2       26624 36863   10240   5M 83 Linux
+<removed>3       14336 22527    8192   4M 83 Linux
+<removed>4        2048  6143    4096   2M 83 Linux
+
+Partition table entries are not in disk order.
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
index 6887c47cb68ffde727ab54fe02764bcc675fdc95..a2fd728859afd89320b5f772e930cb8923b6ab71 100755 (executable)
@@ -232,4 +232,32 @@ ts_fdisk_clean $TS_DEVICE
 udevadm settle
 ts_finalize_subtest
 
+
+ts_init_subtest "default-vs-gap1"
+$TS_CMD_WIPEFS -a ${TS_DEVICE} &> /dev/null
+udevadm settle
+$TS_CMD_SFDISK ${TS_DEVICE} >> $TS_OUTPUT 2>> $TS_ERRLOG <<EOF
+3MiB 5MiB L
+- 6MiB L
+EOF
+ts_fdisk_clean $TS_DEVICE
+udevadm settle
+ts_finalize_subtest
+
+
+ts_init_subtest "default-vs-gap2"
+$TS_CMD_WIPEFS -a ${TS_DEVICE} &> /dev/null
+udevadm settle
+$TS_CMD_SFDISK ${TS_DEVICE} >> $TS_OUTPUT 2>> $TS_ERRLOG <<EOF
+4MiB 3MiB L
+13MiB 5MiB L
+- 4MiB L
+- 2MiB L
+- - L
+EOF
+ts_fdisk_clean $TS_DEVICE
+udevadm settle
+ts_finalize_subtest
+
+
 ts_finalize