Blame SOURCES/0028-tests-Fix-t1700-failing-on-a-host-with-a-4k-xfs-file.patch

0cb0b9
From 1fc0439a5bd27697fb5daa911f776de4a69e0ca3 Mon Sep 17 00:00:00 2001
0cb0b9
From: "Brian C. Lane" <bcl@redhat.com>
0cb0b9
Date: Mon, 29 Feb 2016 14:31:35 -0800
0cb0b9
Subject: [PATCH 28/28] tests: Fix t1700 failing on a host with a 4k xfs
0cb0b9
 filesystem (#1260664)
0cb0b9
0cb0b9
The problem is that mkfs.xfs won't work if the file it is trying to
0cb0b9
create is on a filesystem with a sector size larger than the passed
0cb0b9
-ssize value. So a host with 4k disks (eg. s390) and the xfs filesystem
0cb0b9
will fail with the error message:
0cb0b9
    illegal sector size 512; hw sector is 4096
0cb0b9
0cb0b9
Failures setting up the environment for the test aren't parted bugs.
0cb0b9
This stops treating mkfs and dd errors as test failures, skipping the fs
0cb0b9
and logging a warning.
0cb0b9
0cb0b9
Related: rhbz#1260664
0cb0b9
---
0cb0b9
 tests/t1700-probe-fs.sh | 12 ++++++------
0cb0b9
 1 file changed, 6 insertions(+), 6 deletions(-)
0cb0b9
0cb0b9
diff --git a/tests/t1700-probe-fs.sh b/tests/t1700-probe-fs.sh
0cb0b9
index 94ed9ae..b13cec0 100755
0cb0b9
--- a/tests/t1700-probe-fs.sh
0cb0b9
+++ b/tests/t1700-probe-fs.sh
0cb0b9
@@ -39,13 +39,13 @@ for type in ext2 ext3 ext4 btrfs xfs nilfs2 ntfs vfat hfsplus; do
0cb0b9
       hfsplus) fsname=hfs+;;
0cb0b9
   esac
0cb0b9
 
0cb0b9
-  # create an $type file system
0cb0b9
+  # create an $type file system, creation failures are not parted bugs,
0cb0b9
+  # skip the filesystem instead of failing the test.
0cb0b9
   if [ "$type" = "xfs" ]; then
0cb0b9
-      # Work around a problem with s390
0cb0b9
-      mkfs.xfs -ssize=$ss -dfile,name=$dev,size=${n_sectors}s || fail=1
0cb0b9
+      mkfs.xfs -ssize=$ss -dfile,name=$dev,size=${n_sectors}s || { warn_ "$ME: mkfs.$type failed, skipping"; continue; }
0cb0b9
   else
0cb0b9
-      dd if=/dev/null of=$dev bs=$ss seek=$n_sectors >/dev/null || fail=1
0cb0b9
-      mkfs.$type $force $dev || { warn_ $ME: mkfs.$type failed; fail=1; continue; }
0cb0b9
+      dd if=/dev/null of=$dev bs=$ss seek=$n_sectors >/dev/null || { warn_ "$ME: dd failed, skipping $type"; continue; }
0cb0b9
+      mkfs.$type $force $dev || { warn_ "$ME: mkfs.$type failed skipping"; continue; }
0cb0b9
   fi
0cb0b9
 
0cb0b9
   # probe the $type file system
0cb0b9
@@ -57,7 +57,7 @@ done
0cb0b9
 # Some features should indicate ext4 by themselves.
0cb0b9
 for feature in uninit_bg flex_bg; do
0cb0b9
   # create an ext3 file system
0cb0b9
-  dd if=/dev/null of=$dev bs=1024 seek=4096 >/dev/null || fail=1
0cb0b9
+  dd if=/dev/null of=$dev bs=1024 seek=4096 >/dev/null || skip_ "dd failed"
0cb0b9
   mkfs.ext3 -F $dev >/dev/null || skip_ "mkfs.ext3 failed"
0cb0b9
 
0cb0b9
   # set the feature
0cb0b9
-- 
0cb0b9
2.5.0
0cb0b9