parted/0119-tests-Use-mkfs.xfs-to-create-files-1101112.patch
Brian C. Lane 73aa139585 - Rebase on parted master commit 1da239e2ebd2
- libparted: Fix bug with dupe and empty name
2014-06-13 09:52:56 -07:00

70 lines
2.6 KiB
Diff

From 2b59e3264fc517c432b926968eba8b85d5df788d Mon Sep 17 00:00:00 2001
From: "Brian C. Lane" <bcl@redhat.com>
Date: Tue, 27 May 2014 07:38:36 -0700
Subject: [PATCH 119/125] tests: Use mkfs.xfs to create files (#1101112)
On s390 there is a bug with mkfs.xfs and pre-existing files. Work around
it by creating the file directly with mkfs.xfs. This also works on other
arches.
* tests/t1700-probe-fs.sh: Check for xfs and use direct file creation
* tests/t4100-dvh-partition-limits.sh: Use mkfs.xfs -dfile
* tests/t4100-msdos-partition-limits.sh: Use mkfs.xfs -dfile
---
tests/t1700-probe-fs.sh | 9 +++++++--
tests/t4100-dvh-partition-limits.sh | 3 +--
tests/t4100-msdos-partition-limits.sh | 3 +--
3 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/tests/t1700-probe-fs.sh b/tests/t1700-probe-fs.sh
index c4d514a..c2c9706 100755
--- a/tests/t1700-probe-fs.sh
+++ b/tests/t1700-probe-fs.sh
@@ -40,8 +40,13 @@ for type in ext2 ext3 ext4 btrfs xfs nilfs2 ntfs vfat hfsplus; do
esac
# create an $type file system
- dd if=/dev/null of=$dev bs=$ss seek=$n_sectors >/dev/null || fail=1
- mkfs.$type $force $dev || { warn_ $ME: mkfs.$type failed; fail=1; continue; }
+ if [ "$type" == "xfs" ]; then
+ # Work around a problem with s390
+ mkfs.xfs -ssize=$ss -dfile,name=$dev,size=${n_sectors}s || fail=1
+ else
+ dd if=/dev/null of=$dev bs=$ss seek=$n_sectors >/dev/null || fail=1
+ mkfs.$type $force $dev || { warn_ $ME: mkfs.$type failed; fail=1; continue; }
+ fi
# probe the $type file system
parted -m -s $dev u s print >out 2>&1 || fail=1
diff --git a/tests/t4100-dvh-partition-limits.sh b/tests/t4100-dvh-partition-limits.sh
index aeec8fd..cd89acb 100755
--- a/tests/t4100-dvh-partition-limits.sh
+++ b/tests/t4100-dvh-partition-limits.sh
@@ -37,8 +37,7 @@ mp=`pwd`/mount-point
n=4096
# create an XFS file system
-dd if=/dev/zero of=$fs bs=1MB count=2 seek=20 || fail=1
-mkfs.xfs -f -q $fs || fail=1
+mkfs.xfs -dfile,name=$fs,size=100m || fail=1
mkdir "$mp" || fail=1
# Unmount upon interrupt, failure, etc., as well as upon normal completion.
diff --git a/tests/t4100-msdos-partition-limits.sh b/tests/t4100-msdos-partition-limits.sh
index 09bb5d0..28b4560 100755
--- a/tests/t4100-msdos-partition-limits.sh
+++ b/tests/t4100-msdos-partition-limits.sh
@@ -37,8 +37,7 @@ mp=`pwd`/mount-point
n=4096
# create an XFS file system
-dd if=/dev/zero of=$fs bs=1MB count=2 seek=20 || fail=1
-mkfs.xfs -f -q $fs || fail=1
+mkfs.xfs -dfile,name=$fs,size=100m || fail=1
mkdir "$mp" || fail=1
# Unmount upon interrupt, failure, etc., as well as upon normal completion.
--
1.9.3