]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: don't reply on scsi_debug partitions
authorKarel Zak <kzak@redhat.com>
Thu, 11 Feb 2021 11:44:44 +0000 (12:44 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 11 Feb 2021 11:44:44 +0000 (12:44 +0100)
The disk layout as created by scsi_debug depends on kernel version.
Let's make the partition sizes hardcoded in our tests than rely on
kernel.

Signed-off-by: Karel Zak <kzak@redhat.com>
tests/expected/partx/partx-detect-parts
tests/ts/partx/partx

index 33d42a58c74f8b37a3c019f8167747de5a00aed0..0adc8557718861d76d06c7e5eab442564cf5dd6a 100644 (file)
@@ -1,5 +1,5 @@
 NR START    END SECTORS  SIZE NAME UUID
- 1    32  33791   33760 16.5M      
- 2 33792  67583   33792 16.5M      
- 3 67584 102399   34816   17M      
+ 1    32  33791   33760 16.5M      1ddc8a79-01
+ 2 33792  67583   33792 16.5M      1ddc8a79-02
+ 3 67584 102399   34816   17M      1ddc8a79-03
 OK
index 67f35f5469265b1063ab036a49718a789b6f3377..3925d1b3f379f4e737673c6fe534403b58941fb9 100755 (executable)
@@ -26,6 +26,7 @@ ts_init "$*"
 ts_check_test_command "$TS_CMD_PARTX"
 ts_check_test_command "$TS_CMD_ADDPART"
 ts_check_test_command "$TS_CMD_DELPART"
+ts_check_test_command "$TS_CMD_SFDISK"
 
 ts_skip_nonroot
 
@@ -70,10 +71,17 @@ ts_init_subtest "delpart"
 } >> $TS_OUTPUT 2>> $TS_ERRLOG
 ts_finalize_subtest
 
-ts_scsi_debug_rmmod
 
-# set global variable TS_DEVICE
-ts_scsi_debug_init dev_size_mb=50 num_parts=$PARTS
+udevadm settle
+$TS_CMD_SFDISK $TS_DEVICE &> /dev/null <<EOF
+label: dos
+label-id: 0x1ddc8a79
+32,33760,,
+33792,33792,,
+67584,34816,,
+EOF
+udevadm settle
+
 
 ts_init_subtest "detect-parts"
 {