Commit Graph

1282 Commits

Author SHA1 Message Date
Pietro Cerutti
ae5cb1b14b - Use strlen instead of hardcoding a number
- Terminate a sentence with a period

Approved by:	cognet
2014-06-03 07:11:22 +00:00
Pietro Cerutti
4c524a4287 - Return NULL and set errno to EINVAL if size is 0 (as required by POSIX).
Update the manpage to reflect this change.
- Always set the current position to the first null-byte when opening in append
mode. This makes the implementation compatible with glibc's. Update the test
suite.

Reported by:	pho
Approved by:	cognet
2014-06-02 13:48:57 +00:00
Warner Losh
c6063d0da8 Use src.opts.mk in preference to bsd.own.mk except where we need stuff
from the latter.
2014-05-06 04:22:01 +00:00
Dag-Erling Smørgrav
87a6395ab8 Note that the bug was fixed, and when. 2014-04-26 12:16:40 +00:00
Warner Losh
96267df325 Remove NO_CTF, exccept as an undocumented compatibility
option. Convert all other uses to MK_CTF=no. Set MK_CTF=no rather than
the indirect WITHOUT_CDDL in filemon regression. It is expected that
NO_CTF will be removed in FreeBSD 12 entirely.
2014-04-25 19:25:00 +00:00
Jilles Tjoelker
93a65e1b5f libc/stdio: Fail fdopen() on an execute-only fd.
An execute-only fd (opened with O_EXEC) allows neither read() nor write()
and is therefore incompatible with all stdio modes. Therefore, the [EINVAL]
error applies.

Also adjust the similar check in freopen() with a NULL path, even though
this checks an fd which is already from a FILE.
2014-04-21 17:40:23 +00:00
Jilles Tjoelker
9f36ecc590 libc: Add fopen() test to regression Makefile. 2014-04-21 12:39:35 +00:00
Warner Losh
3bdf775801 NO_MAN= has been deprecated in favor of MAN= for some time, go ahead
and finish the job. ncurses is now the only Makefile in the tree that
uses it since it wasn't a simple mechanical change, and will be
addressed in a future commit.
2014-04-13 05:21:56 +00:00
Julio Merino
2111435b59 errx prepends the program name to the message; don't do it by hand. 2014-03-19 12:52:49 +00:00
Julio Merino
34ed55723a Make the priv test program exit with non-zero if any failures are detected.
And, mind you, this already returns a failure :-/
2014-03-19 12:51:40 +00:00
Julio Merino
65c3cfc1aa Migrate tools/regression/usr.bin/pkill to the new tests layout.
Interestingly, the pkill tool lives in bin, not usr.bin.  Haven't bothered
to check if this is because the tool moved or because the tests were
originally added in the wrong place.
2014-03-19 12:46:04 +00:00
Julio Merino
d525bcd959 Migrate tools/regression/usr.bin/make/ to the new tests layout.
Note that these tests are for fmake, not bmake, and thus they are not
installed nor run when bmake is selected (the default).  Yes, I have
wasted a *ton* of time on moving tests for no real reason other than
ensuring they are not left behind.

But maybe, just maybe, it was not work in vain: the majority of these
tests also work with bmake and the few that don't may point at broken
stuff.  For example, the tests for the "archive" feature do not work
with bmake, but bmake's manpage and source tree seem to imply that they
should.  So... to be investigated later; need to poke sjg@.
2014-03-19 12:29:20 +00:00
Robert Watson
b881b8be1d Update most userspace consumers of capability.h to use capsicum.h instead.
auditdistd is not updated as I will make the change upstream and then do a
vendor import sometime in the next week or two.

MFC after:	3 weeks
2014-03-16 11:04:44 +00:00
Julio Merino
3a92d97ff0 Migrate most of tools/regression/usr.bin/ to the new tests layout.
I'm starting with the easy cases.  The leftovers need to be looked at a
bit more closely.

Note that this change _does_ modify the code of the old tests.  This is
required in order to allow the code to locate the data files in the
source directory instead of the current directory, because Kyua
automatically changes the latter to a temporary directory.

Also note that at least one test is known to be broken here.  Actually,
the test is not really broken: it's marked as a TODO but unfortunately
Kyua's TAP parser currently does not understand that.  Will have to be
fixed separately.
2014-03-16 08:04:06 +00:00
Julio Merino
d14afb2adc Migrate tools/regression/{usr.bin/lastcomm,usr.sbin}/ to the new tests layout.
This change was originally going to only migrate the usr.sbin tests but, as
it turns out, the usr.sbin/sa/ tests require files from usr.bin/lastcomm/
so it's better to just also migrate the latter at the same time.  The other
usr.bin tests will be moved separately.

To make these tests work within the test suite, some of them have required
changes to prevent modifying the source directory and instead just rely on
the current directory for file manipulation.
2014-03-16 04:09:22 +00:00
Julio Merino
5bc38acbf6 Change etcupdate tests to return 1 on test failures.
This is a prerequisite for hooking these tests into the test suite.  And,
fortunately, all tests seem to pass!
2014-03-16 02:27:27 +00:00
Julio Merino
c68de7484a Migrate tools/regression/sbin/ to the new tests layout.
Pretty much all that this change does is shuffles the code around and hooks
it into the regular build.  The code of the old tests has not changed.
2014-03-16 02:07:08 +00:00
Gleb Smirnoff
45c203fce2 Remove AppleTalk support.
AppleTalk was a network transport protocol for Apple Macintosh devices
in 80s and then 90s. Starting with Mac OS X in 2000 the AppleTalk was
a legacy protocol and primary networking protocol is TCP/IP. The last
Mac OS X release to support AppleTalk happened in 2009. The same year
routing equipment vendors (namely Cisco) end their support.

Thus, AppleTalk won't be supported in FreeBSD 11.0-RELEASE.
2014-03-14 06:29:43 +00:00
Gleb Smirnoff
2c284d9395 Remove IPX support.
IPX was a network transport protocol in Novell's NetWare network operating
system from late 80s and then 90s. The NetWare itself switched to TCP/IP
as default transport in 1998. Later, in this century the Novell Open
Enterprise Server became successor of Novell NetWare. The last release
that claimed to still support IPX was OES 2 in 2007. Routing equipment
vendors (e.g. Cisco) discontinued support for IPX in 2011.

Thus, IPX won't be supported in FreeBSD 11.0-RELEASE.
2014-03-14 02:58:48 +00:00
Julio Merino
0dc2dd5381 Remove broken tests for eui64_line.
This function is not public and brooks (initial committer adding the code)
suggests the deletion of the tests (which I don't know if they work)
instead of changing the visibility of the function.
2014-03-12 10:59:51 +00:00
Julio Merino
b83f6294d2 Make the strerror tests work without libtap.
Just replace the simple calls to the library with ad-hoc code.  We should
later rewrite these with the ATF libraries anyway, which are part of the
base system.
2014-03-12 10:45:22 +00:00
Julio Merino
23d11c12ba Turn a test precondition into a skip in the mdconfig tests.
Tests that cannot be run because a precondition is not met should be
marked as skipped, not failed.  Do this for the tests in mdconfig that
first check if the caller user is root.
2014-03-12 10:42:58 +00:00
Julio Merino
a742501181 Fix sa tests.
Small divergences in the output padding made some sa tests fail.  Just
trim all whitespace from the outputs and the golden files so comparisons
are less fragile and the tests pass again.
2014-03-12 10:41:14 +00:00
Julio Merino
03a7bb948d Only run the make tests when make is fmake.
Because bmake is the default make being built, many of the tests here
fail due to differences between the two.  Just skip the tests for now
when using fmake.
2014-03-12 10:38:32 +00:00
Julio Merino
a6a6c004f9 Fix lastcomm tests under amd64.
Force the use of TZ=UTC and adjust data files accordingly.  I have no means
to verify that the data files for the other architectures are valid.
2014-03-12 10:35:22 +00:00
Julio Merino
6f402eb3cc Fix ncal tests so that they run cleanly with prove.
Basically just make the test plan match what is actually being run.
2014-03-09 22:16:39 +00:00
Julio Merino
fb3e85e1dc Fix pkill tests so that they run cleanly with prove.
This fixes a pgrep test that assumed that PID 2 was named g_event.  This
does not seem to be the case any longer (and I don't know if it ever was
in all possible setups).

Change this test to use the idle loop instead and determine its expected
PID using ps without assuming any specific ID.
2014-03-09 22:14:20 +00:00
Julio Merino
385cd39138 Fix yacc tests so that they run cleanly with prove.
First, change the driver to run the installed yacc instead of the one from
/usr/obj (which might not be there), just as we (intend to) do with all
other tests.

Second, regenerate the expected output files from scratch.  Based on visual
inspection, the differences seem OK.  But this highlights that the tests in
here are too fragile and, possibly, useless: we should be testing the
behavior of the generated program, not the literal output.  Something to be
addressed later.
2014-03-09 22:05:23 +00:00
Julio Merino
e199cf8185 Fix sed tests so that they run cleanly with prove. 2014-03-09 21:56:29 +00:00
Julio Merino
68f5aa61eb Fix printf tests so that they run cleanly with prove. 2014-03-09 19:37:01 +00:00
Julio Merino
a3c2c920d3 Fix m4 tests so that they run cleanly with prove. 2014-03-09 19:25:53 +00:00
Christian Brueffer
bb7a82ac0d Use CAP_EVENT instead of the deprecated CAP_POLL_EVENT.
PR:		185382 (based on)
Submitted by:	Loganaden Velvindron
Reviewed by:	pjd
MFC after:	1 week
2014-02-06 21:36:14 +00:00
Gleb Smirnoff
76c1988620 Add test case for kern/181741. Right now test fails.
PR:		181741
Sponsored by:	Nginx, Inc.
2014-02-06 13:18:10 +00:00
Alan Somers
a8eb96d593 Replace the old unix_seqpacket and unix_seqpacket_exercise tests, which
were a little broken and not automatable, with unix_seqpacket_test.
It's coverage is a superset of the old tests and it uses ATF.  It
includes test cases for bugs kern/185813 and kern/185812.

PR:		kern/185812
PR:		kern/185813
Sponsored by:	Spectra Logic
MFC after:	2 weeks
2014-01-23 17:26:28 +00:00
Pawel Jakub Dawidek
b298769db3 MFp4 @1189766:
- Compile the tests with .t suffix, so prove can use them directly.
- The CHECKX() macro should increment ntest just like the CHECK() macro.
- For consistency remove # from the pwd.t output.

Submitted by:	Mariusz Zaborski <oshogbo@FreeBSD.org>
2014-01-04 09:25:27 +00:00
Julio Merino
13de33a5dc Migrate tools/regression/bin/ tests to the new layout.
This change is a proof of concept on how to easily integrate existing
tests from the tools/regression/ hierarchy into the /usr/tests/ test
suite and on how to adapt them to the new layout for src.

To achieve these goals, this change:

- Moves tests from tools/regression/bin/<tool>/ to bin/<tool>/tests/.
- Renames the previous regress.sh files to legacy_test.sh.
- Adds Makefiles to build and install the tests and all their supporting
  data files into /usr/tests/bin/.
- Plugs the legacy_test test programs into the test suite using the new
  TAP backend for Kyua (appearing in 0.8) so that the code of the test
  programs does not have to change.
- Registers the new directories in the BSD.test.dist mtree file.

Reviewed by:	freebsd-testing
Approved by:	rpaulo (mentor)
2013-12-11 04:09:17 +00:00
John Baldwin
3e920822b7 - Refresh /etc/localtime after each update using tzsetup -r.
- Regenerate /var/db/services.db when /etc/services changes.

MFC after:	1 week
2013-12-09 19:31:30 +00:00
Eitan Adler
df8fcc1468 Add regression test for recently added 'i' flag in r259132.
PR:	standards/184641
2013-12-09 19:13:16 +00:00
Pawel Jakub Dawidek
ca9aa9026b Regression tests for existing Casper services.
Sponsored by:	The FreeBSD Foundation
2013-12-02 17:01:01 +00:00
Jilles Tjoelker
1b57cec7d9 sh: Make <&0 disable the </dev/null implicit in a background command.
Although <&0 does nothing, it is a redirection affecting standard input and
should therefore disable the </dev/null redirection implicit in a background
command.
2013-11-24 23:12:13 +00:00
Jilles Tjoelker
82baac5777 sh: Add more tests for the </dev/null implicit in a background command. 2013-11-24 22:45:49 +00:00
Jilles Tjoelker
c2fd50d77a sh: Add tests for the </dev/null implicit in a background command. 2013-11-22 21:50:13 +00:00
Andriy Gapon
d9b7800b54 fsx: add an option to randomly call msync(MS_INVALIDATE)
This call should be a sufficiently close approximation of what happens
when a filesystem is unmounted and remounted.  To be more specific, it
should test that the data that was in the page cache is the same data
that ends up on a stable storage or in a filesystem's internal cache,
if any.
This will catch the cases where a page with modified data is marked as
a clean page for whatever reason.

While there, make logging of the special events (open+close before
plus invalidation now) more generic and slightly better than the previous
hack.

MFC after:	10 days
2013-11-19 18:35:38 +00:00
Andriy Gapon
2f0f2d0f38 fsx: new option to disable msync(MS_SYNC) after each write via mmaped region
This option should be useful for testing if a filesystem uses the
unified buffer / page cache.
Or, if filesystem's emulation of the unified cache works as expected.
This should be the case for e.g. ZFS.

MFC after:	1 week
2013-11-19 18:35:01 +00:00
John Baldwin
8cc81f38e9 Fix a couple of issues with -F:
- Fix ALWAYS_INSTALL to take precedence over the FreeBSD ID checks.
  In particular, always install a file where the only change was
  the FreeBSD ID even if -F is specified.
- Fix the -F option in the case that the only upstream change is a
  change in the FreeBSD ID and the local file is removed.
- Add tests for these two cases.
2013-11-15 20:01:07 +00:00
Pawel Jakub Dawidek
3baf1859b4 Regression tests for the libnv library.
Sponsored by:	The FreeBSD Foundation
2013-11-12 20:31:16 +00:00
John Baldwin
21d1f635ee Add a pre-world mode of updating similar to the -p option that can be
passed to mergemaster.  In this mode, only changes to /etc/master.passwd
and /etc/group are merged to /etc.  In addition, it uses a temporary
tree to stage these changes rather than overwriting the existing
'current' and 'previous' trees so that a full update can be run after
a normal installworld has completed.

MFC after:	2 weeks
2013-11-12 19:44:18 +00:00
John Baldwin
c387a450ac Add an -s option that specifies a path to an alternate etcupdate.sh script
to test.  This allows a non-installed version of the script to be tested
more easily.
2013-11-12 19:15:06 +00:00
Jilles Tjoelker
5d4d10e3e5 sh: Properly quote alias output from command -v.
An alias should be printed by command -v as a command line; therefore, make
the alias definition suitable for re-input to the shell.
2013-11-10 23:00:39 +00:00
Jilles Tjoelker
309ad20076 sh: Add a test case for would-be assignments that are not due to quoting. 2013-11-10 18:46:59 +00:00