mirror of
https://https.git.savannah.gnu.org/git/coreutils.git
synced 2026-01-26 15:29:07 +00:00
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:
parent
2a5494271c
commit
fa9ae62a9e
8
init.cfg
8
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_
|
||||
|
||||
@ -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
|
||||
|
||||
@ -54,4 +54,6 @@ test $(wc -l < out) = 2 || fail=1
|
||||
|
||||
compare exp err || fail=1
|
||||
|
||||
test "$fail" = 1 && dump_mount_list_
|
||||
|
||||
Exit $fail
|
||||
|
||||
@ -41,4 +41,6 @@ test $skip = 1 \
|
||||
|
||||
test $(df "$mnt" | wc -l) = 2 || fail=1
|
||||
|
||||
test "$fail" = 1 && dump_mount_list_
|
||||
|
||||
Exit $fail
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user