Commit Graph

29 Commits

Author SHA1 Message Date
Mitchell Horne
6955543a88 tmpfs tests: check for built-in tmpfs module
As of r363471, tmpfs is included in all GENERIC kernel configs. This
results in a warning being emitted for each call to kldload(8):

module_register: cannot register tmpfs from tmpfs.ko; already loaded from kernel

Check for the presence of the module via kldstat first to quiet this
warning.

Reviewed by:	asomers, arichardson
Differential Revision:	https://reviews.freebsd.org/D26632
2020-10-02 00:52:31 +00:00
Li-Wen Hsu
4653454ee8 Revert r249362, atime update in tmpfs is fixed in r365810
PR:		249362
Sponsored by:	The FreeBSD Foundation
2020-09-17 07:13:41 +00:00
Li-Wen Hsu
6132212808 Temporarily skip sys.fs.tmpfs.times_test.{empty,non_empty} in CI
PR:		249362
Sponsored by:	The FreeBSD Foundation
2020-09-16 09:58:15 +00:00
Alan Somers
46e1f0715d Fix tmpfs detection in the sys/fs/tmpfs tests
This code was originally written for NetBSD.  r306031 tried to adapt it to
FreeBSD, but didn't correctly handle the case that tmpfs was available, but
not already loaded.  Fix the logic to load the module if necessary.  The
tmpfs tests shouldn't be skipped anymore.

Also, fix a comment that was dislocated by r306031.

Reported by:	Jenkins
MFC after:	2 weeks
2018-07-21 23:54:40 +00:00
Enji Cooper
99429157e8 sys/fs/tmpfs/vnd_test: make md(4) allocation dynamic
The previous logic was flawed in the sense that it assumed that /dev/md3
was always available. This was a caveat I noted in r306038, that I hadn't
gotten around to solving before now.

Cache the device for the mountpoint after executing mdmfs, then use the
cached value in basic_cleanup(..) when unmounting/disconnecting the md(4)
device.

Apply sed expressions to use reuse logic in the NetBSD code that could
also be applied to FreeBSD, just with different tools.

Differential Revision:	D10766
MFC after:	1 week
Reviewed by:	bdrewery
Sponsored by:	Dell EMC Isilon
2017-05-19 17:14:29 +00:00
Enji Cooper
dd66b5baa8 Merge in changes from ^/vendor/NetBSD/tests/dist@r313245
Diff reduce lib/libm/t_pow.c per upstream changes
2017-02-04 18:20:07 +00:00
Enji Cooper
183ae521e5 Use _SED instead of hacking tests rewriting mknod ... p as mkfifo
Similar to r312297
2017-01-16 17:53:58 +00:00
Enji Cooper
267f10b14c Use _SED to rewrite mknod ... p command as mkfifo instead of
adding an unnecessary diff to the test
2017-01-16 17:49:53 +00:00
Enji Cooper
63d1fd5970 Merge content currently under test from ^/vendor/NetBSD/tests/dist/@r312123
Sponsored by:	Dell EMC Isilon
2017-01-14 06:49:17 +00:00
Enji Cooper
792bbaba98 Remove contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind
This should have been pruned in r305358

MFC after:	3 days
Sponsored by:	Dell EMC Isilon
2017-01-14 06:16:57 +00:00
Enji Cooper
cdebaff820 Upgrade NetBSD tests to 01.11.2017_23.20 snapshot
This contains some new testcases in /usr/tests/...:

- .../lib/libc
- .../lib/libthr
- .../lib/msun
- .../sys/kern

Tested on:	amd64, i386
MFC after:	1 month
2017-01-13 03:33:57 +00:00
Enji Cooper
20a4ce8bf2 Redo fix for CID 979581
The previous change was flawed in terms of how it calculated the
buffer length for the sockaddr_un object. Use SUN_LEN where
appropriate and mute the Coverity complaint by using memset(.., 0, ..)
to zero out the entire structure instead of setting .sun_len to a bogus
value and strlcpy'ing in the contents of argv[1].

SUN_LEN is now being passed to bind(2) as well. For some odd reason
this wasn't flagged as a bug with Coverity.

Reported by:	jilles, jmallett
MFC after:	2 days
X-MFC with:	r311233
2017-01-05 07:46:57 +00:00
Enji Cooper
cc34906655 Fix Coverity issues
- Initialize .sun_len before passing it to strlcpy and bind.
- Close fd on error

MFC after:	3 days
Reported by:	Coverity
CID:		978283, 979581
2017-01-04 02:46:36 +00:00
Enji Cooper
5eabf0ffea Use _test_unmount instead of test_unmount in cleanup to avoid
false positives with atf_check when tmpfs is not loaded, etc

MFC after:	1 week
2016-12-09 23:44:25 +00:00
Enji Cooper
60fbebc327 - Ignore errors from umount
- Use _test_unmount instead of test_unmount in cleanup

MFC after:	1 week
2016-12-09 23:43:33 +00:00
Enji Cooper
5be335bb11 Make test_unmount usable in cleanup subroutines
- Duplicate test_unmount to _test_unmount
- Remove atf_check calls
- Call _test_unmount from test_unmount, checking the exit code
  at the end, and returning it to maintain the test_unmount
  "contract"

MFC after:	1 week
2016-12-09 23:42:04 +00:00
Enji Cooper
7f9dff23d3 Only run mdconfig -d -u 3 if /dev/md3 exists on the system
This will prevent "cleanup failures" (exit code != 0 returned) when
tmpfs is not loaded

MFC after:	1 week
2016-12-09 22:50:43 +00:00
Enji Cooper
def7fe87e9 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

MFC after:	2 weeks
PR:		213662
Sponsored by:	Dell EMC Isilon
2016-10-21 05:21:20 +00:00
Enji Cooper
3e5c48d95f Change atf_skip call to atf_expect_fail to make it clear that a failure is
expected

MFC after:	2 weeks
PR:		212861
Suggested by:	jmmv
Sponsored by:	Dell EMC Isilon
2016-10-13 08:35:08 +00:00
Enji Cooper
ac3628603c Expect :large to fail on FreeBSD
FreeBSD doesn't appear to validate large -o size values like
NetBSD does

MFC after:	2 weeks
PR:		212862
Sponsored by:	Dell EMC Isilon
2016-10-13 08:27:19 +00:00
Enji Cooper
12be646525 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*.

MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2016-10-13 07:32:25 +00:00
Enji Cooper
d01498defb 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
Sponsored by:	Dell EMC Isilon
2016-10-13 07:02:54 +00:00
Enji Cooper
43f24e2096 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).

MFC after:	1 month
Sponsored by:	Dell EMC Isilon
2016-09-20 16:40:15 +00:00
Enji Cooper
534501a247 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).

MFC after:	1 month
Sponsored by:	Dell EMC Isilon
2016-09-20 16:37:02 +00:00
Enji Cooper
548f948a56 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

MFC after:	1 month
Sponsored by:	Dell EMC Isilon
2016-09-20 16:31:57 +00:00
Enji Cooper
61e13648e7 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

MFC after:	1 month
Sponsored by:	Dell EMC Isilon
2016-09-20 16:28:57 +00:00
Enji Cooper
d3de062383 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

MFC after:	1 month
Sponsored by:	Dell EMC Isilon
2016-09-20 16:27:34 +00:00
Enji Cooper
640235e2c2 Checkpoint initial integration work
- Some of the lib/libc and lib/thr tests fail
- lib/msun/exp_test:exp2_values now passes with clang 3.8.0

The Makefiles in contrib/netbsd-tests were pruned as they have no value

Sponsored by: EMC / Isilon Storage Division
2016-08-12 08:50:05 +00:00
Enji Cooper
57718be8fa Import the NetBSD test suite from ^/vendor/NetBSD/tests/09.30.2014_20.45 ,
minus the vendor Makefiles

Provide directions for how to bootstrap the vendor sources in
FREEBSD-upgrade

MFC after 2 weeks
Discussed with: rpaulo
Sponsored by: EMC / Isilon Storage Division
2014-10-02 23:26:49 +00:00