parted/0032-tests-stop-using-private-dev-directory-for-losetup.patch

48 lines
1.6 KiB
Diff
Raw Normal View History

From 478e472bf9f1c76b66a35ea75b45110152e5207d Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Sat, 6 Oct 2012 11:11:32 +0200
Subject: [PATCH 32/89] 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.
---
tests/t-lvm.sh | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
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"
--
1.8.5.3