]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: show mount list on failure for df tests
authorPádraig Brady <P@draigBrady.com>
Sat, 16 Jan 2016 13:53:48 +0000 (13:53 +0000)
committerPádraig Brady <P@draigBrady.com>
Sat, 16 Jan 2016 13:53:48 +0000 (13:53 +0000)
* init.cfg (dump_mount_list_): A new function to output the
system mount list.
* tests/df/df-symlink.sh: Call dump_mount_list_ upon failure.
* tests/df/over-mount-device.sh: Likewise.
* tests/df/problematic-chars.sh: Likewise.
* tests/df/skip-rootfs.sh: Likewise.
* tests/df/total-verify.sh: Likewise.
* tests/df/unreadable.sh: Likewise.

init.cfg
tests/df/df-symlink.sh
tests/df/over-mount-device.sh
tests/df/problematic-chars.sh
tests/df/skip-rootfs.sh
tests/df/total-verify.sh
tests/df/unreadable.sh

index 108fd206bfe6c26e4f0ae40a8f425ce4e23bc6e8..db861944c6af45c18dc59294489f7512760bea2a 100644 (file)
--- a/init.cfg
+++ b/init.cfg
@@ -92,6 +92,14 @@ require_mount_list_()
     skip_ "$mount_list_fail"
 }
 
+dump_mount_list_()
+{
+  cat /proc/self/mountinfo ||
+  cat /proc/self/mounts ||
+  cat /proc/mounts ||
+  cat /etc/mtab
+}
+
 require_local_dir_()
 {
   require_mount_list_
index a9d8c962391c5e34f7a89dfe070487593daab07d..01dff24e11bde68df4633c226fcd86a1ea116549 100755 (executable)
@@ -39,4 +39,6 @@ if test "$(df --output=source | grep -F "$disk" | wc -l)" = 1; then
   compare exp out || fail=1
 fi
 
+test "$fail" = 1 && dump_mount_list_
+
 Exit $fail
index eb8af9291c8678bf5ac9d5c23eaffaca477aa6b4..479d36d6640b7c65c00205f7d61db43972c4ef7a 100755 (executable)
@@ -54,4 +54,6 @@ test $(wc -l < out) = 2 || fail=1
 
 compare exp err || fail=1
 
+test "$fail" = 1 && dump_mount_list_
+
 Exit $fail
index 2020a12e18a3b2e54a24c9e4888aaa2d9c1037ea..59ee0556bc83b2716f2f63d9ccd6585cb45099ff 100755 (executable)
@@ -41,4 +41,6 @@ test $skip = 1 \
 
 test $(df "$mnt" | wc -l) = 2 || fail=1
 
+test "$fail" = 1 && dump_mount_list_
+
 Exit $fail
index e79d4244f477118787a41d91af824743082028ec..c893144270afad3ee41629ad9c473931bc377d64 100755 (executable)
@@ -48,4 +48,6 @@ grep '^rootfs' out || { fail=1; cat out; }
 df -a -x rootfs >out || fail=1
 grep '^rootfs' out && { fail=1; cat out; }
 
+test "$fail" = 1 && dump_mount_list_
+
 Exit $fail
index d0b2b7be84f2cd63aea347fd6aaed973f96a76cc..79722e493a9e5405552e6198bf2efc0e28dc904d 100755 (executable)
@@ -62,4 +62,6 @@ cat inode
 $PERL check-df space || fail=1
 $PERL check-df inode || fail=1
 
+test "$fail" = 1 && dump_mount_list_
+
 Exit $fail
index c1c990fe80167078d0becfe9ce24cb692fb71518..c5754724a05db12d848183d99a3e57b0ab95fff9 100755 (executable)
@@ -24,4 +24,6 @@ touch unreadable || fail=1
 chmod a-r unreadable || fail=1
 df unreadable || fail=1
 
+test "$fail" = 1 && dump_mount_list_
+
 Exit $fail