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

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