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

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