summaryrefslogtreecommitdiffstats
path: root/tests/sys
diff options
context:
space:
mode:
authorngie <ngie@FreeBSD.org>2016-12-07 06:57:08 +0000
committerngie <ngie@FreeBSD.org>2016-12-07 06:57:08 +0000
commit12f62f402e9ef9fd7e745e607c523dc2ff98970a (patch)
tree6c2d9f3ad13155b9ae75a79fdc053c45798e5777 /tests/sys
parentd2a105113f17e2b1ed40bc82f595725e238f295a (diff)
downloadFreeBSD-src-12f62f402e9ef9fd7e745e607c523dc2ff98970a.zip
FreeBSD-src-12f62f402e9ef9fd7e745e607c523dc2ff98970a.tar.gz
MFC r306030,r306031,r306033,r306036,r306038,r307190,r307196,r307204,r307205,r307701,r307702:
r306030: Port vnode_leak_test:main to FreeBSD Use a simpler way of dumping kern.maxvnodes, i.e. `sysctl -n kern.maxvnodes` The awk filtering method employed in NetBSD doesn't work on FreeBSD r306031: Port contrib/netbsd-tests/fs/h_funcs.subr to FreeBSD Use kldstat -m to determine whether or not a filesystem is loaded. This works well with tmpfs, ufs, and zfs r306033: Port sizes_test and statvfs_test to FreeBSD Similar to r306030, use a simpler method for getting the value of `hw.pagesize`, i.e. `sysctl -n hw.pagesize`. The awk filtering method doesn't work on FreeBSD r306036: Port to mknod_test and readdir_test to FreeBSD The `mknod <file> p` command doesn't exist on FreeBSD, like on NetBSD. Use mkfifo instead to create named pipes (FIFOs). r306038: Port vnd_test to FreeBSD Use mdmfs/mdconfig instead of vndconfig/newfs. vndconfig doesn't exist on FreeBSD. TODO: need to parameterize out the md(4) device as it's currently hardcoded to "3" (in both the FreeBSD and NetBSD cases). r307190: Skip :uchg on FreeBSD Unfortunately removing files with uchg set always succeeds with root on FreeBSD. Unfortunately running the test as an unprivileged user isn't doable because mounting tmpfs requires root PR: 212861 r307196: Port contrib/netbsd-tests/fs/tmpfs/h_tools.c to FreeBSD - Add inttypes.h #include for PRId64 macro - Use FreeBSD's copy of getfh(2), which doesn't include a `fh_size` parameter. Use sizeof(fhandle_t) instead as the size of fhp is always fixed as fhandle_t, unlike NetBSD's copy of fhp, which is void*. r307204: Expect :large to fail on FreeBSD FreeBSD doesn't appear to validate large -o size values like NetBSD does PR: 212862 r307205: Change atf_skip call to atf_expect_fail to make it clear that a failure is expected PR: 212861 Suggested by: jmmv r307701: Expect tests/sys/fs/tmpfs/link_test:kqueue to fail It fails with: "dir/b did not receive NOTE_LINK" Also, add needed cleanup logic to cleanup the mountpoint after the fact PR: 213662 r307702: Integrate contrib/netbsd-tests/fs/tmpfs into the FreeBSD test suite as tests/sys/fs These testcases exercise tmpfs support
Diffstat (limited to 'tests/sys')
-rw-r--r--tests/sys/Makefile1
-rw-r--r--tests/sys/fs/Makefile23
-rw-r--r--tests/sys/fs/tmpfs/Makefile56
3 files changed, 80 insertions, 0 deletions
diff --git a/tests/sys/Makefile b/tests/sys/Makefile
index 682e21c..1bcd76e 100644
--- a/tests/sys/Makefile
+++ b/tests/sys/Makefile
@@ -6,6 +6,7 @@ TESTS_SUBDIRS+= acl
TESTS_SUBDIRS+= aio
TESTS_SUBDIRS+= fifo
TESTS_SUBDIRS+= file
+TESTS_SUBDIRS+= fs
TESTS_SUBDIRS+= geom
TESTS_SUBDIRS+= kern
TESTS_SUBDIRS+= kqueue
diff --git a/tests/sys/fs/Makefile b/tests/sys/fs/Makefile
new file mode 100644
index 0000000..c82ee14
--- /dev/null
+++ b/tests/sys/fs/Makefile
@@ -0,0 +1,23 @@
+# $FreeBSD$
+
+PACKAGE= tests
+
+TESTSDIR= ${TESTSBASE}/sys/fs
+
+TESTSRC= ${SRCTOP}/contrib/netbsd-tests/fs
+
+#TESTS_SUBDIRS+= nullfs # XXX: needs rump
+TESTS_SUBDIRS+= tmpfs
+
+${PACKAGE}FILES+= h_funcs.subr
+${PACKAGE}FILESDIR= ${TESTSDIR}
+
+CLEANFILES+= h_funcs.subr
+CLEANFILES+= h_funcs.subr.tmp
+
+h_funcs.subr: ${TESTSRC}/h_funcs.subr
+ cat ${.ALLSRC} | \
+ sed -e '/atf_require_prog mount_$${name}/d' >>${.TARGET}.tmp
+ mv ${.TARGET}.tmp ${.TARGET}
+
+.include <bsd.test.mk>
diff --git a/tests/sys/fs/tmpfs/Makefile b/tests/sys/fs/tmpfs/Makefile
new file mode 100644
index 0000000..63facd1
--- /dev/null
+++ b/tests/sys/fs/tmpfs/Makefile
@@ -0,0 +1,56 @@
+# $FreeBSD$
+
+PACKAGE= tests
+
+FILESYSTEM?= ${.CURDIR:T}
+
+TESTSDIR= ${TESTSBASE}/sys/fs/${FILESYSTEM}
+
+TESTSRC= ${SRCTOP}/contrib/netbsd-tests/fs/${FILESYSTEM}
+
+# XXX: uses /dev/MAKEDEV to create pseudo /dev/{null,zero} character devices
+#NETBSD_ATF_TESTS_SH+= devices_test
+NETBSD_ATF_TESTS_SH+= create_test
+NETBSD_ATF_TESTS_SH+= read_write_test
+NETBSD_ATF_TESTS_SH+= dots_test
+NETBSD_ATF_TESTS_SH+= exec_test
+NETBSD_ATF_TESTS_SH+= link_test
+NETBSD_ATF_TESTS_SH+= mkdir_test
+NETBSD_ATF_TESTS_SH+= mknod_test
+NETBSD_ATF_TESTS_SH+= mount_test
+# XXX: need to replace `mknod ... p` with something more sensible
+#NETBSD_ATF_TESTS_SH+= pipes_test
+NETBSD_ATF_TESTS_SH+= trail_slash_test
+NETBSD_ATF_TESTS_SH+= readdir_test
+NETBSD_ATF_TESTS_SH+= remove_test
+NETBSD_ATF_TESTS_SH+= rename_test
+NETBSD_ATF_TESTS_SH+= rmdir_test
+NETBSD_ATF_TESTS_SH+= setattr_test
+NETBSD_ATF_TESTS_SH+= sizes_test
+NETBSD_ATF_TESTS_SH+= sockets_test
+NETBSD_ATF_TESTS_SH+= statvfs_test
+NETBSD_ATF_TESTS_SH+= symlink_test
+NETBSD_ATF_TESTS_SH+= times_test
+NETBSD_ATF_TESTS_SH+= truncate_test
+NETBSD_ATF_TESTS_SH+= vnd_test
+NETBSD_ATF_TESTS_SH+= vnode_leak_test
+
+${PACKAGE}FILES+= h_funcs.subr
+${PACKAGE}FILESDIR= ${TESTSDIR}
+
+PROGS+= h_tools
+BINDIR.h_tools= ${TESTSDIR}
+
+ATF_TESTS_SH_SED_mount_test= \
+ -e 's,-o -g,-o gid=,g' \
+ -e 's,-o -m,-o mode=,g' \
+ -e 's,-o -s,-o size=,g' \
+ -e 's,-o -u,-o uid=,g' \
+ -e 's,mount_${FILESYSTEM},mount -t ${FILESYSTEM},g'
+ATF_TESTS_SH_SED_sizes_test= -e 's,-o -s,-o size=,g'
+ATF_TESTS_SH_SED_statvfs_test= -e 's,-o -s,-o size=,g'
+ATF_TESTS_SH_SED_vnode_leak_test= -e 's,-o -s,-o size=,g'
+
+.include <netbsd-tests.test.mk>
+
+.include <bsd.test.mk>
OpenPOWER on IntegriCloud