- tests/t3000: Use mkfs.hfsplus and fsck.hfsplus for resize tests (bcl)

- tests/t3000: Check for hfs and vfat support separately (bcl)
- tests: Reduce memory usage for tests using scsi_debug module (bcl)
- spec: Install to /usr/sbin and /usr/lib64 (bcl)
This commit is contained in:
Brian C. Lane 2021-08-03 15:43:24 -07:00
parent 1a6875dda1
commit ce8126ec00
10 changed files with 391 additions and 3 deletions

View File

@ -0,0 +1,41 @@
From 4a053e111beacbeabeddc20c71d0215aedf219fb Mon Sep 17 00:00:00 2001
From: "Brian C. Lane" <bcl@redhat.com>
Date: Mon, 12 Jul 2021 15:26:36 -0700
Subject: [PATCH 16/24] tests/t1100: Change dev_size_mb to 10
This is backed by memory, so using more than is needed limits the size
of the system it can run on.
---
tests/t1100-busy-label.sh | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tests/t1100-busy-label.sh b/tests/t1100-busy-label.sh
index f1a13df..71b847c 100755
--- a/tests/t1100-busy-label.sh
+++ b/tests/t1100-busy-label.sh
@@ -21,11 +21,11 @@ require_root_
require_scsi_debug_module_
ss=$sector_size_
-scsi_debug_setup_ sector_size=$ss dev_size_mb=90 > dev-name ||
+scsi_debug_setup_ sector_size=$ss dev_size_mb=10 > dev-name ||
skip_ 'failed to create scsi_debug device'
dev=$(cat dev-name)
-parted -s "$dev" mklabel msdos mkpart primary fat32 1 40 > out 2>&1 || fail=1
+parted -s "$dev" mklabel msdos mkpart primary fat32 1 4 > out 2>&1 || fail=1
compare /dev/null out || fail=1
wait_for_dev_to_appear_ ${dev}1 || fail=1
mkfs.vfat ${dev}1 || fail=1
@@ -48,7 +48,7 @@ compare exp out || fail=1
# Adding a partition must succeed, even though another
# on this same device is mounted (active).
-parted -s "$dev" mkpart primary fat32 41 85 > out 2>&1 || fail=1
+parted -s "$dev" mkpart primary fat32 5 10 > out 2>&1 || fail=1
compare /dev/null out || fail=1
parted -s "$dev" u s print
--
2.31.1

View File

@ -0,0 +1,40 @@
From f1c0f474670612b79a30d70863b4351c5883b5f6 Mon Sep 17 00:00:00 2001
From: "Brian C. Lane" <bcl@redhat.com>
Date: Mon, 12 Jul 2021 15:27:30 -0700
Subject: [PATCH 17/24] tests/t1101: Change dev_size_mb to 10
This is backed by memory, so using more than is needed limits the size
of the system it can run on.
---
tests/t1101-busy-partition.sh | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tests/t1101-busy-partition.sh b/tests/t1101-busy-partition.sh
index e35e6f0..5e37814 100755
--- a/tests/t1101-busy-partition.sh
+++ b/tests/t1101-busy-partition.sh
@@ -24,7 +24,7 @@ require_root_
require_scsi_debug_module_
# create memory-backed device
-scsi_debug_setup_ dev_size_mb=80 > dev-name ||
+scsi_debug_setup_ dev_size_mb=10 > dev-name ||
skip_ 'failed to create scsi_debug device'
dev=$(cat dev-name)
@@ -37,10 +37,10 @@ parted -s "$dev" mklabel msdos > out 2>&1 || fail=1
# expect no output
compare /dev/null out || fail=1
-parted -s "$dev" mkpart primary fat32 1 40 > out 2>&1 || fail=1
+parted -s "$dev" mkpart primary fat32 1 4 > out 2>&1 || fail=1
compare /dev/null out || fail=1
-parted -s "$dev" mkpart primary fat32 40 80 > out 2>&1 || fail=1
+parted -s "$dev" mkpart primary fat32 4 10 > out 2>&1 || fail=1
compare /dev/null out || fail=1
# wait for new partition device to appear
--
2.31.1

View File

@ -0,0 +1,43 @@
From 29cf5841f7c046e149e3554a0f92a96169681bec Mon Sep 17 00:00:00 2001
From: "Brian C. Lane" <bcl@redhat.com>
Date: Mon, 12 Jul 2021 15:28:33 -0700
Subject: [PATCH 18/24] tests/t1102: Change dev_size_mb to 10
This is backed by memory, so using more than is needed limits the size
of the system it can run on.
---
tests/t1102-loop-label.sh | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tests/t1102-loop-label.sh b/tests/t1102-loop-label.sh
index 091227b..0a120b9 100644
--- a/tests/t1102-loop-label.sh
+++ b/tests/t1102-loop-label.sh
@@ -23,7 +23,7 @@ require_root_
require_scsi_debug_module_
ss=$sector_size_
-scsi_debug_setup_ sector_size=$ss dev_size_mb=90 > dev-name ||
+scsi_debug_setup_ sector_size=$ss dev_size_mb=10 > dev-name ||
skip_ 'failed to create scsi_debug device'
dev=$(cat dev-name)
@@ -31,13 +31,13 @@ mke2fs -F $dev
parted -s "$dev" print > out 2>&1 || fail=1
cat <<EOF > exp
Model: Linux scsi_debug (scsi)
-Disk DEVICE: 94.4MB
+Disk DEVICE: 10.5MB
Sector size (logical/physical): ${ss}B/${ss}B
Partition Table: loop
Disk Flags:
Number Start End Size File system Flags
- 1 0.00B 94.4MB 94.4MB ext2
+ 1 0.00B 10.5MB 10.5MB ext2
EOF
mv out o2 && sed -e "s,$dev,DEVICE,;s/ *$//" o2 > out
--
2.31.1

View File

@ -0,0 +1,36 @@
From 843a800098705c71698dabb3c2e549912b17606a Mon Sep 17 00:00:00 2001
From: "Brian C. Lane" <bcl@redhat.com>
Date: Mon, 12 Jul 2021 15:29:03 -0700
Subject: [PATCH 19/24] tests/t1701: Change dev_size_mb to 10
This is backed by memory, so using more than is needed limits the size
of the system it can run on.
---
tests/t1701-rescue-fs.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/t1701-rescue-fs.sh b/tests/t1701-rescue-fs.sh
index 050c064..71d545d 100644
--- a/tests/t1701-rescue-fs.sh
+++ b/tests/t1701-rescue-fs.sh
@@ -22,7 +22,7 @@ require_root_
require_scsi_debug_module_
# create memory-backed device
-scsi_debug_setup_ sector_size=$sector_size_ dev_size_mb=32 > dev-name ||
+scsi_debug_setup_ sector_size=$sector_size_ dev_size_mb=10 > dev-name ||
skip_ 'failed to create scsi_debug device'
scsi_dev=$(cat dev-name)
@@ -39,7 +39,7 @@ parted -s $scsi_dev rm 1 || fail=1
# rescue the partition
echo yes | parted ---pretend-input-tty $scsi_dev rescue 1m 100% > out 2>&1
cat > exp <<EOF
-Information: A ext4 primary partition was found at 1049kB -> 33.6MB. Do you want to add it to the partition table?
+Information: A ext4 primary partition was found at 1049kB -> 10.5MB. Do you want to add it to the partition table?
Yes/No/Cancel? yes
Information: You may need to update /etc/fstab.
EOF
--
2.31.1

View File

@ -0,0 +1,32 @@
From e72dc01c85fb6baa8e065660bda6ec92e21bee49 Mon Sep 17 00:00:00 2001
From: "Brian C. Lane" <bcl@redhat.com>
Date: Mon, 12 Jul 2021 15:29:29 -0700
Subject: [PATCH 20/24] tests/t3000: Change dev_size_mb to 267
FAT32 needs a minimum partition size of 256MB so this is as small as we
can make it.
This is backed by memory, so using more than is needed limits the size
of the system it can run on.
---
tests/t3000-resize-fs.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/t3000-resize-fs.sh b/tests/t3000-resize-fs.sh
index 64b038d..1f2e46e 100755
--- a/tests/t3000-resize-fs.sh
+++ b/tests/t3000-resize-fs.sh
@@ -29,8 +29,8 @@ start=63s
default_end=546147s
new_end=530144s
-# create memory-backed device
-scsi_debug_setup_ dev_size_mb=550 > dev-name ||
+# create memory-backed device. Must be > 256MB+8MB
+scsi_debug_setup_ dev_size_mb=267 > dev-name ||
skip_ 'failed to create scsi_debug device'
dev=$(cat dev-name)
--
2.31.1

View File

@ -0,0 +1,36 @@
From 18556277b93ebb7dd88da5d4928189386c0eb132 Mon Sep 17 00:00:00 2001
From: "Brian C. Lane" <bcl@redhat.com>
Date: Mon, 12 Jul 2021 15:29:59 -0700
Subject: [PATCH 21/24] tests/t3200: Change dev_size_mb to 10
This is backed by memory, so using more than is needed limits the size
of the system it can run on.
---
tests/t3200-type-change.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/t3200-type-change.sh b/tests/t3200-type-change.sh
index 39904e0..3ad8604 100755
--- a/tests/t3200-type-change.sh
+++ b/tests/t3200-type-change.sh
@@ -25,7 +25,7 @@ grep '^#define USE_BLKID 1' "$CONFIG_HEADER" > /dev/null ||
skip_ 'this system lacks a new-enough libblkid'
# create memory-backed device
-scsi_debug_setup_ dev_size_mb=550 > dev-name ||
+scsi_debug_setup_ dev_size_mb=10 > dev-name ||
skip_ 'failed to create scsi_debug device'
scsi_dev=$(cat dev-name)
@@ -34,7 +34,7 @@ scsi_dev=$(cat dev-name)
# partition and ensure that parted doesn't "helpfully" change the partition
# type to match the newly-detected FS type.
-parted -s $scsi_dev mklabel msdos mkpart primary fat32 64s 80000s || fail=1
+parted -s $scsi_dev mklabel msdos mkpart primary fat32 1MiB 100% || fail=1
parted -s $scsi_dev u s p
--
2.31.1

View File

@ -0,0 +1,48 @@
From 0caf2d7f1363b9c4b3b63cf7d3a1260eb5a72f34 Mon Sep 17 00:00:00 2001
From: "Brian C. Lane" <bcl@redhat.com>
Date: Mon, 12 Jul 2021 15:30:45 -0700
Subject: [PATCH 22/24] tests/t6006: Change dev_size_mb to 10
This is backed by memory, so using more than is needed limits the size
of the system it can run on.
---
tests/t6006-dm-512b-sectors.sh | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/tests/t6006-dm-512b-sectors.sh b/tests/t6006-dm-512b-sectors.sh
index 2460c49..83bf3b1 100644
--- a/tests/t6006-dm-512b-sectors.sh
+++ b/tests/t6006-dm-512b-sectors.sh
@@ -46,9 +46,9 @@ cleanup_fn_() {
udevadm settle
}
-# Create a 500M device
+# Create a 10M device
ss=$sector_size_
-scsi_debug_setup_ sector_size=$ss dev_size_mb=500 > dev-name ||
+scsi_debug_setup_ sector_size=$ss dev_size_mb=11 > dev-name ||
skip_ 'failed to create scsi_debug device'
scsi_dev=$(cat dev-name)
@@ -58,13 +58,13 @@ scsi_dev_size=$(blockdev --getsz $scsi_dev) || framework_failure
dmsetup create $linear_ --table "0 $scsi_dev_size linear $scsi_dev 0" || framework_failure
dev="/dev/mapper/$linear_"
-# Create msdos partition table with a partition from 1MiB to 100MiB
-parted -s $dev mklabel msdos mkpart primary ext2 1MiB 101MiB > out 2>&1 || fail=1
+# Create msdos partition table with a partition from 1MiB to 10MiB
+parted -s $dev mklabel msdos mkpart primary ext2 1MiB 100% > out 2>&1 || fail=1
compare /dev/null out || fail=1
wait_for_dev_to_appear_ ${dev}1 || fail=1
-# The size of the partition should be 100MiB, or 204800 512b sectors
+# The size of the partition should be 10MiB, or 20480 512b sectors
p1_size=$(blockdev --getsz ${dev}1) || framework_failure
-[ $p1_size == 204800 ] || fail=1
+[ $p1_size == 20480 ] || fail=1
Exit $fail
--
2.31.1

View File

@ -0,0 +1,54 @@
From 262a9242f5ad121ddcb42edaacadbc2e6a650333 Mon Sep 17 00:00:00 2001
From: "Brian C. Lane" <bcl@redhat.com>
Date: Thu, 15 Jul 2021 08:27:00 -0700
Subject: [PATCH 23/24] tests/t3000: Check for hfs and vfat support separately
Previously the whole test would be skipped if either mkfs.hfs or
mkfs.vfat were not installed, leading to missing test coverage. This
change checks for them individually so that the test will run with
either or both of them installed
---
tests/t3000-resize-fs.sh | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/tests/t3000-resize-fs.sh b/tests/t3000-resize-fs.sh
index 1f2e46e..282b6fc 100755
--- a/tests/t3000-resize-fs.sh
+++ b/tests/t3000-resize-fs.sh
@@ -17,12 +17,22 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
. "${srcdir=.}/init.sh"; path_prepend_ ../parted .
-require_hfs_
-require_fat_
require_root_
require_scsi_debug_module_
require_512_byte_sector_size_
+
+FSTYPES=""
+
+# Is mkfs.hfs available?
+mkfs.hfs 2>&1 | grep '^usage:' && FSTYPES="hfs+"
+
+# Is mkfs.vfat available?
+mkfs.vfat 2>&1 | grep '^Usage:' && FSTYPES="$FSTYPES fat32 fat16"
+
+[ -n "$FSTYPES" ] || skip_ "Neither mkfs.hfs nor mkfs.vfat installed"
+
+
ss=$sector_size_
start=63s
@@ -53,7 +63,7 @@ mkdir "$mount_point" || fail=1
# be sure to unmount upon interrupt, failure, etc.
cleanup_fn_() { umount "${dev}1" > /dev/null 2>&1; }
-for fs_type in hfs+ fat32 fat16; do
+for fs_type in $FSTYPES; do
echo "fs_type=$fs_type"
# create an empty $fs_type partition, cylinder aligned, size > 256 MB
--
2.31.1

View File

@ -0,0 +1,43 @@
From 964bc37f6c95308a64aa96534b29412ce55835fd Mon Sep 17 00:00:00 2001
From: "Brian C. Lane" <bcl@redhat.com>
Date: Thu, 29 Jul 2021 11:19:15 -0700
Subject: [PATCH 24/24] tests/t3000: Use mkfs.hfsplus and fsck.hfsplus for
resize tests
---
tests/t3000-resize-fs.sh | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tests/t3000-resize-fs.sh b/tests/t3000-resize-fs.sh
index 282b6fc..cf46c81 100755
--- a/tests/t3000-resize-fs.sh
+++ b/tests/t3000-resize-fs.sh
@@ -24,13 +24,13 @@ require_512_byte_sector_size_
FSTYPES=""
-# Is mkfs.hfs available?
-mkfs.hfs 2>&1 | grep '^usage:' && FSTYPES="hfs+"
+# Is mkfs.hfsplus available?
+mkfs.hfsplus 2>&1 | grep '^usage:' && FSTYPES="hfs+"
# Is mkfs.vfat available?
mkfs.vfat 2>&1 | grep '^Usage:' && FSTYPES="$FSTYPES fat32 fat16"
-[ -n "$FSTYPES" ] || skip_ "Neither mkfs.hfs nor mkfs.vfat installed"
+[ -n "$FSTYPES" ] || skip_ "Neither mkfs.hfsplus nor mkfs.vfat installed"
ss=$sector_size_
@@ -79,7 +79,7 @@ for fs_type in $FSTYPES; do
case $fs_type in
fat16) mkfs_cmd='mkfs.vfat -F 16'; fsck='fsck.vfat -v';;
fat32) mkfs_cmd='mkfs.vfat -F 32'; fsck='fsck.vfat -v';;
- hfs*) mkfs_cmd='mkfs.hfs'; fsck=fsck.hfs;;
+ hfs*) mkfs_cmd='mkfs.hfsplus'; fsck=fsck.hfsplus;;
*) error "internal error: unhandled fs type: $fs_type";;
esac
--
2.31.1

View File

@ -1,7 +1,7 @@
Summary: The GNU disk partition manipulation program
Name: parted
Version: 3.4
Release: 5%{?dist}
Release: 6%{?dist}
License: GPLv3+
URL: http://www.gnu.org/software/parted
@ -26,6 +26,15 @@ Patch0012: 0012-libparted-Fix-warning-about-buffer-size-in-Atari-lab.patch
Patch0013: 0013-libparted-Fix-potential-memory-leak-in-gpt_write.patch
Patch0014: 0014-tests-t0400-Work-around-a-mkswap-bug-by-using-dev-ze.patch
Patch0015: 0015-tests-t9050-Use-dev-zero-for-temporary-file-and-mksw.patch
Patch0016: 0016-tests-t1100-Change-dev_size_mb-to-10.patch
Patch0017: 0017-tests-t1101-Change-dev_size_mb-to-10.patch
Patch0018: 0018-tests-t1102-Change-dev_size_mb-to-10.patch
Patch0019: 0019-tests-t1701-Change-dev_size_mb-to-10.patch
Patch0020: 0020-tests-t3000-Change-dev_size_mb-to-267.patch
Patch0021: 0021-tests-t3200-Change-dev_size_mb-to-10.patch
Patch0022: 0022-tests-t6006-Change-dev_size_mb-to-10.patch
Patch0023: 0023-tests-t3000-Check-for-hfs-and-vfat-support-separatel.patch
Patch0024: 0024-tests-t3000-Use-mkfs.hfsplus-and-fsck.hfsplus-for-re.patch
BuildRequires: gcc
BuildRequires: e2fsprogs-devel
@ -74,9 +83,8 @@ Parted library, you need to install this package.
%prep
%{gpgverify} --keyring='%{SOURCE3}' --signature='%{SOURCE1}' --data='%{SOURCE0}'
%autosetup -S git_am
gpg2 --import %{SOURCE2} %{SOURCE3}
gpg2 --verify %{SOURCE1} %{SOURCE0}
iconv -f ISO-8859-1 -t UTF8 AUTHORS > tmp; touch -r AUTHORS tmp; mv tmp AUTHORS
%build
@ -130,6 +138,13 @@ make check
%changelog
* Tue Aug 03 2021 Brian C. Lane <bcl@redhat.com> - 3.4-6
- spec: Use the %%gpgverify macro for the signature check
- tests/t3000: Use mkfs.hfsplus and fsck.hfsplus for resize tests (bcl)
- tests/t3000: Check for hfs and vfat support separately (bcl)
- tests: Reduce memory usage for tests using scsi_debug module (bcl)
- spec: Install to /usr/sbin and /usr/lib64 (bcl)
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.4-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild