tests: show mount list on failure for df tests

* 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.
This commit is contained in:
Pádraig Brady 2016-01-16 13:53:48 +00:00
parent 2a5494271c
commit fa9ae62a9e
7 changed files with 20 additions and 0 deletions

View File

@ -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_

View File

@ -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

View File

@ -54,4 +54,6 @@ test $(wc -l < out) = 2 || fail=1
compare exp err || fail=1
test "$fail" = 1 && dump_mount_list_
Exit $fail

View File

@ -41,4 +41,6 @@ test $skip = 1 \
test $(df "$mnt" | wc -l) = 2 || fail=1
test "$fail" = 1 && dump_mount_list_
Exit $fail

View File

@ -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

View File

@ -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

View File

@ -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