OSDN Git Service

tests: avoid root-only/XFS limit test failure on 32-bit system
authorJim Meyering <meyering@redhat.com>
Fri, 30 Apr 2010 13:59:14 +0000 (15:59 +0200)
committerJim Meyering <meyering@redhat.com>
Fri, 30 Apr 2010 14:20:19 +0000 (16:20 +0200)
* tests/t4100-msdos-partition-limits.sh: Due to an inherent XFS
limitation on 32-bit systems, this test would fail a set-up
file creation step for simulated sector sizes of 4K and up.
Skip this test in those cases.
Upon dd failure, propagate its diagnostic to output, to make this
sort of problem easier to diagnose.
* tests/t4100-dvh-partition-limits.sh: Likewise.

tests/t4100-dvh-partition-limits.sh
tests/t4100-msdos-partition-limits.sh

index bf269e7..1016077 100755 (executable)
@@ -25,6 +25,13 @@ privileges_required_=1
 require_xfs_
 ss=$sector_size_
 
+# On a 32-bit system, we must skip this test when $ss >= 4096.
+# Otherwise, due to an inherent 32-bit-XFS limit, dd would fail to
+# create the file of size > 16TiB
+if test $(uname -m) != x86_64; then
+  test $ss -le 2048 || exit 77
+fi
+
 ####################################################
 # Create and mount a file system capable of dealing with >=2TB files.
 # We must be able to create a file with an apparent length of 2TB or larger.
index b63a534..db98f2e 100755 (executable)
@@ -25,6 +25,13 @@ privileges_required_=1
 require_xfs_
 ss=$sector_size_
 
+# On a 32-bit system, we must skip this test when $ss >= 4096.
+# Otherwise, due to an inherent 32-bit-XFS limit, dd would fail to
+# create the file of size > 16TiB
+if test $(uname -m) != x86_64; then
+  test $ss -le 2048 || exit 77
+fi
+
 ####################################################
 # Create and mount a file system capable of dealing with >=2TB files.
 # We must be able to create a file with an apparent length of 2TB or larger.
@@ -59,7 +66,8 @@ do_mkpart()
   start_sector=$1
   end_sector=$2
   # echo '********' $(echo $end_sector - $start_sector + 1 |bc)
-  dd if=/dev/zero of=$dev bs=$ss count=2k seek=$end_sector 2> /dev/null &&
+  dd if=/dev/zero of=$dev bs=$ss count=2k seek=$end_sector 2> dd-err ||
+    { cat dd-err 1>&2; return 1; }
   parted -s $dev mklabel $table_type &&
   parted -s $dev mkpart p xfs ${start_sector}s ${end_sector}s
 }