|
|
93a10f |
From a95ff5ed155c29734824f3a79350678901b22e43 Mon Sep 17 00:00:00 2001
|
|
|
93a10f |
From: Karel Zak <kzak@redhat.com>
|
|
|
93a10f |
Date: Thu, 11 Feb 2021 12:44:44 +0100
|
|
|
93a10f |
Subject: tests: don't reply on scsi_debug partitions
|
|
|
93a10f |
|
|
|
93a10f |
The disk layout as created by scsi_debug depends on kernel version.
|
|
|
93a10f |
Let's make the partition sizes hardcoded in our tests than rely on
|
|
|
93a10f |
kernel.
|
|
|
93a10f |
|
|
|
93a10f |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
93a10f |
Upstream: http://github.com/util-linux/util-linux/commit/15a37d00e5e59f0f628d0a6b6cd2f9636702fd7c
|
|
|
93a10f |
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2142496
|
|
|
93a10f |
---
|
|
|
93a10f |
tests/expected/partx/partx-detect-parts | 6 +++---
|
|
|
93a10f |
tests/ts/partx/partx | 14 +++++++++++---
|
|
|
93a10f |
2 files changed, 14 insertions(+), 6 deletions(-)
|
|
|
93a10f |
|
|
|
93a10f |
diff --git a/tests/expected/partx/partx-detect-parts b/tests/expected/partx/partx-detect-parts
|
|
|
93a10f |
index 33d42a58c..0adc85577 100644
|
|
|
93a10f |
--- a/tests/expected/partx/partx-detect-parts
|
|
|
93a10f |
+++ b/tests/expected/partx/partx-detect-parts
|
|
|
93a10f |
@@ -1,5 +1,5 @@
|
|
|
93a10f |
NR START END SECTORS SIZE NAME UUID
|
|
|
93a10f |
- 1 32 33791 33760 16.5M
|
|
|
93a10f |
- 2 33792 67583 33792 16.5M
|
|
|
93a10f |
- 3 67584 102399 34816 17M
|
|
|
93a10f |
+ 1 32 33791 33760 16.5M 1ddc8a79-01
|
|
|
93a10f |
+ 2 33792 67583 33792 16.5M 1ddc8a79-02
|
|
|
93a10f |
+ 3 67584 102399 34816 17M 1ddc8a79-03
|
|
|
93a10f |
OK
|
|
|
93a10f |
diff --git a/tests/ts/partx/partx b/tests/ts/partx/partx
|
|
|
93a10f |
index 84c286a94..6514ae62c 100755
|
|
|
93a10f |
--- a/tests/ts/partx/partx
|
|
|
93a10f |
+++ b/tests/ts/partx/partx
|
|
|
93a10f |
@@ -26,6 +26,7 @@ ts_init "$*"
|
|
|
93a10f |
ts_check_test_command "$TS_CMD_PARTX"
|
|
|
93a10f |
ts_check_test_command "$TS_CMD_ADDPART"
|
|
|
93a10f |
ts_check_test_command "$TS_CMD_DELPART"
|
|
|
93a10f |
+ts_check_test_command "$TS_CMD_SFDISK"
|
|
|
93a10f |
|
|
|
93a10f |
ts_skip_nonroot
|
|
|
93a10f |
|
|
|
93a10f |
@@ -70,10 +71,17 @@ ts_init_subtest "delpart"
|
|
|
93a10f |
} >$TS_OUTPUT 2>&1
|
|
|
93a10f |
ts_finalize_subtest
|
|
|
93a10f |
|
|
|
93a10f |
-ts_scsi_debug_rmmod
|
|
|
93a10f |
|
|
|
93a10f |
-# set global variable TS_DEVICE
|
|
|
93a10f |
-ts_scsi_debug_init dev_size_mb=50 num_parts=$PARTS
|
|
|
93a10f |
+udevadm settle
|
|
|
93a10f |
+$TS_CMD_SFDISK $TS_DEVICE &> /dev/null <
|
|
|
93a10f |
+label: dos
|
|
|
93a10f |
+label-id: 0x1ddc8a79
|
|
|
93a10f |
+32,33760,,
|
|
|
93a10f |
+33792,33792,,
|
|
|
93a10f |
+67584,34816,,
|
|
|
93a10f |
+EOF
|
|
|
93a10f |
+udevadm settle
|
|
|
93a10f |
+
|
|
|
93a10f |
|
|
|
93a10f |
ts_init_subtest "detect-parts"
|
|
|
93a10f |
{
|
|
|
93a10f |
--
|
|
|
93a10f |
2.39.1
|
|
|
93a10f |
|