[Parted-commits] GNU Parted Official Repository: Changes to 'master'

Jim Meyering meyering at alioth.debian.org
Sat Oct 6 09:45:21 UTC 2012


 tests/t-lvm.sh |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

New commits:
commit 478e472bf9f1c76b66a35ea75b45110152e5207d
Author: Jim Meyering <meyering at redhat.com>
Date:   Sat Oct 6 11:11:32 2012 +0200

    tests: stop using private "dev" directory for losetup
    
    Something about Fedora 17's losetup changed so that using a private
    dev directory no longer worked.  Now, simply use /dev/ directly.
    * tests/t-lvm.sh: Don't use $G_dev_.  Not needed, and actually
    caused the t6000-dm root-only test to fail on Fedora 17.
    Also, redirect less to stderr: that helps diagnose failure.

diff --git a/tests/t-lvm.sh b/tests/t-lvm.sh
index 9cee155..cf1b8b8 100644
--- a/tests/t-lvm.sh
+++ b/tests/t-lvm.sh
@@ -17,14 +17,13 @@ unsafe_losetup_()
 {
   f=$1
 
-  test -n "$G_dev_" \
-    || fail_ "Internal error: unsafe_losetup_ called before init_root_dir_"
+  G_dev_=/dev
 
   # Iterate through $G_dev_/loop{,/}{0,1,2,3,4,5,6,7,8,9}
   for slash in '' /; do
     for i in 0 1 2 3 4 5 6 7 8 9; do
       dev=$G_dev_/loop$slash$i
-      losetup $dev > /dev/null 2>&1 && continue;
+      losetup $dev 1>&2 && continue;
       losetup "$dev" "$f" > /dev/null && { echo "$dev"; return 0; }
       break
     done
@@ -40,7 +39,7 @@ loop_setup_()
     || { warn_ "loop_setup_ failed: Unable to create tmp file $file"; return 1; }
 
   # NOTE: this requires a new enough version of losetup
-  dev=$(unsafe_losetup_ "$file" 2>/dev/null) \
+  dev=$(unsafe_losetup_ "$file") \
     || { warn_ "loop_setup_ failed: Unable to create loopback device"; return 1; }
 
   echo "$dev"



More information about the Parted-commits mailing list