Commit Graph

15 Commits

Author SHA1 Message Date
Alan Somers
b43a935cae Resolve conflict between the fusefs(5) and mac_bsdextended(4) tests
mac_bsdextended(4), when enabled, causes ordinary operations to send many
more VOP_GETATTRs to file system. The fusefs tests expectations aren't
written with those in mind. Optionally expecting them would greatly
obfuscate the fusefs tests. Worse, certain fusefs functionality (like
attribute caching) would be impossible to test if the tests couldn't expect
an exact number of GETATTR operations.

This commit resolves that conflict by making two changes:

1. The fusefs tests will now check for mac_bsdextended, and skip if it's
   enabled.
2. The mac_bsdextended tests will now check whether the module is enabled, not
   merely loaded. If it's loaded but disabled, the tests will automatically
   enable it for the duration of the tests.

With these changes, a CI system can achieve best coverage by loading both
fusefs and mac_bsdextended at boot, and setting
security.mac.bsdextended.enabled=0

PR:		244229
Reported by:	lwhsu
Reviewed by:	cem
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D24577
2020-05-02 20:14:59 +00:00
Alan Somers
db20acc029 mac_bsdextended: ATFify the tests
The new tests have more complete setup and cleanup, are more granular, and
correctly annotate expected failures and skipped tests. A follow-up commit
will resolve a conflict with the fusefs tests (bug 244229).

MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D24257
2020-04-26 15:51:46 +00:00
Bryan Drewery
ea825d0274 DIRDEPS_BUILD: Update dependencies.
Sponsored by:	Dell EMC Isilon
2017-10-31 00:07:04 +00:00
Enji Cooper
00ea8a5fc9 Fix -Wformat issue
Use %zu for printing out results from nitems, as it's size_t based

MFC after:	1 week
X-MFC with:	r312120
Reported by:	gcc (mips:mipsel tinderbox)
Sponsored by:	Dell EMC Isilon
2017-01-14 10:38:39 +00:00
Enji Cooper
f614ceaf4a Fix warnings
- Staticize test_num
- Promote i to size_t to deal with -Wsign-compare issues

Tested with:	clang, gcc, gcc49
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2017-01-14 05:18:18 +00:00
Enji Cooper
a85d4fc7e4 Only chmod $TMPDIR if it's not /tmp
This is a safety belt to ensure that the /tmp sticky bit stuff doesn't
get whacked by accident if someone runs the script outright

MFC after:	1 week
X-MFC with:	r305916
Sponsored by:	Dell EMC Isilon
2016-09-18 05:10:15 +00:00
Enji Cooper
9cd2207265 Make sure $TMPDIR is created with 0755 permissions
This is required to ensure that the temporary script can be executed,
as the default mode is apparently too restrictive

MFC after:	3 days
Sponsored by:	Dell EMC Isilon
2016-09-18 05:06:15 +00:00
Enji Cooper
3919472360 Skip testcases 9/10 if jail(8) isn't installed
These testcases require jail support

MFC after:	1 week
Sponsored by:	EMC / Isilon Storage Division
2016-09-03 17:59:46 +00:00
Enji Cooper
430f7286a5 Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed
after r298107

Summary of changes:

- Replace all instances of FILES/TESTS with ${PACKAGE}FILES. This ensures that
  namespacing is kept with FILES appropriately, and that this shouldn't need
  to be repeated if the namespace changes -- only the definition of PACKAGE
  needs to be changed
- Allow PACKAGE to be overridden by callers instead of forcing it to always be
  `tests`. In the event we get to the point where things can be split up
  enough in the base system, it would make more sense to group the tests
  with the blocks they're a part of, e.g. byacc with byacc-tests, etc
- Remove PACKAGE definitions where possible, i.e. where FILES wasn't used
  previously.
- Remove unnecessary TESTSPACKAGE definitions; this has been elided into
  bsd.tests.mk
- Remove unnecessary BINDIRs used previously with ${PACKAGE}FILES;
  ${PACKAGE}FILESDIR is now automatically defined in bsd.test.mk.
- Fix installation of files under data/ subdirectories in lib/libc/tests/hash
  and lib/libc/tests/net/getaddrinfo
- Remove unnecessary .include <bsd.own.mk>s (some opportunistic cleanup)

Document the proposed changes in share/examples/tests/tests/... via examples
so it's clear that ${PACKAGES}FILES is the suggested way forward in terms of
replacing FILES. share/mk/bsd.README didn't seem like the appropriate method
of communicating that info.

MFC after: never probably
X-MFC with: r298107
PR: 209114
Relnotes: yes
Tested with: buildworld, installworld, checkworld; buildworld, packageworld
Sponsored by: EMC / Isilon Storage Division
2016-05-04 23:20:53 +00:00
Glen Barber
7d536dc855 MFH
Sponsored by:	The FreeBSD Foundation
2016-03-10 21:16:01 +00:00
Bryan Drewery
15c433351f DIRDEPS_BUILD: Connect MK_TESTS.
Sponsored by:	EMC / Isilon Storage Division
2016-03-09 22:46:01 +00:00
Glen Barber
2aa00a6001 More 'tests' package fixes.
Sponsored by:	The FreeBSD Foundation
2016-02-03 00:34:23 +00:00
Enji Cooper
013829494e Delete the comment about running test_libugidfw_strings before testing
`mac_is_present` so it doesn't accidentally confuse people

MFC after: 3 days
X-MFC with: r292650
Sponsored by: EMC / Isilon Storage Division
2015-12-23 10:02:51 +00:00
Enji Cooper
ad25988f4c Move mac_bsdextended check up before running the test_libugidfw_strings testcases
I realize that these tests could be run before mac_bsdextended is loaded, but
it would overcomplicate things to special case handle the testcases before doing
the mac_bsdextended(4) feature check

The testcases will be split up so they can be run separately in the near future

MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division
2015-12-23 09:59:31 +00:00
Enji Cooper
870c2f7af9 Integrate tools/regression/mac/mac_bsdextended and
tools/regression/mac/mac_portacl into the FreeBSD test suite as
tests/sys/mac/bsdextended and tests/sys/mac/portacl, respectively

MFC after: 1 month
Sponsored by: EMC / Isilon Storage Division
2015-12-21 21:24:03 +00:00