Skip to content

Commit d86654a

Browse files
Pull up following revision(s) (requested by kre in ticket #47):
tests/lib/libc/kevent_nullmnt/t_nullmnt.sh: revision 1.9 PR 59683: check for availability of null FS support via vfs.generic.fstypes, fail if the mount fails for other reasons.
1 parent 4fe6054 commit d86654a

1 file changed

Lines changed: 19 additions & 2 deletions

File tree

tests/lib/libc/kevent_nullmnt/t_nullmnt.sh

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,33 @@
33
curdir=$(pwd)
44
helper=$(atf_get_srcdir)/h_nullmnt
55

6+
# helper function to check for kernel support
7+
have_nullfs_support()
8+
{
9+
for t in $( sysctl -n vfs.generic.fstypes )
10+
do
11+
case "$t" in
12+
null) return 0;;
13+
esac
14+
done
15+
16+
return 1
17+
}
18+
619
# common test body
720
# $1 = directory of file to monitor
821
# $2 = directory of file to update/modify
922

1023
nullmnt_common()
11-
{
24+
{
25+
if ! have_nullfs_support; then
26+
atf_skip "nullfs not supported"
27+
fi
28+
1229
mkdir ${curdir}/lower_dir
1330
mkdir ${curdir}/upper_dir
1431
mount -t null ${curdir}/lower_dir ${curdir}/upper_dir || \
15-
atf_skip "nullfs not supported"
32+
atf_fail "could not mount nullfs"
1633
rm -f ${curdir}/lower_dir/afile
1734
touch ${curdir}/lower_dir/afile
1835

0 commit comments

Comments
 (0)