summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian C. Lane <bcl@redhat.com>2014-05-27 07:38:36 -0700
committerBrian C. Lane <bcl@redhat.com>2014-05-27 16:24:54 -0700
commit2b59e3264fc517c432b926968eba8b85d5df788d (patch)
treec6094fde8e70134f28f7f02d7e4bf4407e54226f
parent9041a40cb2e1818ac9ca4942d6be70bf3abdc81b (diff)
downloadparted-2b59e3264fc517c432b926968eba8b85d5df788d.tar.gz
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
-rwxr-xr-xtests/t1700-probe-fs.sh9
-rwxr-xr-xtests/t4100-dvh-partition-limits.sh3
-rwxr-xr-xtests/t4100-msdos-partition-limits.sh3
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.