Integrate pjdfstest test suite execution into kyua

pjdfstest execution is opt-in and must be done as root due to some of the
assumptions made by the test suite and lack of error checking in the non-root
case

A description of how to execute pjdfstest with kyua is provided in
share/pjdfstest/README

Phabric: D824 (an earlier prototype patch)
MFC after: 1 month
Relnotes: yes
Sponsored by: EMC / Isilon Storage Division
This commit is contained in:
Enji Cooper 2014-11-03 07:18:42 +00:00
parent 324a7026f1
commit fa8093473b
27 changed files with 468 additions and 4 deletions

View File

@ -31,6 +31,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11.x IS SLOW:
disable the most expensive debugging functionality run
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
20141102:
pjdfstest has been integrated into kyua as an opt-in test suite.
Please see share/doc/pjdfstest/README for a more details on how to
execute it.
20141009:
gperf has been removed from the base system for architectures
that use clang. Ports that require gperf will obtain it from the

View File

@ -17,6 +17,8 @@
doc
atf
..
pjdfstest
..
..
..
tests
@ -143,6 +145,38 @@
..
netinet
..
pjdfstest
chflags
..
chmod
..
chown
..
ftruncate
..
granular
..
link
..
mkdir
..
mkfifo
..
mknod
..
open
..
rename
..
rmdir
..
symlink
..
truncate
..
unlink
..
..
..
usr.bin
apply

View File

@ -7,10 +7,12 @@ SUBDIR= ${_IPv6} \
${_atf} \
legal \
${_llvm} \
${_pjdfstest} \
${_roffdocs}
.if ${MK_TESTS} != "no"
_atf= atf
_pjdfstest= pjdfstest
.endif
.if ${MK_CLANG} != "no"

View File

@ -0,0 +1,8 @@
# $FreeBSD$
NO_OBJ=
FILESDIR= ${SHAREDIR}/doc/pjdfstest
FILES= README
.include <bsd.prog.mk>

View File

@ -0,0 +1,36 @@
pjdfstest test suite execution is integrated into kyua. This README describes
how to use pjdfstest in the default configuration (kyua work directory), and
with a specific filesystem path.
Method 1. Executing with default configuration (kyua work directory)
1. Elevate privileges:
% su -
2. cd to the tests directory:
% cd /usr/tests/sys/pjdfstest
3. Run kyua:
% kyua test
Executing the commands as shown above will run pjdfstest in the kyua work
directory. The kyua work directory defaults to a random generated path under
/tmp; please see TMPDIR in kyua(1) for more details on how the temporary path
is chosen with kyua.
Method 2. Executing with a specific filesystem path (in this case /mnt)
1. Elevate privileges:
% su -
2. cd to the tests directory:
% cd /usr/tests/sys/pjdfstest
3. Run kyua:
% env PJDFSTEST_TEST_PATH=/mnt kyua test
WARNING: the above method violates the test program isolation algorithm
described in kyua(1); as such, $PJDFSTEST_TEST_PATH must be cleaned up after
executing the testcases.
It's highly recommended that $PJDFSTEST_TEST_PATH be pointed to a sandboxed
filesystem, e.g. a small UFS-formatted memory disk or ZFS dataset with
quotas enabled, so the filesystem can be easily destroyed after the test
execution is complete, and the testcases are properly bounded both in terms
of time and space.

View File

@ -4,9 +4,13 @@
.PATH: ${.CURDIR}/..
TESTSDIR= ${TESTSBASE}/sys
TESTS_SUBDIRS+= kern
TESTS_SUBDIRS+= netinet
TESTSDIR= ${TESTSBASE}/sys
# Items not integrated into kyua runs by default
SUBDIR+= pjdfstest
KYUAFILE= yes

View File

@ -0,0 +1,6 @@
# $FreeBSD$
SUBDIR+= pjdfstest
SUBDIR+= tests
.include <bsd.subdir.mk>

View File

@ -0,0 +1,20 @@
# $FreeBSD$
TOP= ${.CURDIR:H:H:H:H}
.PATH: ${TOP}/contrib/pjdfstest
BINDIR= ${TESTSBASE}/sys/pjdfstest
PROG= pjdfstest
MAN=
CFLAGS= -D__OS_FreeBSD__ -DHAS_LCHMOD -DHAS_CHFLAGS -DHAS_FCHFLAGS
CFLAGS+= -DHAS_CHFLAGSAT -DHAS_LCHFLAGS -DHAS_FREEBSD_ACL -DHAS_BINDAT
CFLAGS+= -DHAS_CONNECTAT
# XXX: the upstream sources need some massaging with how it assigns ngroups in
# pjdfstest.c
NO_WERROR=
WARNS?= 6
.include <bsd.prog.mk>

View File

@ -0,0 +1,39 @@
# $FreeBSD$
PJDFSTEST_SRCDIR= ${.CURDIR:H:H:H:H}/contrib/pjdfstest
TESTSDIR= ${TESTSBASE}/sys/pjdfstest
.PATH: ${.CURDIR}
FILESDIR= ${TESTSDIR}
FILES= conf
FILES+= misc.sh
CLEANFILES+= misc.sh misc.sh.tmp
misc.sh: ${PJDFSTEST_SRCDIR}/tests/misc.sh
sed -e '\,maindir=,s,maindir=.*,maindir=`dirname $$0`/../,' < ${.ALLSRC} > ${.TARGET}.tmp
mv ${.TARGET}.tmp ${.TARGET}
afterinstall: install-tests-symlink
install-tests-symlink: .PHONY
rm -f ${DESTDIR}${TESTSDIR}/tests
${INSTALL_SYMLINK} . ${DESTDIR}${TESTSDIR}/tests
TESTS_SUBDIRS= chflags
TESTS_SUBDIRS+= chmod
TESTS_SUBDIRS+= chown
TESTS_SUBDIRS+= ftruncate
TESTS_SUBDIRS+= granular
TESTS_SUBDIRS+= link
TESTS_SUBDIRS+= mkdir
TESTS_SUBDIRS+= mkfifo
TESTS_SUBDIRS+= mknod
TESTS_SUBDIRS+= open
TESTS_SUBDIRS+= rename
TESTS_SUBDIRS+= rmdir
TESTS_SUBDIRS+= symlink
TESTS_SUBDIRS+= truncate
TESTS_SUBDIRS+= unlink
.include <bsd.test.mk>

View File

@ -0,0 +1,18 @@
# $FreeBSD$
TAP_TESTS_SH= 00
TAP_TESTS_SH+= 01
TAP_TESTS_SH+= 02
TAP_TESTS_SH+= 03
TAP_TESTS_SH+= 04
TAP_TESTS_SH+= 05
TAP_TESTS_SH+= 06
TAP_TESTS_SH+= 07
TAP_TESTS_SH+= 08
TAP_TESTS_SH+= 09
TAP_TESTS_SH+= 10
TAP_TESTS_SH+= 11
TAP_TESTS_SH+= 12
TAP_TESTS_SH+= 13
.include "../pjdfstest.test.mk"

View File

@ -0,0 +1,17 @@
# $FreeBSD$
TAP_TESTS_SH= 00
TAP_TESTS_SH+= 01
TAP_TESTS_SH+= 02
TAP_TESTS_SH+= 03
TAP_TESTS_SH+= 04
TAP_TESTS_SH+= 05
TAP_TESTS_SH+= 06
TAP_TESTS_SH+= 07
TAP_TESTS_SH+= 08
TAP_TESTS_SH+= 09
TAP_TESTS_SH+= 10
TAP_TESTS_SH+= 11
TAP_TESTS_SH+= 12
.include "../pjdfstest.test.mk"

View File

@ -0,0 +1,15 @@
# $FreeBSD$
TAP_TESTS_SH= 00
TAP_TESTS_SH+= 01
TAP_TESTS_SH+= 02
TAP_TESTS_SH+= 03
TAP_TESTS_SH+= 04
TAP_TESTS_SH+= 05
TAP_TESTS_SH+= 06
TAP_TESTS_SH+= 07
TAP_TESTS_SH+= 08
TAP_TESTS_SH+= 09
TAP_TESTS_SH+= 10
.include "../pjdfstest.test.mk"

View File

@ -0,0 +1,15 @@
#!/bin/sh
#
# $FreeBSD$
: ${PJDFSTEST_TEST_PATH=.}
if ! cd ${PJDFSTEST_TEST_PATH}/; then
echo 'Please set PJDFSTEST_TEST_PATH to a valid filesystem path'
echo 'Bail out!'
exit 1
fi
GREP=grep
mountpoint=$(df . | tail -1 | awk '{print $6}')
fs=$(mount -p | awk '$2 == "'$mountpoint'" { print toupper($3) }')
os=FreeBSD

View File

@ -0,0 +1,19 @@
# $FreeBSD$
TAP_TESTS_SH= 00
TAP_TESTS_SH+= 01
TAP_TESTS_SH+= 02
TAP_TESTS_SH+= 03
TAP_TESTS_SH+= 04
TAP_TESTS_SH+= 05
TAP_TESTS_SH+= 06
TAP_TESTS_SH+= 07
TAP_TESTS_SH+= 08
TAP_TESTS_SH+= 09
TAP_TESTS_SH+= 10
TAP_TESTS_SH+= 11
TAP_TESTS_SH+= 12
TAP_TESTS_SH+= 13
TAP_TESTS_SH+= 14
.include "../pjdfstest.test.mk"

View File

@ -0,0 +1,10 @@
# $FreeBSD$
TAP_TESTS_SH= 00
TAP_TESTS_SH+= 01
TAP_TESTS_SH+= 02
TAP_TESTS_SH+= 03
TAP_TESTS_SH+= 04
TAP_TESTS_SH+= 05
.include "../pjdfstest.test.mk"

View File

@ -0,0 +1,22 @@
# $FreeBSD$
TAP_TESTS_SH= 00
TAP_TESTS_SH+= 01
TAP_TESTS_SH+= 02
TAP_TESTS_SH+= 03
TAP_TESTS_SH+= 04
TAP_TESTS_SH+= 05
TAP_TESTS_SH+= 06
TAP_TESTS_SH+= 07
TAP_TESTS_SH+= 08
TAP_TESTS_SH+= 09
TAP_TESTS_SH+= 10
TAP_TESTS_SH+= 11
TAP_TESTS_SH+= 12
TAP_TESTS_SH+= 13
TAP_TESTS_SH+= 14
TAP_TESTS_SH+= 15
TAP_TESTS_SH+= 16
TAP_TESTS_SH+= 17
.include "../pjdfstest.test.mk"

View File

@ -0,0 +1,17 @@
# $FreeBSD$
TAP_TESTS_SH= 00
TAP_TESTS_SH+= 01
TAP_TESTS_SH+= 02
TAP_TESTS_SH+= 03
TAP_TESTS_SH+= 04
TAP_TESTS_SH+= 05
TAP_TESTS_SH+= 06
TAP_TESTS_SH+= 07
TAP_TESTS_SH+= 08
TAP_TESTS_SH+= 09
TAP_TESTS_SH+= 10
TAP_TESTS_SH+= 11
TAP_TESTS_SH+= 12
.include "../pjdfstest.test.mk"

View File

@ -0,0 +1,17 @@
# $FreeBSD$
TAP_TESTS_SH= 00
TAP_TESTS_SH+= 01
TAP_TESTS_SH+= 02
TAP_TESTS_SH+= 03
TAP_TESTS_SH+= 04
TAP_TESTS_SH+= 05
TAP_TESTS_SH+= 06
TAP_TESTS_SH+= 07
TAP_TESTS_SH+= 08
TAP_TESTS_SH+= 09
TAP_TESTS_SH+= 10
TAP_TESTS_SH+= 11
TAP_TESTS_SH+= 12
.include "../pjdfstest.test.mk"

View File

@ -0,0 +1,16 @@
# $FreeBSD$
TAP_TESTS_SH= 00
TAP_TESTS_SH+= 01
TAP_TESTS_SH+= 02
TAP_TESTS_SH+= 03
TAP_TESTS_SH+= 04
TAP_TESTS_SH+= 05
TAP_TESTS_SH+= 06
TAP_TESTS_SH+= 07
TAP_TESTS_SH+= 08
TAP_TESTS_SH+= 09
TAP_TESTS_SH+= 10
TAP_TESTS_SH+= 11
.include "../pjdfstest.test.mk"

View File

@ -0,0 +1,29 @@
# $FreeBSD$
TAP_TESTS_SH= 00
TAP_TESTS_SH+= 01
TAP_TESTS_SH+= 02
TAP_TESTS_SH+= 03
TAP_TESTS_SH+= 04
TAP_TESTS_SH+= 05
TAP_TESTS_SH+= 06
TAP_TESTS_SH+= 07
TAP_TESTS_SH+= 08
TAP_TESTS_SH+= 09
TAP_TESTS_SH+= 10
TAP_TESTS_SH+= 11
TAP_TESTS_SH+= 12
TAP_TESTS_SH+= 13
TAP_TESTS_SH+= 14
TAP_TESTS_SH+= 15
TAP_TESTS_SH+= 16
TAP_TESTS_SH+= 17
TAP_TESTS_SH+= 18
TAP_TESTS_SH+= 19
TAP_TESTS_SH+= 20
TAP_TESTS_SH+= 21
TAP_TESTS_SH+= 22
TAP_TESTS_SH+= 23
TAP_TESTS_SH+= 24
.include "../pjdfstest.test.mk"

View File

@ -0,0 +1,14 @@
# $FreeBSD$
PJDFSTEST_SRCDIR= ${.CURDIR:H:H:H:H:H}/contrib/pjdfstest
.PATH: ${PJDFSTEST_SRCDIR}/tests/${.CURDIR:T}
TESTSDIR?= ${TESTSBASE}/sys/pjdfstest/${.CURDIR:T}
.for s in ${TAP_TESTS_SH}
TAP_TESTS_SH_SRC_$s= $s.t
TEST_METADATA.$s+= required_user="root"
.endfor
.include <bsd.test.mk>

View File

@ -0,0 +1,26 @@
# $FreeBSD$
TAP_TESTS_SH= 00
TAP_TESTS_SH+= 01
TAP_TESTS_SH+= 02
TAP_TESTS_SH+= 03
TAP_TESTS_SH+= 04
TAP_TESTS_SH+= 05
TAP_TESTS_SH+= 06
TAP_TESTS_SH+= 07
TAP_TESTS_SH+= 08
TAP_TESTS_SH+= 09
TAP_TESTS_SH+= 10
TAP_TESTS_SH+= 11
TAP_TESTS_SH+= 12
TAP_TESTS_SH+= 13
TAP_TESTS_SH+= 14
TAP_TESTS_SH+= 15
TAP_TESTS_SH+= 16
TAP_TESTS_SH+= 17
TAP_TESTS_SH+= 18
TAP_TESTS_SH+= 19
TAP_TESTS_SH+= 20
TAP_TESTS_SH+= 21
.include "../pjdfstest.test.mk"

View File

@ -0,0 +1,20 @@
# $FreeBSD$
TAP_TESTS_SH= 00
TAP_TESTS_SH+= 01
TAP_TESTS_SH+= 02
TAP_TESTS_SH+= 03
TAP_TESTS_SH+= 04
TAP_TESTS_SH+= 05
TAP_TESTS_SH+= 06
TAP_TESTS_SH+= 07
TAP_TESTS_SH+= 08
TAP_TESTS_SH+= 09
TAP_TESTS_SH+= 10
TAP_TESTS_SH+= 11
TAP_TESTS_SH+= 12
TAP_TESTS_SH+= 13
TAP_TESTS_SH+= 14
TAP_TESTS_SH+= 15
.include "../pjdfstest.test.mk"

View File

@ -0,0 +1,17 @@
# $FreeBSD$
TAP_TESTS_SH= 00
TAP_TESTS_SH+= 01
TAP_TESTS_SH+= 02
TAP_TESTS_SH+= 03
TAP_TESTS_SH+= 04
TAP_TESTS_SH+= 05
TAP_TESTS_SH+= 06
TAP_TESTS_SH+= 07
TAP_TESTS_SH+= 08
TAP_TESTS_SH+= 09
TAP_TESTS_SH+= 10
TAP_TESTS_SH+= 11
TAP_TESTS_SH+= 12
.include "../pjdfstest.test.mk"

View File

@ -0,0 +1,19 @@
# $FreeBSD$
TAP_TESTS_SH= 00
TAP_TESTS_SH+= 01
TAP_TESTS_SH+= 02
TAP_TESTS_SH+= 03
TAP_TESTS_SH+= 04
TAP_TESTS_SH+= 05
TAP_TESTS_SH+= 06
TAP_TESTS_SH+= 07
TAP_TESTS_SH+= 08
TAP_TESTS_SH+= 09
TAP_TESTS_SH+= 10
TAP_TESTS_SH+= 11
TAP_TESTS_SH+= 12
TAP_TESTS_SH+= 13
TAP_TESTS_SH+= 14
.include "../pjdfstest.test.mk"

View File

@ -0,0 +1,18 @@
# $FreeBSD$
TAP_TESTS_SH= 00
TAP_TESTS_SH+= 01
TAP_TESTS_SH+= 02
TAP_TESTS_SH+= 03
TAP_TESTS_SH+= 04
TAP_TESTS_SH+= 05
TAP_TESTS_SH+= 06
TAP_TESTS_SH+= 07
TAP_TESTS_SH+= 08
TAP_TESTS_SH+= 09
TAP_TESTS_SH+= 10
TAP_TESTS_SH+= 11
TAP_TESTS_SH+= 12
TAP_TESTS_SH+= 13
.include "../pjdfstest.test.mk"

View File

@ -4068,9 +4068,10 @@ OLD_DIRS+=usr/share/sendmail/cf
OLD_DIRS+=usr/share/sendmail
.endif
#.if ${MK_SHAREDOCS} == no
# to be filled in
#.endif
.if ${MK_SHAREDOCS} == no
OLD_FILES+=usr/share/doc/pjdfstest/README
OLD_DIRS+=usr/share/doc/pjdfstest
.endif
#.if ${MK_SYSCONS} == no
# to be filled in