Commit Graph

229 Commits

Author SHA1 Message Date
Alan Somers
0e125f5ff8 fuse(4): combine common code in the tests
Combine a bunch of mostly similar expect_* methods into utils.cc, and only
define FH in a single place.

Sponsored by:	The FreeBSD Foundation
2019-03-14 00:12:59 +00:00
Alan Somers
ef61047a9b fuse(4): add tests for POSIX file locking operations
PR:		234581
Sponsored by:	The FreeBSD Foundation
2019-03-13 22:16:00 +00:00
Alan Somers
1bb6c55076 fues(4): add tests for FUSE_RELEASEDIR
Sponsored by:	The FreeBSD Foundation
2019-03-13 13:41:05 +00:00
Alan Somers
0f10547be1 fuse(4): add tests for opendir and readdir
Sponsored by:	The FreeBSD Foundation
2019-03-12 22:25:59 +00:00
Alan Somers
4459896e18 fuse(4): add tests for FUSE_OPENDIR, FUSE_FSYNC, and FUSE_FSYNCDIR
And one more for FUSE_WRITE, too.

PR:		236379
PR:		236473
PR:		236474
Sponsored by:	The FreeBSD Foundation
2019-03-11 22:29:56 +00:00
Alan Somers
da1200c90f Update copyright info in fuse tests
* Add SPDX tags
* Remove "All Rights Reserved", with permission of emaste (FBSD Foundation)

Reported by:	emaste
Sponsored by:	The FreeBSD Foundation
2019-03-11 19:10:48 +00:00
Alan Somers
e825cfb775 fuse(4): add tests for FUSE_READ
PR:		236379
PR:		236466
PR:		236472
Sponsored by:	The FreeBSD Foundation
2019-03-11 18:28:20 +00:00
Alan Somers
e071c64b4c fuse(4): Add some tests for FUSE_FLUSH
PR:		236405
Sponsored by:	The FreeBSD Foundation
2019-03-08 23:07:51 +00:00
Alan Somers
1d882fd6a1 fuse(4): add tests for FUSE_WRITE and FUSE_RELEASE
And a few definitions needed for upcoming FUSE_READ tests

Sponsored by:	The FreeBSD Foundation
2019-03-08 19:01:31 +00:00
Alan Somers
c2e7dba7f8 fuse(4): add tests relating to open(2) flags
Sponsored by:	The FreeBSD Foundation
2019-03-07 18:12:34 +00:00
Alan Somers
c7c8f59051 fuse(4): add tests for unlink, rmdir, and statfs
Also, combine some common code for sending cacheable negative lookup
responses.

Sponsored by:	The FreeBSD Foundation
2019-03-06 00:38:10 +00:00
Alan Somers
9b4318e553 fuse(4): add test cases for FUSE_LINK and FUSE_RENAME
Also, add a FUSE_LOOKUP test case for subdirectories, and improve debugging
output.

Sponsored by:	The FreeBSD Foundation
2019-03-05 21:40:08 +00:00
Alan Somers
50deb1a8c2 fuse(4): add tests for FUSE_MKDIR and FUSE_ACCESS
PR:		236291
PR:		236231
Sponsored by:	The FreeBSD Foundation
2019-03-05 18:53:28 +00:00
Alan Somers
76effb87dc fuse(4): combine some common code in the tests
Sponsored by:	The FreeBSD Foundation
2019-03-05 03:27:32 +00:00
Alan Somers
4cbb4f8886 fuse(4): add tests related to FUSE_MKNOD
PR:		236236
Sponsored by:	The FreeBSD Foundation
2019-03-05 00:27:54 +00:00
Alan Somers
99fe8368c2 fuse(4): add tests for CREATE, OPEN, READLINK, SETATTR and SYMLINK
The new SETATTR tests deal with already-open files.

PR:		235775
PR:		236231
Sponsored by:	The FreeBSD Foundation
2019-03-04 22:07:33 +00:00
Alan Somers
2343311052 fuse(4): fix the entry_cache_negative_timeout test
I committed too soon in r344775; the test actually passes when I write it
correctly.

PR:		236226
Sponsored by:	The FreeBSD Foundation
2019-03-04 22:03:09 +00:00
Alan Somers
56f07a9855 fuse(4): add tests for negative lookups
PR:		236226
Sponsored by:	The FreeBSD Foundation
2019-03-04 19:10:22 +00:00
Alan Somers
8eeb82e169 fuse(4) use a global environment check.
This is marginally faster than using an environment check in each test case.
Also, if the global check fails then all of the tests are skipped.  Oddly,
it's not possible to skip a test in any other way.

Also, allow the test to run as a normal user if vfs.usermount=1 and
/dev/fuse is accessible.

Reported by:	ngie
Sponsored by:	The FreeBSD Foundation
2019-03-02 16:28:29 +00:00
Alan Somers
7716c35f77 Add some fuse(4) tests for FUSE_SETATTR
Sponsored by:	The FreeBSD Foundation
2019-03-02 15:32:20 +00:00
Alan Somers
44154e682a Begin a fuse(4) test suite
It only tests the kernel portion of fuse, not the userspace portion (which
comes from sysutils/fusefs-libs).  The kernel-userspace interface is
de-facto standardized, and this test suite seeks to validate FreeBSD's
implementation.

It uses GoogleMock to substitute for a userspace daemon and validate the
kernel's behavior in response to filesystem access.  GoogleMock is
convenient because it can validate the order, number, and arguments of each
operation, and return canned responses.

But that also means that the test suite must use GoogleTest, since
GoogleMock is incompatible with atf-c++ and atf.test.mk does not allow C++
programs to use atf-c.

This commit adds the first 10 test cases out of an estimated 130 total.

PR:		235775, 235773
Sponsored by:	The FreeBSD Foundation
2019-03-01 23:53:05 +00:00
Alan Somers
8cadd66d98 Fix sys.fs.tmpfs.mknod_test.{char, block} by reverting r321967
In r321967 ngie "fixed" these tests by changing their expectations to match
the device numbers produced by the new ino64 code.  But it wasn't the tests
that were broken, it was the kernel.  bde fixed the kernel in r335053.

Reported by:	Jenkins
MFC after:	Never (only applies to >= 12)
2018-07-21 20:14:01 +00:00
Bryan Drewery
3806950135 DIRDEPS_BUILD: Connect new directories.
Sponsored by:	Dell EMC Isilon
2017-10-31 00:04:07 +00:00
Enji Cooper
acc33f3de9 Chase r321920 and r321930 (dev_t being widened)
The layout of st_rdev has changed after this commit, and assumptions made
in the NetBSD tests are no longer valid. Change the hardcoded assumed
values to account for the fact that major/minor are now represented by
64 bits as opposed to the less precise legacy precision of 16 bits.

PR:	221048
Relnotes: st_rdev layout changed; warning about impact of r321920 to
	  downstream consumers
2017-08-03 03:43:41 +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
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
4944940b4e Add include Makefiles for tests/sys/{fs,kern,kqueue,mac}/...
The primary goal for doing this is to leverage the work done in r312114
for enabling WARNS to address trivial code quality issues with new tests

MFC after:	6 days
Tested with:	make tinderbox
Sponsored by:	Dell EMC Isilon
2017-01-14 20:21:21 +00:00
Enji Cooper
669c253531 Integrate contrib/netbsd-tests/fs/tmpfs into the FreeBSD test suite
as tests/sys/fs

These testcases exercise tmpfs support

MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
2016-10-21 05:24:08 +00:00