coreutils
[Top][All Lists]
Advanced

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

[PATCH] tests: fix du/bind-mount-dir-cycle.sh with regular mtab


From: Gilles Espinasse
Subject: [PATCH] tests: fix du/bind-mount-dir-cycle.sh with regular mtab
Date: Thu, 25 Oct 2012 13:03:17 +0200

Add the message when /etc/mtab is a regular file

Avoid to log the case that does not apply using test -h /etc/mtab
---
 tests/du/bind-mount-dir-cycle.sh |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/tests/du/bind-mount-dir-cycle.sh b/tests/du/bind-mount-dir-cycle.sh
index d8d381a..79fdf61 100755
--- a/tests/du/bind-mount-dir-cycle.sh
+++ b/tests/du/bind-mount-dir-cycle.sh
@@ -33,12 +33,21 @@ mount --bind a a/b \
   || skip_ "This test requires mount with a working --bind option."
 
 echo a > exp || framework_failure_
-echo "du: mount point 'a/b' already traversed" > exp-err || framework_failure_
+echo "du: mount point 'a/b' already traversed" > exp-err-mtab-symlink || 
framework_failure_
+cat <<EOF > exp-err-mtab-regular || framework_failure_
+du: WARNING: Circular directory structure.
+This almost certainly means that you have a corrupted file system.
+NOTIFY YOUR SYSTEM MANAGER.
+The following directory is part of the cycle:
+  'a/b'
+
+EOF
 
 du a > out 2> err && fail=1
 sed 's/^[0-9][0-9]*    //' out > k && mv k out
 
-compare exp-err err || fail=1
+env test -h /etc/mtab && (compare exp-err-mtab-symlink err || fail=1)
+env test -h /etc/mtab || compare exp-err-mtab-regular err || fail=1
 compare exp out || fail=1
 
 Exit $fail
-- 
1.7.2.5




reply via email to

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