Commit graph

607 commits

Author SHA1 Message Date
Bjoern A. Zeeb 6007da5f92 In sys/netipsec/keysock.c rev. 1.19 a missing priv check was added.
Before that non-su users were able to open pfkey sockets as well.

Add a regression test so we can detect such problems in an automated way
in the future.
2007-11-13 08:59:29 +00:00
Pawel Jakub Dawidek 53c0785606 Hide geli warnings about sector size beeing bigger than the page size when
doing regression testing.
2007-10-26 08:31:11 +00:00
Stefan Farfeleder aafd6a87a6 The exit status of a case statement where none of the patterns is matched
is supposed to be 0, not the status of the previous command.

Reported by:	Eygene Ryabinkin
PR:		116559
Approved by:	re (gnn)
2007-10-04 16:14:48 +00:00
Robert Watson d903306a26 Enhance and expand kernel privilege regression tests in support of
work present in FreeBSD 7.0 to refine the kernel privilege model:

- Introduce support for jail as a testing variable, in order to
  confirm that privileges are properly restricted in the jail
  environment.

- Restructure overall testing approach so that privilege and jail
  conditions are set in the testing infrastructure before tests
  are invoked, and done so in a custom-created process to isolate
  the impact of tests from each other in a more consistent way.

- Tests now provide setup and cleanup hooks that occur before and
  after the test runs.

- New privilege tests are now present for several audit
  privileges, several credential management privileges, dmesg
  buffer reading privilege, and netinet raw socket creation.

- Other existing tests are restructured and generally improved as
  a result of better framework structure and jail as a variable.
  For exampe, we now test that certain sysctls are writable only
  outside jail, while others are writable within jail.  On a
  similar note, privileges relating to setting UFS file flags are
  now better exercised, as with the right to chmod and utimes
  files.

Approved by:	re (bmah)
Obtained from:	TrustedBSD Project
2007-09-09 23:08:39 +00:00
Pawel Jakub Dawidek 864cba9669 Add support for Camellia encryption algorithm.
PR:		kern/113790
Submitted by:	Yoshisato YANAGISAWA <yanagisawa@csg.is.titech.ac.jp>
Approved by:	re (bmah)
2007-09-01 06:33:02 +00:00
Xin LI d73f7c1723 New regression test updates for rename, etc.
Obtained from:	NetBSD
Approved by:	re (tmpfs blanket)
2007-08-10 10:08:43 +00:00
Dag-Erling Smørgrav 2174a10b9e Add regression tests for flopen(3).
Approved by:	re (blanket)
2007-08-03 11:29:49 +00:00
Sean Farley 9bab236702 Added environ-replacement detection. For programs that "clean" (i.e., su)
or replace (i.e., zdump) the environment after a call to setenv(), putenv()
or unsetenv() has been made, a few changes were made.
  - getenv() will return the value from the new environ array.
  - setenv() was split into two functions:  __setenv() which is most of the
    previous setenv() without checks on the name and setenv() which
    contains the checks before calling __setenv().
  - setenv(), putenv() and unsetenv() will unset all previous values and
    call __setenv() on all entries in the new environ array which in turn
    adds them to the end of the envVars array.  Calling __setenv() instead
    of setenv() is done to avoid the temporary replacement of the '=' in a
    string with a NUL byte.  Some strings may be read-only data.

Added more regression checks for clearing the environment array.

Replaced gettimeofday() with getrusage() in timing regression check for
better accuracy.

Fixed an off-by-one bug in __remove_putenv() in the use of memmove().  This
went unnoticed due to the allocation of double the number of environ
entries when building envVars.

Fixed a few spelling mistakes in the comments.

Reviewed by:	ache
Approved by:	wes
Approved by:	re (kensmith)
2007-07-20 23:30:13 +00:00
Pawel Jakub Dawidek 2125ff0886 Make fstest work out-of-the-box on Solaris:
- Solaris' setgroups(2) doesn't change process' effective gid, so set it
  explicitly.
- POSIX doesn't define O_NOFOLLOW. FreeBSD returns EMLINK when target is
  a symbolic link, but Solaris returns ELOOP then.
- Solaris doesn't define O_SHLOCK and O_EXLOCK flags.

Approved by:	re (rwatson)
2007-07-18 18:07:15 +00:00
Xin LI 68b843a591 Add a test case for sed(1) regression - we should not ignore case
when not being asked to do so.

Approved by:	re (hrs)
2007-07-06 16:36:52 +00:00
Suleiman Souhlal bdd72b703b Add case-insensitive matching to sed, using the 'I' flag, similarly to GNU sed.
For example,
	sed /foo/Id
	sed s/foo/bar/Ig

Reviewed by:	dds
Approved by:	re (hrs)
2007-07-04 16:42:41 +00:00
Sean Farley 2966d28c32 Significantly reduce the memory leak as noted in BUGS section for
setenv(3) by tracking the size of the memory allocated instead of using
strlen() on the current value.

Convert all calls to POSIX from historic BSD API:
 - unsetenv returns an int.
 - putenv takes a char * instead of const char *.
 - putenv no longer makes a copy of the input string.
 - errno is set appropriately for POSIX.  Exceptions involve bad environ
   variable and internal initialization code.  These both set errno to
   EFAULT.

Several patches to base utilities to handle the POSIX changes from
Andrey Chernov's previous commit.  A few I re-wrote to use setenv()
instead of putenv().

New regression module for tools/regression/environ to test these
functions.  It also can be used to test the performance.

Bump __FreeBSD_version to 700050 due to API change.

PR:		kern/99826
Approved by:	wes
Approved by:	re (kensmith)
2007-07-04 00:00:41 +00:00
Xin LI 544970d64e Fix a obsecure coredump while testing with tmpfs on amd64.
Approved by:	re (kensmith)
2007-06-26 13:51:53 +00:00
Xin LI 6e347527f4 id generation is now handled by uma(9) subsystem,
so remove the (now) irrevelent test case.

Requested by:	Howard Su
Approved by:	re (tmpfs blanket)
2007-06-25 18:47:09 +00:00
Michael Bushkov e088274144 - Bugs in gethostbyXXX/getipnodebyXXX regression tests fixed.
Tests for getipnodebyXXX functions now cover most number of flags
  combinations.

Approved by: re (kensmith), brooks (mentor)
2007-06-24 06:14:18 +00:00
Xin LI f8c94cec4b MFp4: Add regression tests for tmpfs.
Obtained from:	NetBSD via p4
Submitted by:	Howard Su
2007-06-16 02:04:44 +00:00
Hartmut Brandt 3c9b26f049 Make the order of tests the same for user and kernel. Use the natural
layer order from bottom to top.
2007-06-14 20:11:48 +00:00
Bruce M Simpson b13321fc4e Add regression test for SSM code. 2007-06-12 16:29:22 +00:00
Bruce M Simpson 71498f308b Import rewrite of IPv4 socket multicast layer to support source-specific
and protocol-independent host mode multicast. The code is written to
accomodate IPv6, IGMPv3 and MLDv2 with only a little additional work.

This change only pertains to FreeBSD's use as a multicast end-station and
does not concern multicast routing; for an IGMPv3/MLDv2 router
implementation, consider the XORP project.

The work is based on Wilbert de Graaf's IGMPv3 code drop for FreeBSD 4.6,
which is available at: http://www.kloosterhof.com/wilbert/igmpv3.html

Summary
 * IPv4 multicast socket processing is now moved out of ip_output.c
   into a new module, in_mcast.c.
 * The in_mcast.c module implements the IPv4 legacy any-source API in
   terms of the protocol-independent source-specific API.
 * Source filters are lazy allocated as the common case does not use them.
   They are part of per inpcb state and are covered by the inpcb lock.
 * struct ip_mreqn is now supported to allow applications to specify
   multicast joins by interface index in the legacy IPv4 any-source API.
 * In UDP, an incoming multicast datagram only requires that the source
   port matches the 4-tuple if the socket was already bound by source port.
   An unbound socket SHOULD be able to receive multicasts sent from an
   ephemeral source port.
 * The UDP socket multicast filter mode defaults to exclusive, that is,
   sources present in the per-socket list will be blocked from delivery.
 * The RFC 3678 userland functions have been added to libc: setsourcefilter,
   getsourcefilter, setipv4sourcefilter, getipv4sourcefilter.
 * Definitions for IGMPv3 are merged but not yet used.
 * struct sockaddr_storage is now referenced from <netinet/in.h>. It
   is therefore defined there if not already declared in the same way
   as for the C99 types.
 * The RFC 1724 hack (specify 0.0.0.0/8 addresses to IP_MULTICAST_IF
   which are then interpreted as interface indexes) is now deprecated.
 * A patch for the Rhyolite.com routed in the FreeBSD base system
   is available in the -net archives. This only affects individuals
   running RIPv1 or RIPv2 via point-to-point and/or unnumbered interfaces.
 * Make IPv6 detach path similar to IPv4's in code flow; functionally same.
 * Bump __FreeBSD_version to 700048; see UPDATING.

This work was financially supported by another FreeBSD committer.

Obtained from:  p4://bms_netdev
Submitted by:   Wilbert de Graaf (original work)
Reviewed by:    rwatson (locking), silence from fenner,
		net@ (but with encouragement)
2007-06-12 16:24:56 +00:00
Yaroslav Tykhiy 26a5710c40 Don't forget to clear out the hold space for each subsequent file
when in -i mode so that each file gets a clean context of its own.

Add a regression test for the bug.

Tested with:	regression tests
2007-06-12 12:05:24 +00:00
Greg Lehey df16203833 Updated tests for changed features.
Submitted by: edwin@
2007-06-09 06:01:24 +00:00
Greg Lehey 2b04161236 Use correct comment syntax for $FreeBSD$. This file gets put through
cpp, not a shell script.

Pointy hat to: grog
2007-06-04 01:44:07 +00:00
Greg Lehey 88778e972f Add regression tests for calendar.
Submitted by:	edwin@
PR:		bin/113275
MFC after:	2 weeks
2007-06-03 03:29:32 +00:00
Diomidis Spinellis a14e979ed4 Add sparc64 regression test files.
Submitted by:	Carl Johan Gustavsson
2007-05-24 07:00:53 +00:00
Diomidis Spinellis 2055b9dc4f Modify file generation instructions to remove the tty field:
the mapping from number to name differs between systems,
and will cause tests to fail.
2007-05-24 06:57:50 +00:00
Diomidis Spinellis b2784a1010 Fix the procedure for generating the test summary files.
Document the procedure for obtaining an appropriately old version of sa.
2007-05-23 21:35:45 +00:00
Diomidis Spinellis 550bfecc8f Regression tests for sparc64 record formats.
Submitted by:	Carl Johan Gustavsson
2007-05-22 06:34:20 +00:00
Diomidis Spinellis 6f1544c7f1 Regression tests for amd64 file and record formats.
Submitted by:	Larry Rosenman (who also provided access to a testing host)
2007-05-22 06:30:48 +00:00
Diomidis Spinellis eeec998a23 Regression tests for the new and legacy process accounting formats. 2007-05-22 06:21:20 +00:00
Diomidis Spinellis ffc44a27da Document the .in .out file naming conventions adopted in commit_prep.pl's
exclusions list for header checking.
2007-05-22 06:11:44 +00:00
Diomidis Spinellis a1ab7f88b1 Test the integer-arithmetic float conversions encode_timeval and encode_long
in kern_acct.c.
2007-05-22 05:52:04 +00:00
Robert Watson 9af491e24b Add regression tests for ethers(3) functions, including new _r variants.
Four tests currently fail:

  test_ether_line_bad_1() and test_ether_line_bad_2() due to bugs in
  ether_line(3).

  test_ether_ntohost() and test_ether_hostton() due to not being fully
  implemented tests.
2007-05-13 14:03:21 +00:00
Robert Watson 9d3f3e9711 Add a regression test to detect if waiting on the I/O serialization lock
on socket buffers is interruptible or not, which detacts the regression I
introduced recently in 7-CURRENT (spotted by alfred).  This test passes
in older -CURRENT, and with the as-yet uncommitted sx_xlock_sig and
sblock fix patches.
2007-05-06 14:28:49 +00:00
Mike Makonnen 092fa28f4f Regression tests for recent changes to inet6_rth_* family of functions
regarding RFC3542 compliance.
2007-04-21 11:23:33 +00:00
Yaroslav Tykhiy f6703c9c0a Change the semantics of -i (in-place editing) so that it treats
each file independently from other files.  The new semantics are
desired in the most of practical cases, e.g.: delete lines 5-9
from each file.

Keep the previous semantics of -i under a new option, -I, which
uses a single continuous address space covering all files to edit
in-place -- they are too cool to just drop them.

Add regression tests for -i and -I.

Approved by:	dds
Compared with:	GNU sed
Discussed on:	-hackers
MFC after:	2 weeks
2007-04-21 01:21:36 +00:00
Pawel Jakub Dawidek d77f4f6a6f Test sending 0 bytes. 2007-04-20 19:01:42 +00:00
Pawel Jakub Dawidek 4b7e26d006 Fix length calculation. 2007-04-20 19:00:43 +00:00
Dag-Erling Smørgrav f7754b09e2 Valid error codes for err() and errx() are 1..255.
The correct format specifier for ssize_t is %zd.
2007-04-19 07:59:30 +00:00
Pawel Jakub Dawidek ed3d9b6e75 Add more tests to verify last sendfile(2) breakage: test sending more
than a page size and nbytes=0.
2007-04-19 06:01:08 +00:00
Michael Bushkov a3859aa386 Committing regression tests for all implemented nsswitch databases.
Detailed description and instructions are in the README file.
This work had been basically done during GSoC 2006.

Approved by:	brooks (mentor)
2007-04-15 11:02:31 +00:00
Bruce M Simpson 201096bc46 Nuke ipblock. A more complete multicast regression test suite is on the way. 2007-04-12 11:46:30 +00:00
Bruce M Simpson e52a7d1f39 Fix a bug whereby group addresses were incorrectly computed in the test.
[Since the change to strict refcounting for in_multi objects, this test
 began to fail; formerly the refcount was a count of the number of requests
 for a given address, NOT a count of pointers to the object.]
2007-04-09 19:44:08 +00:00
Bruce M Simpson 2509455360 Add a small test program for the additional socket options which
RFC 3678 (Source-specific Multicast API) brings to FreeBSD.
2007-04-06 23:39:17 +00:00
John Baldwin 1ce2bc9187 Fix a fd leak in socketpair():
- Close the new file objects created during socketpair() if the copyout of
  the new file descriptors fails.
- Add a test to the socketpair regression test for this edge case.
2007-04-02 19:15:47 +00:00
John Baldwin c16551befc Add another fd leak test for accept() I used to test the fix in 1.234 of
sys/kern/uipc_syscall.c.
2007-04-02 16:02:50 +00:00
Yaroslav Tykhiy 78e7d37750 Logically separate the complex hanoi' and math' tests from basic tests. 2007-04-02 08:20:43 +00:00
Yaroslav Tykhiy e9a0eed451 Don't forget to close the range if we branched over its end
and had no chance to match it by the 2nd address precisely.
Otherwise the unclosed range would bogusly extend to the end
of stream.

Add a basic regression test for the bug fixed.  (This change
also fixes the more complex case 5.3 from `multitest.t'.)

Compared with:	SUN and GNU seds
Tested by:	regression tests
MFC after:	1 week
2007-04-02 08:14:46 +00:00
Yaroslav Tykhiy d7cfea0e1a Today SUN and GNU seds fully agree on test 5.3 and behave
in a more reasonable way than BSD sed does: they properly
close the range even if we branched over its end.  No doubt,
the range `1,5' should not match lines from 9 through 14.
2007-04-02 07:50:10 +00:00
Yaroslav Tykhiy 6b8ef68111 This trivial change should fix at least 3 similar bugs. All of
them are related to the `c' function's need to know if we are at
the actual end of the address range.  (It must print the text not
earlier than the whole pattern space was deleted.)  It appears the
only sed function with this requirement.

There is `lastaddr' set by applies(), which is to notify the `c'
function, but it can't always help because it's false when we are
hitting the end of file early.  There is also a bug in applies()
due to which `lastaddr' isn't set to true on degenerate ranges such
as `$,$' or `N,$' if N appears the last line number.

Handling early EOF condition in applies() could look more logical,
but it would effectively revert sed to the unreasonable behaviour
rev. 1.26 of main.c fought against, as it would require lastline()
be called for each line within each address range.  So it's better
to call lastline() only if needed by the `c' function.

Together with this change to sed go regression tests for the bugs
fixed (c1-c3).  A basic test of `c' (c0) is also added as it helped
me to spot my own error.

Discussed with:		dds
Tested by:		the regression tests
MFC after:		1 week
2007-04-01 13:25:03 +00:00
George V. Neville-Neil 43888ab17c Adding tests for Camellia which will be added to the tree soon.
Added tests for aes-ctr which were not present before.
2007-03-26 07:40:51 +00:00
George V. Neville-Neil 5a146d5125 Update the regression test so that there are actually two independent
networks involved, as opposed to two hosts on one network.

MFC after:	1 week
2007-03-24 13:47:16 +00:00
George V. Neville-Neil a564577c94 Add a test for IPv6 and IPsec which is similar to the one for IPv4.
Add comments to the test for IPv4 with IPsec.
MFC after:	1 week
2007-03-21 09:39:51 +00:00
Diomidis Spinellis 6dabf85649 Rename sed.test to multitest.t to comply with the naming scheme of
the regression suite.
2007-03-14 18:58:59 +00:00
Diomidis Spinellis 0a6ffa2714 Reinstate error-testing regression tests. 2007-03-14 13:38:23 +00:00
Diomidis Spinellis ab6386e42d Integrate the tests I wrote in 1992 with our current regression
testing framework and protocol.
2007-03-14 13:05:45 +00:00
Diomidis Spinellis 83f7d3636c Reference results for sed.test (to be renamed into multitest.t).
I have verified these with GNU sed 4.1.5 (and in some cases with Solaris
sed) and they are identical, with the following exceptions:
5.3: The result is unspecified and BSD sed behaves differently.
6.3: GNU sed gets it wrong
7.1: GNU sed gets it wrong
7.8: BSD sed gets it wrong
2007-03-14 12:46:22 +00:00
Diomidis Spinellis ac451395ea - Uncomment tests that were commented out
- Update platform-conditional tests to reflect current reality
- Fix conditional for test 7.8: it is the fault of BSD sed
2007-03-14 11:03:00 +00:00
Diomidis Spinellis 4c1ccdfd94 - It looks like BSD and GNU sed can nowadays pass two more tests.
- Test 7.8 fails for GNU sed not BSD.
2007-03-14 10:10:10 +00:00
Diomidis Spinellis 0bc4fe6eaa Use another non-printing test; address 0 now has a special meaning in GNU sed. 2007-03-14 09:47:00 +00:00
Diomidis Spinellis 259dde6e74 Document a procedure for testing individual binaries under development. 2007-03-14 09:33:13 +00:00
Diomidis Spinellis 7fdac324d9 Update tests to reflect the state of the art of sed in HEAD and
GNU sed 4.1.5.
Almost all of the tests that were skipped for BSD or GNU sed
now appear to work.
2007-03-14 09:05:41 +00:00
Diomidis Spinellis 412e5edfa8 Add sed math regression test. 2007-03-14 07:55:05 +00:00
Diomidis Spinellis 32ad3fd6da Add Towers of Hanoi regression test. 2007-03-14 07:52:38 +00:00
Diomidis Spinellis c29e1340e9 Add missing newline to correct failure of the regression test.
According to IEEE Std 1003.1, 2004 "Whenever the pattern space is
written to standard output or a named file, sed shall immediately
follow it with a <newline>."

An attempt at the same correction might have been made with r1.3,
which is however identical with r1.2.
2007-03-14 07:01:49 +00:00
Bruce M Simpson f6c0136c7f Add raw IP support (protocol 114) to ipbroadcast regression test. 2007-03-13 23:36:48 +00:00
Bruce M Simpson 48451912c9 Add -A to specify local address for bind(). 2007-03-08 14:37:00 +00:00
Bruce M Simpson f3bb407b7c Support IP_SENDIF in -CURRENT. 2007-03-08 14:27:24 +00:00
Bruce M Simpson df7babd689 Add -t to set IP TTL. 2007-03-01 18:36:16 +00:00
Bruce M Simpson 2b743a9e9d Introduce a test program for IPv4 broadcast datagram send. 2007-03-01 13:26:13 +00:00
Bruce M Simpson 3763835bfe Add a regression test for ethernet link-layer multicast memberships. 2007-02-25 01:58:02 +00:00
Bruce M Simpson 3250f640aa For the IPv4 multicast membership socket regression test:
Add command line flags to increase the number of test iterations.
 Be deterministic by default, for automated operation.
 Better document assumptions.
2007-02-02 21:10:37 +00:00
Pawel Jakub Dawidek 65e2b8ca1f Simple README file which shows how to use fstest. 2007-01-28 00:10:28 +00:00
Pawel Jakub Dawidek b20669bdef MFp4: - When new object is created, it's group ID can be set to process'
effective group ID or to group ID of its parent directory.
	- Add some comments from POSIX.
	- Verify that after successful O_TRUNC open, size is equal to 0.
2007-01-25 20:50:02 +00:00
Pawel Jakub Dawidek 33e0d352b2 MFp4: When user is not a member of the group which owns a file, even if
he is the file's owner, he can't set set-gid bit.
	POSIX requires to return 0 and clear the bit, but FreeBSD returns
	EPERM for UFS in such case. For now do the same in ZFS.
2007-01-25 20:48:14 +00:00
Pawel Jakub Dawidek 53feb1d422 Add 3436 file system regression tests in 184 files.
Almost all regression tests are based on very flexible fstest tool.
They verify correctness (POSIX conformance) of almost all file
system-related system calls.

The motivation behind this work is my ZFS port and POSIX, who doesn't
provide free test suites.

Runs on:	FreeBSD/UFS, FreeBSD/ZFS, Solaris/UFS, Solaris/ZFS

To try it out:

	# cd fstest
	# make
	# find tests/* -type d | xargs prove
2007-01-17 01:42:12 +00:00
Robert Watson 0b71cfd780 Ignore EINPROGRESS error on TCP connect(), and pick up the result of the
non-blocking connect later using select().  This case didn't trigger on
my UP test box, but did on Peter's SMP test box.

Spotted by:	peter
2007-01-12 22:17:31 +00:00
Robert Watson 581f1f9421 Add a regression test for sending and writing zero bytes to sockets of
various types, as well as pipes and fifos for good measure.  RELENG_6
currently passes all of these tests, but 7-CURRENT fails 0-byte writes
and sends on all stream socket types (and fifos, as they are based on
stream sockets).

Bumped into by:	peter
Diagnosed by:	jhb
Problem of:	andre
2007-01-12 21:49:36 +00:00
Stefan Farfeleder 9bb8020ab3 Add regression tests for exec.c rev 1.30. 2007-01-11 00:25:20 +00:00
David Schultz 2a5f50a641 Fix a few of the tests so that correct implementations actually pass them. 2007-01-07 09:25:22 +00:00
David Xu 1d6328e12b Fix compiling. 2007-01-06 11:32:15 +00:00
David Schultz f56f1d7735 Remove the test that ensures that when the string "nan(...)" is converted
to floating-point, the result is a quiet NaN.  The current implementation
may return a signaling NaN, and the vendor has no plans for changing this,
for reasons explained in the comment I added.
2007-01-03 21:28:26 +00:00
David Schultz 3f29b2ef51 Fix cut-and-paste bugs in the regression tests. 2007-01-03 05:38:08 +00:00
Bruce M Simpson a86ec33820 Drop all received data mbufs from a socket's queue if the MT_SONAME
mbuf is dropped, to preserve the invariant in the PR_ADDR case.

Add a regression test to detect this condition, but do not hook it
up to the build for now.

PR:             kern/38495
Submitted by:   James Juran
Reviewed by:    sam, rwatson
Obtained from:  NetBSD
MFC after:      2 weeks
2006-12-23 21:07:07 +00:00
David Xu 56073c9eac initialize mutex and cv. 2006-12-06 00:03:42 +00:00
David Xu a3f452e8d8 Fix spelling. 2006-12-05 05:31:49 +00:00
David Xu e986eeec92 Add a test for pthread's cv and cancellation. 2006-12-05 05:14:56 +00:00
Diomidis Spinellis 894407d359 New test cases demonstrating fixed bugs, and the reason why
fmtcheck can't be used.
2006-12-03 19:18:41 +00:00
Yaroslav Tykhiy a6afe5ada8 Fix and extend the -j option to pkill/pgrep WRT the jail
wildcard specifications.  Earlier the only wildcard syntax
was "-j 0" for "any jail".  There were at least
two shortcomings in it:  First, jail ID 0 was abused; it
meant "no jail" in other utils, e.g., ps(1).  Second, it
was impossible to match processed not in jail, which could
be useful to rc.d developers.  Therefore a new syntax is
introduced: "-j any" means any jail while "-j none" means
out of jail.  The old syntax is preserved for compatibility,
but now it's deprecated because it's limited and confusing.

Update the respective regression tests.  While I'm here,
make the tests more complex but sensitive:  Start several
processes, some in jail and some out of jail, so we can
detect that only the right processes are killed by pkill
or matched by pgrep.

Reviewed by:	gad, pjd
MFC after:	1 week
2006-11-23 11:55:17 +00:00
Jung-uk Kim b8aa271342 Fix message size tests for msgsnd(3) and msgrcv(3). msgsz is the length of
actual message and it should not include size of message type.
2006-11-16 19:51:10 +00:00
Robert Watson 57c4583f70 Add a short regression test to try to exercise races in the non-atomic
nature of implied connect via sendto().  Oddly, uipc_usrreq.c implements
this for stream sockets, but doesn't set the flag in its protocol
definition so that it can actually be used.  As such, the stream test is
implemented but doesn't run for now.
2006-11-15 12:43:45 +00:00
Maxim Konovalov 52fc06f0f2 o Indent by tab. 2006-11-11 18:45:20 +00:00
Maxim Konovalov 08a8d24059 o Add several regression tests for dup(2), dup2(2) and fcntl(F_DUPFD).
Obtained from:	OpenBSD
2006-11-11 18:32:50 +00:00
Jung-uk Kim c5f41de11c Use z modifier for size_t and ssize_t. 2006-11-07 23:28:30 +00:00
Diomidis Spinellis 0dc97cf078 Add the examples from the manual page. 2006-11-06 15:05:03 +00:00
Diomidis Spinellis 3b5adecb00 Updated results for bin/68981
PR:		bin/68981
2006-11-06 15:00:37 +00:00
Diomidis Spinellis 44d251df7a Regress.out is now regress.x.out. 2006-11-06 08:49:43 +00:00
Diomidis Spinellis 2c75d9c7ba Test the handling of supplied and default parameters. 2006-11-06 08:39:52 +00:00
Stefan Farfeleder 44c892dac2 Add regression tests for PR 105078. 2006-11-05 18:41:23 +00:00
Maxim Konovalov 13fff3d67b o Grammar.
Submitted by:	kris
2006-10-09 06:47:08 +00:00
Maxim Konovalov 6bc39031ef o Enable test-sparceaout test since alc@ has fixed the panic in rev. 1.229
sys/vm/vnode_pager.c.
cVS: ----------------------------------------------------------------------
2006-10-09 05:31:37 +00:00
Pawel Jakub Dawidek b58ab5f02a Move readonly.t regression tests file to where it belongs.
I accidentally added it to a wrong directory.
2006-09-19 11:28:06 +00:00
Pawel Jakub Dawidek 0608d9863a Add regression tests for 'geli configure' subcommand.
MFC after:	1 week
2006-09-16 10:44:33 +00:00
Pawel Jakub Dawidek b88743e637 Regression tests for read-only option (attach -r).
MFC after:	1 week
2006-09-16 09:30:24 +00:00
Robert Watson 9fa5f6b4b9 dd a series of regression tests to validate that privilege requirements are
implemented properly for a number of kernel subsystems.  In general, they
try to exercise the privilege first as the root user, then as a test user,
in order to determine when privilege is being checked.

Currently, these tests do not compare inside/outside jail, and probably
should be enhanced to do that.

Sponsored by:	nCircle Network Security, Inc.
Obtained from:	TrustedBSD Project
2006-09-13 09:05:39 +00:00
Ruslan Ermilov 2b46c64c9c Remove alpha left-overs. 2006-08-22 08:03:01 +00:00
John Birrell ffc48c2814 Fix for architectures where sizeof(void *) > sizeof(int). 2006-08-04 21:45:08 +00:00
Simon L. B. Nielsen 6e0d070709 Add a test program which performs some very basic tests of libmp(3).
It is by no means expected to perform a complete test of the library
for correctness, but is meant to test the API to make sure libmp (or
libcrypto) updates don't totally break the library.
2006-07-28 16:00:59 +00:00
Robert Watson 13496464e5 Add a test case for closing a UDPv6 socket that has been connected to
the IPv6 loopback address.

Warns ?= 2.
2006-07-19 12:54:14 +00:00
Robert Watson 9b498b31a9 Add very basic regression test for netinet6: create and close raw,
UDP, and TCP IPv6 sockets.
2006-07-19 12:10:33 +00:00
Marcel Moolenaar f2f0337e84 Add regression tests of the emulation of the long branch conditional form.
These tests can obviously only be run on Merced processors, as they don't
implement the long branch.
2006-07-17 00:27:12 +00:00
Maxim Konovalov 8847579c57 o style.Makefile(5): WARNS= -> WARNS?=. 2006-07-09 11:51:14 +00:00
Robert Watson b0388d6b91 When extending a file with truncate, check that newly added bytes have
a value of 0 in the extended region.

Make sure that we get EINVAL back if we try to truncate a read-only
file descriptor.
2006-07-09 10:56:36 +00:00
Robert Watson 17d6f0e53b Add regression tests to make sure that attempting to call ftruncate() on
various non-file objects fails.
2006-07-09 10:43:31 +00:00
Robert Watson cead9b1c1c Add very basic ftruncate() regression test, with a comment rather more
thorough than the tests regarding what should be tested.
2006-07-09 10:19:07 +00:00
Pawel Jakub Dawidek 8091e0f54b Add regression tests for geli(8) authentication feature.
Supported by:	Wheel Sp. z o.o. (http://www.wheel.pl)
2006-06-06 06:46:51 +00:00
Pawel Jakub Dawidek 43b48559c5 - Update regression tests after recent changes.
- Verify various sector sizes.
2006-06-06 06:44:19 +00:00
Pawel Jakub Dawidek cb852b474a Add regression tests for IPsec. 2006-06-04 22:06:17 +00:00
Maxim Konovalov 326c421e09 Output directory has gone, remove it from Makefile. 2006-05-31 11:22:15 +00:00
Maxim Konovalov 884fb9ccdd Fix test for empty interpreter. 2006-05-31 11:15:16 +00:00
Maxim Konovalov 393e6ede9e o Add various regression tests for execve(2) syscall.
Obtained from:	NetBSD
2006-05-31 11:13:10 +00:00
Maxim Konovalov fd447da171 o Let getopt(3) report errors in command line arguments.
o If something is wrong with options, then output short usage help message.
o Output errstr returned from strtonum(3).

PR:		bin/98141
Submitted by:	Andrey Simonenko
2006-05-31 08:10:34 +00:00
Maxim Konovalov 5368db2726 o Add a collection of regression tests for ancillary (control)
data passing for unix domain sockets, stream and datagram.

There are 15 tests:

Test/Type of socket					STREAM	DGRAM
----------------------------------------------------------------------
Sending, receiving cmsgcred				   1      6
Receiving sockcred (listening socket has LOCAL_CREDS)	   2      n/a
Receiving sockcred (accepted socket has LOCAL_CREDS)	   3      n/a
Receiving sockcred					   n/a    7
Sending cmsgcred, receiving sockcred			   4      8
Sending, receiving timestamp				   5      9
Sending, receiving cmsgcred (no control data)		   10     13
Sending cmsgcred, receiving sockcred (no control data)	   11     14
Sending, receiving timestamp (no control data)		   12     15

Currently we pass 8 tests.  All the rest marked as TODO.

PR:		kern/90800
Submitted by:	Andrey Simonenko
2006-05-29 18:40:55 +00:00
Maxim Konovalov f1746dbc9c o Test truncate(2) on fifo: it should ignore the request and
return success.

PR:		kern/98064
Submitted by:	Kirk Russell
2006-05-29 10:56:27 +00:00
Robert Watson 64ccf56136 Use WARNS and rely on rules rather than an explicit target for the
test binary.

Reported by:	maxim
2006-05-25 10:46:43 +00:00
Robert Watson 0fb57f87a3 Add a basic regression test for sendfile() over TCP, which sends varying
lengths of headers and data and makes sure it receives about the right
number of bytes.
2006-05-25 09:50:14 +00:00
Maxim Konovalov 90967a95ce o Convert to Test::Harness testing infratructure. 2006-05-20 19:18:24 +00:00
Maxim Konovalov cd915ab751 o A tiny regression test exposes bug in rip_disconnect(). 2006-05-14 22:03:00 +00:00
Bruce M Simpson 9b5b26f66f Add multicast group join/leave functionality to IPv4 regression
test suite.
2006-05-14 14:11:54 +00:00
Pawel Jakub Dawidek 16bde23e84 For some time now, -i and -P options are mutually exclusive, there's even
a regression test init-i-P.t which asserts this, but it looks I forgot to
update nokey.t regression test.

MFC after:	1 day
2006-05-01 09:12:52 +00:00
David Malone 89ddbd45e5 Add some new options to mac_bsdestended. We can now match on:
subject: ranges of uid, ranges of gid, jail id
	objects: ranges of uid, ranges of gid, filesystem,
		object is suid, object is sgid, object matches subject uid/gid
		object type

We can also negate individual conditions. The ruleset language is
a superset of the previous language, so old rules should continue
to work.

These changes require a change to the API between libugidfw and the
mac_bsdextended module. Add a version number, so we can tell if
we're running mismatched versions.

Update man pages to reflect changes, add extra test cases to
test_ugidfw.c and add a shell script that checks that the the
module seems to do what we expect.

Suggestions from: rwatson, trhodes
Reviewed by: trhodes
MFC after: 2 months
2006-04-23 17:06:18 +00:00
Marcel Moolenaar e717c486b3 MFp4:
o  Add mount and umount actions so that partitions can be in use.
o  Extend the testing of the add verb to include overlapping
   partitions.
o  Add tests for the remove verb. this includes tests to remove
   a partition when in use (i.e. is mounted).
o  Add a MD5 checksum to the output of the conf action so that
   it can be tested. Make sure the MD5 doesn't vary based on
   certain dynamic behaviour that is irrelevant to the output.
o  Add MD5 checksums to the expected result of conf actions.
2006-04-10 04:13:44 +00:00
Marcel Moolenaar 728f00f8c9 MFp4:
Add support for read-write parameters. Allow an optional initializer
for read-write parameters. Print the value of those parameters on
success following the PASS.
2006-04-10 04:07:20 +00:00
Robert Watson 582954da16 Add a simple regression test that creates and tears down route sockets,
and confirms that only SOCK_RAW works with socket(), and nothing works
with socketpair().
2006-04-09 14:48:38 +00:00
Robert Watson 3d11b6c8f0 Add simple regression tests that creates UNIX domain sockets using
socket() and socketpair() of SOCK_STREAM and SOCK_DGRAM types.  It
also confirms that SOCK_RAW fails.
2006-04-09 14:30:11 +00:00
Stefan Farfeleder 8af87209e3 Test that variable assignments preceding special built-ins affect the current
shell environment, eg after "VAR=val eval" VAR remains set.  Currently fails
but will be implemented soon.
2006-04-09 09:38:29 +00:00
Robert Watson fc19db6c7b Add a second pass to the close-before-accept test using a call to the
tcp drop sysctl.  This should exercise the ECONNABORTED accept case.
2006-04-03 11:57:41 +00:00
Robert Watson 1b2c980983 Add regression test for tcpdrop sysctl. 2006-04-03 11:34:36 +00:00
Robert Watson 4f29da19bd Add a regression test to exercise the case where accept() is called and
the next waiting socket has had a close on the remote endpoint already.
2006-04-03 10:08:35 +00:00
Stefan Farfeleder b333fbe98d Add test cases that check utility syntax errors and redirection errors. For
special built-in utilities they must terminate the shell, for other
utilities only a error message shall be written.  We currently fail both
tests.
2006-04-02 19:02:49 +00:00
Robert Watson 876f7f842a When running the second part of the test, kill off the server process from
the first part before starting, or the TCP port we want to bind may be in
use still.  Sleep for a short period between tests.

Use SIGTERM instead of SIGKILL.
2006-04-02 11:09:37 +00:00
Robert Watson dfe0ec64aa Pass the right pid into the parent and child tasks so that when a test
fails, we kill the right partner process.
2006-04-02 11:03:05 +00:00
Robert Watson 8c4d74c408 Add makefile for tcpsocktimewait missed in previous commit. 2006-04-02 10:50:46 +00:00
Robert Watson b4c2aeb1c4 Add a short regression test that triggers a TCP socket to enter time wait
while the socket is still open; one variant closes the socket while in
time wait, and a second lets time wait expire while the socket is open.
2006-04-02 00:07:38 +00:00
Robert Watson 416c476c47 Add spxabort, a simple netipx/spx regression test that triggers
pru_abort() by closing a listen socket while completed connections are
presenting in its listen queue.  Unfortunately, it's difficult to
trigger the other two pru_abort() cases using user APIs, so they are
not covered by this test.
2006-03-27 00:03:37 +00:00
Robert Watson d70f997e49 Add simple regression test to ping pong a data packet over SPX in stream
mode.  Support both connection via connect() and sendto(), but don't
compile in sendto() for now, since netipx doesn't appear to actually
implement that (doh).
2006-03-26 19:10:27 +00:00
Robert Watson c0bb7e6a97 Add a simple IPX datagram regression test, which opens two IPX datagram
sockets, binds a local port, sends a datagram, and confirms that it is
received.
2006-03-26 18:25:53 +00:00
Robert Watson 8403b3d7cc Add a short README with configuration hints to get the netipx regression
tests up and running.  This is likely a message to myself in six months
when I've completely forgotten how.
2006-03-26 17:42:04 +00:00
Robert Watson 94fdcc2ee8 Modify ipxsocket regression test to create and close sockets several
times, with variable length sleeps between socket() and close().  This
will help to ensure that IPX/SPX timers fire while the sockets are
open, and hence have PCB's on the IPX pcb list, so that if timers are
going to stumble over PCB types they don't expect, it will happen as
part of this test.
2006-03-26 15:49:35 +00:00
Robert Watson f4cda13bed Add simple ipxsocket regression test: open, and close, various IPX socket
types supported by the FreeBSD netipx implementation.
2006-03-26 01:58:39 +00:00
Robert Watson 87569f75a9 Merge Perforce change 93572 from TrustedBSD audit3 branch:
Simple audit pipe ioctl regression test.

Obtained from:	TrustedBSD Project
2006-03-19 15:47:53 +00:00