bug-parted
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] tests: avoid root-only/XFS limit test failure on 32-bit system


From: Jim Meyering
Subject: [PATCH] tests: avoid root-only/XFS limit test failure on 32-bit system
Date: Fri, 30 Apr 2010 16:16:26 +0200

I noticed two root-only (and XFS-requiring) test failures on
a 32-bit system.  They were due to an inherent limitation that made
it impossible to set up the test (couldn't create a file with size
greater than 16TiB).  The solution is to skip those sub-tests:

>From 56136c834e416231d52bb066fcfb761528f5f81c Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Fri, 30 Apr 2010 15:59:14 +0200
Subject: [PATCH] tests: avoid root-only/XFS limit test failure on 32-bit system

* 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   |    7 +++++++
 tests/t4100-msdos-partition-limits.sh |   10 +++++++++-
 2 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/tests/t4100-dvh-partition-limits.sh 
b/tests/t4100-dvh-partition-limits.sh
index bf269e7..1016077 100755
--- a/tests/t4100-dvh-partition-limits.sh
+++ b/tests/t4100-dvh-partition-limits.sh
@@ -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.
diff --git a/tests/t4100-msdos-partition-limits.sh 
b/tests/t4100-msdos-partition-limits.sh
index b63a534..db98f2e 100755
--- a/tests/t4100-msdos-partition-limits.sh
+++ b/tests/t4100-msdos-partition-limits.sh
@@ -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
 }
--
1.7.1.328.g9993c




reply via email to

[Prev in Thread] Current Thread [Next in Thread]