Commit Graph

1499 Commits

Author SHA1 Message Date
jkim
95cf51a304 Add test case for 'divide by 0' with BPF_ALU|BPF_DIV|BPF_X instruction. 2008-08-18 23:05:19 +00:00
jkim
62966b1d9f Fix two test cases on 32-bit architectures. 2008-08-18 21:40:03 +00:00
jkim
2e51cd9be9 Add simple bpf(9) regression tests and test cases. 2008-08-18 19:01:58 +00:00
phk
2c4b93bf04 Accept tty[ud]0 for console device 2008-08-15 08:28:15 +00:00
antoine
044437abb4 Use expr -e instead of expr to compute NANO_MEDIASIZE for Flash devices
larger than 2GB to prevent an overflow [1].
Make case-insensitive comparison work for siliconsystems, soekris and
transcend devices.

PR:		conf/126386 [1]
Submitted by:	Mark A [1]
MFC after:	1 month
2008-08-12 16:59:23 +00:00
sam
90dcaccf30 fix syntax 2008-08-09 21:51:57 +00:00
des
c2c1c946ae Add sbuf_new_auto as a shortcut for the very common case of creating a
completely dynamic sbuf.

Obtained from:	Varnish
MFC after:	2 weeks
2008-08-09 11:14:05 +00:00
phk
10a0b4e561 Add late customize hook
Submitted by: 	Patrick M. Hausen
Sat on for far too long:	phk
2008-08-09 09:37:44 +00:00
phk
945ee4f0e9 Add -i option to supress image building.
Submitted by:	keramida
2008-08-09 09:27:54 +00:00
phk
7e44a4aee7 Track /etc/ttys change to uart(4) 2008-08-09 09:27:06 +00:00
das
f97e361aa3 Test that the result is correctly rounded when |y/x| is huge. 2008-08-02 19:21:33 +00:00
sam
e93a37806c use new sysctl to generate a fake radar event 2008-08-02 18:01:58 +00:00
das
0abf439af5 Regression tests for fmtcheck(3).
Obtained from:	NetBSD
2008-08-02 06:03:04 +00:00
scf
e0b5c971c2 Detect if the application has cleared the environ variable by setting
the first value (environ[0]) to NULL.  This is in addition to the
current detection of environ being replaced, which includes being set to
NULL.  Without this fix, the environment is not truly wiped, but appears
to be by getenv() until an *env() call is made to alter the enviroment.

This change is necessary to support those applications that use this
method for clearing environ such as Dovecot and Postfix.  Applications
such as Sendmail and the base system's env replace environ (already
detected).  While neither of these methods are defined by SUSv3, it is
best to support them due to historic reasons and in lieu of a clean,
defined method.

Add extra units tests for clearing environ using four different methods:
1. Set environ to NULL pointer.
2. Set environ[0] to NULL pointer.
3. Set environ to calloc()'d NULL-terminated array.
4. Set environ to static NULL-terminated array.

Noticed by:	Timo Sirainen

MFC after:	3 days
2008-08-02 02:34:35 +00:00
scf
8b381816e4 Fix whitespace. 2008-08-02 01:38:03 +00:00
sam
c7852b169b unset TARGET_CPUTYPE and TARGET_BIG_ENDIAN when building the kernel
to silence compiler complaints when cross-building

Reviewed by:	phk
MFC after:	2 weeks
2008-07-31 23:04:00 +00:00
das
ed77206d40 Add some tests for acos*(), asin*(), atan*(), and atan2*(). 2008-07-31 22:43:38 +00:00
stefanf
96e2d91df4 Add a regression test for r181017.
Submitted by:	simon
2008-07-30 21:18:52 +00:00
scf
a3f8092a7b style(9) specifies that case statements are not indented. 2008-07-30 03:34:23 +00:00
rwatson
2f0c3f6d28 Remove extra comment that snuck in in last commit. 2008-07-29 18:38:37 +00:00
rwatson
4293351cba Add a simple ICMPv6 filter test for IPv6 raw sockets: determine that
the default ICMPv6 filter is pass all, test that we can set it to block
all and restore to pass all.  No attempt is made to test that the
filtering works, just that we can get and set it.
2008-07-29 18:33:56 +00:00
antoine
41ca50f84b Add files to remove when MK_GNU_CPIO = no 2008-07-28 18:00:45 +00:00
gnn
f158d7c96d Add a new program to the multicast test suite. The mcgrab program
is used to grab and hold some number of multicast addresses in order
to test what happens when an interface goes over the number of multicast
addresses it can filter in hardware.
2008-07-09 22:33:46 +00:00
das
a47dd1888d Add regression tests for fmin{,f,l} and fmax{,f,l}.
I wrote these to test amd64 asm functions that used
maxss, maxsd, minss, and minsd, but it turns out that
those instructions don't handle NaNs and signed zero
in the same way as fmin() and fmax() are required to,
so we're stuck with the C versions for now.
2008-07-03 23:06:06 +00:00
das
d36ce0f109 Add some regression tests for printf() with positional arguments.
The first test comes from OpenBSD, and the others are additions or
adaptations.

This is based on OpenBSD's
src/regress/lib/libc/sprintf/sprintf_test.c, v1.3.
I deliberately did not use v1.4 because it's bogus.
2008-06-29 21:03:14 +00:00
jhb
411d068395 Rework the lifetime management of the kernel implementation of POSIX
semaphores.  Specifically, semaphores are now represented as new file
descriptor type that is set to close on exec.  This removes the need for
all of the manual process reference counting (and fork, exec, and exit
event handlers) as the normal file descriptor operations handle all of
that for us nicely.  It is also suggested as one possible implementation
in the spec and at least one other OS (OS X) uses this approach.

Some bugs that were fixed as a result include:
- References to a named semaphore whose name is removed still work after
  the sem_unlink() operation.  Prior to this patch, if a semaphore's name
  was removed, valid handles from sem_open() would get EINVAL errors from
  sem_getvalue(), sem_post(), etc.  This fixes that.
- Unnamed semaphores created with sem_init() were not cleaned up when a
  process exited or exec'd.  They were only cleaned up if the process
  did an explicit sem_destroy().  This could result in a leak of semaphore
  objects that could never be cleaned up.
- On the other hand, if another process guessed the id (kernel pointer to
  'struct ksem' of an unnamed semaphore (created via sem_init)) and had
  write access to the semaphore based on UID/GID checks, then that other
  process could manipulate the semaphore via sem_destroy(), sem_post(),
  sem_wait(), etc.
- As part of the permission check (UID/GID), the umask of the proces
  creating the semaphore was not honored.  Thus if your umask denied group
  read/write access but the explicit mode in the sem_init() call allowed
  it, the semaphore would be readable/writable by other users in the
  same group, for example.  This includes access via the previous bug.
- If the module refused to unload because there were active semaphores,
  then it might have deregistered one or more of the semaphore system
  calls before it noticed that there was a problem.  I'm not sure if
  this actually happened as the order that modules are discovered by the
  kernel linker depends on how the actual .ko file is linked.  One can
  make the order deterministic by using a single module with a mod_event
  handler that explicitly registers syscalls (and deregisters during
  unload after any checks).  This also fixes a race where even if the
  sem_module unloaded first it would have destroyed locks that the
  syscalls might be trying to access if they are still executing when
  they are unloaded.

  XXX: By the way, deregistering system calls doesn't do any blocking
  to drain any threads from the calls.
- Some minor fixes to errno values on error.  For example, sem_init()
  isn't documented to return ENFILE or EMFILE if we run out of semaphores
  the way that sem_open() can.  Instead, it should return ENOSPC in that
  case.

Other changes:
- Kernel semaphores now use a hash table to manage the namespace of
  named semaphores nearly in a similar fashion to the POSIX shared memory
  object file descriptors.  Kernel semaphores can now also have names
  longer than 14 chars (up to MAXPATHLEN) and can include subdirectories
  in their pathname.
- The UID/GID permission checks for access to a named semaphore are now
  done via vaccess() rather than a home-rolled set of checks.
- Now that kernel semaphores have an associated file object, the various
  MAC checks for POSIX semaphores accept both a file credential and an
  active credential.  There is also a new posixsem_check_stat() since it
  is possible to fstat() a semaphore file descriptor.
- A small set of regression tests (using the ksem API directly) is present
  in src/tools/regression/posixsem.

Reported by:	kris (1)
Tested by:	kris
Reviewed by:	rwatson (lightly)
MFC after:	1 month
2008-06-27 05:39:04 +00:00
jhb
ed08bd0d6d Fix compile on 64-bit platforms. 2008-06-26 21:26:34 +00:00
dfr
41cea6d5ca Re-implement the client side of rpc.lockd in the kernel. This implementation
provides the correct semantics for flock(2) style locks which are used by the
lockf(1) command line tool and the pidfile(3) library. It also implements
recovery from server restarts and ensures that dirty cache blocks are written
to the server before obtaining locks (allowing multiple clients to use file
locking to safely share data).

Sponsored by:	Isilon Systems
PR:		94256
MFC after:	2 weeks
2008-06-26 10:21:54 +00:00
ru
8735fdbd4c Enable GCC stack protection (aka Propolice) for userland:
- It is opt-out for now so as to give it maximum testing, but it may be
  turned opt-in for stable branches depending on the consensus.  You
  can turn it off with WITHOUT_SSP.
- WITHOUT_SSP was previously used to disable the build of GNU libssp.
  It is harmless to steal the knob as SSP symbols have been provided
  by libc for a long time, GNU libssp should not have been much used.
- SSP is disabled in a few corners such as system bootstrap programs
  (sys/boot), process bootstrap code (rtld, csu) and SSP symbols themselves.
- It should be safe to use -fstack-protector-all to build world, however
  libc will be automatically downgraded to -fstack-protector because it
  breaks rtld otherwise.
- This option is unavailable on ia64.

Enable GCC stack protection (aka Propolice) for kernel:
- It is opt-out for now so as to give it maximum testing.
- Do not compile your kernel with -fstack-protector-all, it won't work.

Submitted by:	Jeremie Le Hen <jeremie@le-hen.org>
2008-06-25 21:33:28 +00:00
rwatson
07ce1984c9 Teach fifo_create regression test to also try to use mknod(2) to create
fifos, as this is required by the Single UNIX Specification, although
not currently implemented on FreeBSD.

While here, fix a bug in the directory timestamp checking test by
sleeping after querying the starting timestamp, rather than before.
2008-06-22 21:03:26 +00:00
das
d8f7f9f2dd Regression test for a recently fixed strtod bug. 2008-06-21 19:28:26 +00:00
dougb
aab693d38c 1. Make the BSD version of cpio the default [1]
a. The BSD version will be built and installed unless
WITHOUT_BSD_CPIO is defined.
b. The GNU version will not be built or installed unless
WITH_GNU_CPIO is defined. If this is defined, the symlink
in /usr/bin will be to the GNU version whether the BSD
version is present or not.

When these changes are MFCed the defaults should be flipped.

2. Add a knob to disable the building of GNU grep. This will
make it easier for those that want to test the BSD version in
the ports.

Approved by:	kientzle [1]
2008-06-16 05:48:15 +00:00
gnn
fff7b55e87 Update mctest and its associated script to have a base port to listen
on so that multiple copies can be run easily.

Update documentation with group and port arguments which are optional.
2008-06-03 20:54:46 +00:00
rwatson
111bb205cd Remove two netatm-specific test parts.
MFC after:	3 weeks
Spotted by:	bz
2008-05-26 22:41:40 +00:00
bz
6bba9b4244 Remove ISDN4BSD (I4B) from HEAD as it is not MPSAFE and
parts relied on the now removed NET_NEEDS_GIANT.
Most of I4B has been disconnected from the build
since July 2007 in HEAD/RELENG_7.

This is what was removed:
- configuration in /etc/isdn
- examples
- man pages
- kernel configuration
- sys/i4b (drivers, layers, include files)
- user space tools
- i4b support from ppp
- further documentation

Discussed with: rwatson, re
2008-05-26 10:40:09 +00:00
thompsa
a6f8300a4d Flush stdout after each line to make piping to another command easier. 2008-05-19 17:51:00 +00:00
rdivacky
e0d6700d1b Simple testing program for *at family of syscalls.
Approved by:	kib (mentor)
2008-05-18 08:34:04 +00:00
jb
5d0f190f8a Add the DTrace test makefile for the test suite distributed in OpenSolaris. 2008-05-17 02:09:48 +00:00
stefanf
1d02ed2942 Test the expansion of $LINENO. 2008-05-15 19:58:44 +00:00
adrian
f4cf88c408 Add the ability to do all read, all write, or random read/write. 2008-05-15 16:10:55 +00:00
adrian
6c68306921 Include a very basic (and beta) tool for stressing disks using the POSIX
AIO calls.

This small program queues up a controllable number of concurrent AIO
read operations w/ controllable io size against a disk or regular file.
There are a few other things to add (notably optional write support!)
but it works well enough at the present time to stress the AIO code out
relatively harshly in the disk IO case.
2008-05-07 07:23:47 +00:00
scf
b502b7ceb0 Enable autoflush of output to always show prompts. If piping the output
prior to this patch, the prompt would not appear due to buffering.

Approved by:	flz
2008-04-30 23:27:02 +00:00
sam
fe66958831 o add indirect array for field indices as the # stats is > 127 and doesn't
fit in a signed char
o change default output to something more useful for sta mode
o futz w/ various field names and widths; need to do full pass over this stuff
2008-04-30 19:47:31 +00:00
sam
0a2dc3df49 update for new events 2008-04-30 19:45:32 +00:00
rpaulo
8cd0556b5f Add new directories, scripts and wlanwds. Introduced with vap support. 2008-04-29 22:05:26 +00:00
rpaulo
336a8e615d Add missing 't'.
Approved by:	sam
2008-04-29 22:02:27 +00:00
jeff
33da69dc61 - Remove cumbersome and inaccurate attempt at synchronizing the timestamps
post collection.  This is too error prone and introduces uncertainty into
   the timing.  We'll simply have to require synchronized TSCs to run
   schedgraph on MP.

Sponsored by:	Nokia
2008-04-26 05:02:48 +00:00
gnn
0248cb5a77 Updated the test to handle multiple sinks. The sinks cut their
transmissions by the number of them running so that they do not
overwhelm the source.

Added a simple shell script to kick off sinks on multiple hosts as
well as a source on the host where the shell script is run.  The script
also collects the output of all the sinks and the source into files named
for the host on which the tests are run.  A date is appended to each output
file to make it unique per run.
2008-04-24 06:56:45 +00:00
scf
cab3742f10 Add four utility functions related to struct grp processing modeled in-part
after similar calls related to struct pwd in libutil/pw_util.c:
  - gr_equal()
    Perform a deep comparison of two struct grp's.  It does a thorough, yet
    unoptimized comparison of all the members regardless of order.

  - gr_make()
    Create a string (see group(5)) from a struct grp.

  - gr_dup()
    Duplicate a struct grp.  Returns a value that is a single contiguous
    block of memory.

  - gr_scan()
    Create a struct grp from a string (as produced by gr_make()).

MFC after:	3 weeks
2008-04-23 00:49:13 +00:00
scf
e3c15650b0 Differentiate in the tests against getenv() between an empty string and a
NULL by having the test program return *NULL* for NULL's (no existing
variable) instead of an empty string (variable with empty value).
2008-04-23 00:45:48 +00:00