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

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