tests: sfdisk fill correctly gaps if default start requested

References: 83fdb880b9
Addresses: https://github.com/karelzak/util-linux/issues/1044
Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2020-05-22 11:30:27 +02:00
parent a2db2fd660
commit fd3a8fda9a
3 changed files with 82 additions and 0 deletions

View File

@ -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.

View File

@ -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.

View File

@ -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