Commit Graph

2456 Commits

Author SHA1 Message Date
Adrian Chadd
418b9e0c1b Bring over a tool to create and destroy wtap instances.
Submitted by:	Monthadar Al Jaberi <monthadar@gmail.com>
2012-01-11 17:51:56 +00:00
Eitan Adler
2394cc2228 X11BASE has been deprecated for a long time and will die soon
Approved by:	x11 (eadler)
Approved by:	brucec
MFC after:	1 week
2012-01-09 00:48:19 +00:00
Jilles Tjoelker
c6791c926e sh: Avoid possible echo options in a testcase. 2012-01-06 23:20:33 +00:00
Adrian Chadd
6b1dcfcd83 Import the first cut of "bsdbox".
This uses the existing crunchgen infrastructure to build
a series of tools designed to replace the base and networking
tools on an embedded system.

It reuses 'bsd.crunchgen.mk' to drive the actual file
creation. The rescue build system also uses this.

Unlike busybox, it doesn't include its own source - instead,
it just builds from the sources in /usr/src/ and leverages
the existing BSD framework.

Thie is still quite messy and could do with a whole lot of
cleaning up.   However it is proving to be very useful with
my current build framework, allowing me to build binary root
images that are about 30% less than simply cherrypicking files
and libraries from an installworld.
2012-01-06 00:56:31 +00:00
Ulrich Spörlein
381edcda1e Convert files over to UTF-8.
These files contained various combinations of Big5, eucJP and KOI8-U
encoded strings. The byte representations of their respective encodings
have been translated to $'...' escape sequences as understood by our sh(1).

With help from:	jilles
2012-01-05 21:36:53 +00:00
Pawel Jakub Dawidek
ba804f54f9 Fix an obvious typo. We do want to specify file permission when we pass O_CREAT. 2012-01-03 22:52:29 +00:00
Robert Watson
6508f34eb6 Add WITHOUT_CAPSICUM src.conf(5) define, which can be used to compile out
use of Capsicum by userspace applications.

MFC after:	3 weeks
Sponsored by:	Google, Inc.
2012-01-02 21:57:58 +00:00
Jean-Sébastien Pédron
840fac731b Adapt testsuite following change in Domain Search error handling
In this testsuite, warning() and error() have the same behaviour.

PR:		bin/163431
Sponsored by:	Yakaz (http://www.yakaz.com)
2011-12-30 14:41:47 +00:00
Ulrich Spörlein
8ce070c1b2 Spelling fixes for tools/
Add some $FreeBSD$ tags so svn will allow the commit.
2011-12-30 00:04:11 +00:00
Robert Watson
b77dd854a8 Fix typo in comment.
MFC after:	3 days
2011-12-29 15:34:59 +00:00
Ulrich Spörlein
47e236b178 Reencode files from latin1 to UTF-8. 2011-12-29 12:33:27 +00:00
Jilles Tjoelker
3a1b9c9e82 sh: Allow quoting ^ and ] in bracket expressions. 2011-12-28 23:51:17 +00:00
Olivier Houchard
0044d1b553 Oops, if we want to check from 0 to nsock, the test condition should be
< nsock, not >.

Pointy hat to:	cognet
Submitted by:	Olivier Cochard-Labbe <olivier AT cochard doT me>
2011-12-28 13:01:12 +00:00
Adrian Chadd
d015e7e4d2 Oops, my bad. Fix a broken thing I introduced earlier. 2011-12-26 19:41:46 +00:00
Jilles Tjoelker
80cdf644e6 sh: Add some testcases for pasting $*/$@ directly to a literal.
This also passes on stable/8.
2011-12-25 13:24:48 +00:00
Adrian Chadd
61c0c6fe76 Add in ath_ee_9287_print. 2011-12-23 02:57:18 +00:00
Navdeep Parhar
7be5be337a Catch up with new driver ioctls in cxgbe.
MFC after:	1 month
2011-12-16 20:38:22 +00:00
Navdeep Parhar
733b92779e Many updates to cxgbe(4)
- Device configuration via plain text config file.  Also able to operate
  when not attached to the chip as the master driver.

- Generic "work request" queue that serves as the base for both ctrl and
  ofld tx queues.

- Generic interrupt handler routine that can process any event on any
  kind of ingress queue (via a dispatch table).

- A couple of new driver ioctls.  cxgbetool can now install a firmware
  to the card ("loadfw" command) and can read the card's memory
  ("memdump" and "tcb" commands).

- Lots of assorted information within dev.t4nex.X.misc.*  This is
  primarily for debugging and won't show up in sysctl -a.

- Code to manage the L2 tables on the chip.

- Updates to cxgbe(4) man page to go with the tunables that have changed.

- Updates to the shared code in common/

- Updates to the driver-firmware interface (now at fw 1.4.16.0)

MFC after:	1 month
2011-12-16 02:09:51 +00:00
Max Khon
548f8e2d41 Fix last-minute typo. 2011-12-15 06:12:43 +00:00
Max Khon
174da58b23 Add job error output test.
make(1) with openpty() currently fails this test: there's a race condition
and error output is sometimes lost.
2011-12-15 06:01:06 +00:00
Jilles Tjoelker
1fc7f6471e Add a test for r228510. 2011-12-14 23:26:48 +00:00
Dimitry Andric
8f506e9e08 Add more files to cleanup with 'make delete-old' when WITHOUT_CLANG is
in effect.

MFC after:	1 week
2011-12-11 14:01:11 +00:00
John Baldwin
f627c55e7e - Add a test for PR 151758.
- While here, make this compile and work on non-i386:
  - Use CMSG_SPACE(), CMSG_LEN(), and CMSG_FIRSTHDR() instead of ignoring
    padding between 'struct cmsghdr' and control message payloads.
  - Don't initialize the control message before calling recvmsg().
    Instead, check that we get a valid control message on return from
    recvmsg().
- Use errx() instead of err() for some errors that don't report failures
  that set errno.

Requested by:	kib (1)
2011-12-09 19:24:17 +00:00
Dimitry Andric
d4c8b5d2e8 Vendor import of llvm 3.0 final release:
http://llvm.org/svn/llvm-project/llvm/tags/RELEASE_30/final@145349
2011-12-09 18:27:22 +00:00
Luigi Rizzo
506cc70cce 1. Fix the handling of link reset while in netmap more.
A link reset now is completely transparent for the netmap client:
   even if the NIC resets its own ring (e.g. restarting from 0),
   the client will not see any change in the current rx/tx positions,
   because the driver will keep track of the offset between the two.

2. make the device-specific code more uniform across different drivers
   There were some inconsistencies in the implementation of the netmap
   support routines, now drivers have been aligned to a common
   code structure.

3. import netmap support for ixgbe . This is implemented as a very
   small patch for ixgbe.c (233 lines, 11 chunks, mostly comments:
   in total the patch has only 54 lines of new code) , as most of
   the code is in an external file sys/dev/netmap/ixgbe_netmap.h ,
   following some initial comments from Jack Vogel about making
   changes less intrusive.
   (Note, i have emailed Jack multiple times asking if he had
   comments on this structure of the code; i got no reply so
   i assume he is fine with it).

Support for other drivers (em, lem, re, igb) will come later.

"ixgbe" is now the reference driver for netmap support. Both the
external file (sys/dev/netmap/ixgbe_netmap.h) and the device-specific
patches (in sys/dev/ixgbe/ixgbe.c) are heavily commented and should
serve as a reference for other device drivers.

Tested on i386 and amd64 with the pkt-gen program in tools/tools/netmap,
the sender does 14.88 Mpps at 1050 Mhz and 14.2 Mpps at 900 MHz
on an i7-860 with 4 cores and 82599 card. Haven't tried yet more
aggressive optimizations such as adding 'prefetch' instructions
in the time-critical parts of the code.
2011-12-05 12:06:53 +00:00
Eitan Adler
0a79dbc6b5 Fix some uninitialized variables in pipe regression tests that result in
failure.

PR:		misc/161175
Submitted by:	gianni@
Approved by:	nwhitehorn@
MFC after:	1 week
2011-12-05 04:20:13 +00:00
Jean-Sébastien Pédron
409139f051 Support domain-search in dhclient(8)
The "domain-search" option (option 119) allows a DHCP server to publish
a list of implicit domain suffixes used during name lookup. This option
is described in RFC 3397.

For instance, if the domain-search option says:
    ".example.org .example.com"
and one wants to resolve "foobar", the resolver will try:
    1. "foobar.example.org"
    2. "foobar.example.com"

The file /etc/resolv.conf is updated with a "search" directive if the
DHCP server provides "domain-search".

A regression test suite is included in this patch under
tools/regression/sbin/dhclient.

PR:		bin/151940
Sponsored by	Yakaz (http://www.yakaz.com)
2011-12-04 14:44:31 +00:00
Max Khon
5f73185f0f Revert to conservative defaults. WITH_PROFILE is a default now.
NO_PROFILE overrides in Makefile.inc1 and bsd.own.m are left intact
so that the reversal to the WITHOUT_PROFILE will be easier in future.
2011-12-02 09:09:54 +00:00
Konstantin Belousov
8df934eb55 Add a simple test for pipe inode numbers reported by fstat(2).
Submitted by:	gianni
MFC after:	1 week
2011-12-01 11:20:25 +00:00
Max Khon
e90e78598e Add WITH_CTF description. 2011-11-30 18:22:44 +00:00
Max Khon
df62aec1a0 Add three execution tests for make(1):
- plus: execute "+command" when run with -jX -n
- ellipsis: ellipsis ("...") from variable
- empty: empty command (from variable)

Currently make(1) fails all three tests:
- plus: segmentation fault due to incorrect command list handling
- ellipsis: works in compat mode but fails in job (-jX) mode
- empty:
        - compat mode: prints error message
	- job mode: works but prints empty string
2011-11-30 05:49:17 +00:00
Max Khon
d0ed1ea4b7 Turn off profiled libs build by default.
Can be enabled back using WITH_PROFILE=yes in /etc/src.conf
2011-11-29 19:46:17 +00:00
Jilles Tjoelker
f4f4b264b5 test: Add more testcases.
The new testcases pass even on old stable/7, but some other implementations
manage to get them wrong.

Also remove a few duplicate testcases.
2011-11-28 23:10:53 +00:00
Dimitry Andric
34b874d804 Add WITH_LIBCPLUSPLUS under tools/build/options; the knob itself was
already added in a previous revision.
2011-11-28 17:56:46 +00:00
Max Khon
c33e09b444 Add a comment that shows how to limit the build to the specific list of arches. 2011-11-28 14:03:36 +00:00
Jilles Tjoelker
0d4c3087c0 sh: Add tests for some corner cases of 'case' exit status.
These already work properly.
2011-11-26 22:28:25 +00:00
Max Khon
b8a1e4a8c3 Add missing ;; 2011-11-24 14:22:05 +00:00
Max Khon
bc14d7f4c4 Utility script to build specific parts of the source tree on all arches 2011-11-24 14:16:01 +00:00
Adrian Chadd
317d14cf46 Tidy up the statistic documentation.
Sponsored by:	Hobnob, Inc.
2011-11-23 05:03:27 +00:00
Adrian Chadd
1df8da4c64 Add the new statistics introduced in r227868.
Sponsored by:	Hobnob, Inc.
2011-11-23 05:01:23 +00:00
Jilles Tjoelker
bf3db314f7 sh: Allow unsetting OPTIND.
Note that only assigning the decimal value 1 resets getopts, as before.
2011-11-20 21:48:50 +00:00
Dimitry Andric
fd75cb79ce Revert r227538, since it doesn't compile with clang at all (it doesn't
allow the built-in operations to be redefined, at least not without
excessive force).

Instead, just disable LLVM's support for atomic operations for now.
Nothing in either clang or the tablegen tools currently depends on it.

This still allows users of head built before r198344 to upgrade to
top-of-head seamlessly.
2011-11-17 21:06:53 +00:00
Luigi Rizzo
68b8534bdf Bring in support for netmap, a framework for very efficient packet
I/O from userspace, capable of line rate at 10G, see

	http://info.iet.unipi.it/~luigi/netmap/

At this time I am bringing in only the generic code (sys/dev/netmap/
plus two headers under sys/net/), and some sample applications in
tools/tools/netmap. There is also a manpage in share/man/man4 [1]

In order to make use of the framework you need to build a kernel
with "device netmap", and patch individual drivers with the code
that you can find in

	sys/dev/netmap/head.diff

The file will go away as the relevant pieces are committed to
the various device drivers, which should happen in a few days
after talking to the driver maintainers.

Netmap support is available at the moment for Intel 10G and 1G
cards (ixgbe, em/lem/igb), and for the Realtek 1G card ("re").
I have partial patches for "bge" and am starting to work on "cxgbe".
Hopefully changes are trivial enough so interested third parties
can submit their patches. Interested people can contact me
for advice on how to add netmap support to specific devices.

CREDITS:
    Netmap has been developed by Luigi Rizzo and other collaborators
    at the Universita` di Pisa, and supported by EU project CHANGE
    (http://www.change-project.eu/)
    The code is distributed under a BSD Copyright.

[1] In my opinion is a bad idea to have all manpage in one directory.
  We should place kernel documentation in the same dir that contains
  the code, which would make it much simpler to keep doc and code
  in sync, reduce the clutter in share/man/ and incidentally is
  the policy used for all of userspace code.
  Makefiles and doc tools can be trivially adjusted to find the
  manpages in the relevant subdirs.
2011-11-17 12:17:39 +00:00
Dimitry Andric
5a880d34e1 LLVM uses atomic operations, which are not supported on i386 and GCC
emits calls for them, rather than expanding them inline.  Older FreeBSD
versions compile for i386 by default and as such we end up with
unresolved symbols when we build LLVM's TableGen utility as a build
tool on them.  Add the functions that GCC emits here, but don't bother
to make them atomic. Such is not needed.

Submitted by:	marcel
MFC after:	1 week
2011-11-15 20:15:58 +00:00
David Schultz
35ee51e291 A regression test to ensure that arc4random returns different sequences
in parent and child processes after a fork.
2011-11-15 05:55:15 +00:00
Olivier Houchard
c2a24727c8 Add IPv6 support to netblast/netsend/netreceive
PR:		bin/161368
Submitted by:	Olivier Cochard-Labbe <olivier AT cochard doT me>
2011-11-08 17:23:43 +00:00
Jilles Tjoelker
ddc13b6f44 fifo_misc test: Fix swapped lseek arguments.
It worked regardless because SEEK_CUR happens to be 1.
2011-11-05 22:33:19 +00:00
Jilles Tjoelker
06842f4c3e sh: Add test for exit status of for loop without items.
POSIX says the exit status of a for loop without any items shall be 0. There
are no exceptions if the exit status of the previous command was not 0 or if
the item list contains a command substitution with non-zero exit status.
2011-10-28 23:02:21 +00:00
Adrian Chadd
b1b75b3b75 Bring over the new aggregate statistics from the 11n branch.
Some of these values are currently updated by the driver (the 11n
RX related statistics) so they are immediately useful.
2011-10-26 16:11:49 +00:00
Pawel Jakub Dawidek
13e6fd986b Fix resize regressions tests - we need to destroy BSDlabel before we can
create GPT.

MFC after:	3 days
2011-10-25 13:41:12 +00:00
Poul-Henning Kamp
b2d1ddebf1 Add a "-P olddistfiles" facility to prefetch ports distfiles, using an
old distfile directory as primary source:

      mkdir /freebsd/ports/distfiles.old
      mv /freebsd/ports/distfiles/* /freebsd/ports/distfiles.old
      sh sysbuild.sh -c $yourconfig -P /freebsd/ports/distfiles.old
      rm -rf /freebsd/ports/distfiles.old

Unfortunately bsd.ports.mk does not attempt to use a hard-link so
while this runs you need diskspace for both your old and your "new"
distfiles.
2011-10-23 19:46:01 +00:00
Pawel Jakub Dawidek
1ae7ff8ba6 Because ZFS boot code was very fragile in the past and real PITA to debug,
introduce zfsboottest.sh script that will verify if it will be possible to boot
from the given pool.

	# zfsboottest.sh system

Where "system" is pool name of the pool we want to boot from.

What is being verified by the script:
- Does the pool exist?
- Does it have bootfs property configured?
- Is mountpoint property of the boot dataset set to 'legacy'?

Dataset configured in bootfs property has to be mounted to perform more
checks:
- Does the /boot directory in boot dataset exist?
- Is this dataset configured as root file system in /etc/fstab or set
  in vfs.root.mountfrom variable in /boot/loader.conf?

By using zfsboottest tool the script will read all the files in /boot
directory using ZFS boot code and calculate their checksums.
Then, it will walk /boot directory using find(1) though regular file sytem
and also read all the files in /boot directory and calculate their checksums.
If any of the files cannot be looked up, read or checksum is invalid it will
be reported and booting off of this pool is probably not possible.

Some additional checks may be interesting as well. For example if the disks
contain proper pmbr and gptzfsboot code or if all expected files in /boot/
are present.

When upgrading FreeBSD, one should snapshot datasets that contain operating
system, upgrade (install new world and kernel) and use zfsboottest.sh to verify
if it will be possible to boot from new configuration. If all is good one
should upgrade boot blocks, by eg.:

	# gpart -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada1

If something is wrong, one should rollback datasets and report the problems.

MFC after:	3 days
2011-10-21 13:44:26 +00:00
Pawel Jakub Dawidek
cf43b453ec - Allow to specify multiple files to check, eg.
zfsboottest gpt/system0 gpt/system1 - /boot/kernel/kernel /boot/zfsloader

- Instead of printing file's content calculate MD5 hash of the file,
  so it can be easly compared to the hash calculated via file system.
- Some other minor improvements.

MFC after:	3 days
2011-10-21 13:13:18 +00:00
David Schultz
417c551014 Add regression tests for modf{,f,l}(). 2011-10-21 06:36:40 +00:00
David Schultz
6fcec4dd2b Tests for complex trig and hyperbolic functions. 2011-10-21 06:34:38 +00:00
David Schultz
417f648842 Tests for cancellation in fma(). Also include more tests for 128-bit
long doubles. Thanks for clusteradm (simon) for making the needed
hardware available.
2011-10-21 06:32:54 +00:00
Dimitry Andric
30815c536b Vendor import of llvm release_30 branch r142614:
http://llvm.org/svn/llvm-project/llvm/branches/release_30@142614
2011-10-20 21:10:27 +00:00
Jilles Tjoelker
b0e4234a5a Fix some memory errors in *at() regression tests. 2011-10-18 22:51:40 +00:00
David Schultz
31b4d3aef3 Add some tests for corner cases of log() in unusual rounding modes.
I wrote these ages ago, but they've been failing until now.
2011-10-15 05:28:13 +00:00
David Schultz
9c7781b7a3 Add some tests for double-rounding bugs in fma(). 2011-10-15 05:26:16 +00:00
Andrew Thompson
b1657d09e6 Fix build after TARGET_BIG_ENDIAN was nuked from orbit. 2011-10-11 01:11:57 +00:00
Stanislav Sedov
611ff617cf - Add missing interdependencies to kerberos libraries. Some of the
kerberos libraries were not linked properly (missing dependencies),
  which causes 3rd party applications linking to fail when --as-needed
  ld flag is used.  I also added the --no-undefined ld(1) flag to make
  sure that there're no missing dependencies.

MFC after:	3 days
2011-09-27 07:14:12 +00:00
Andriy Gapon
ed8945cb71 zfsboottest: some additional enhancements
- redirect diagnostics printfs in the boot code to stderr
- do not read trailing garbage from a trailing block of a file

Also add my copyright to the file after making so many changes.

Approved by:	re (kib)
MFC after:	1 week
2011-09-16 08:24:31 +00:00
Andriy Gapon
d560f3523c zfstest: rename to zfsboottest and move to tools
Approved by:	re (kib)
MFC after:	1 week
2011-09-16 08:22:48 +00:00
Marius Strobl
7493181297 Fix alignment assumptions.
PR:		160289
Approved by:	re (kib)
MFC after:	3 days
2011-09-02 16:40:18 +00:00
Bjoern A. Zeeb
8a006adb24 Add support for IPv6 to ipfw fwd:
Distinguish IPv4 and IPv6 addresses and optional port numbers in
user space to set the option for the correct protocol family.
Add support in the kernel for carrying the new IPv6 destination
address and port.
Add support to TCP and UDP for IPv6 and fix UDP IPv4 to not change
the address in the IP header.
Add support for IPv6 forwarding to a non-local destination.
Add a regession test uitilizing VIMAGE to check all 20 possible
combinations I could think of.

Obtained from:	David Dolson at Sandvine Incorporated
		(original version for ipfw fwd IPv6 support)
Sponsored by:	Sandvine Incorporated
PR:		bin/117214
MFC after:	4 weeks
Approved by:	re (kib)
2011-08-20 17:05:11 +00:00
Jonathan Anderson
b465884f42 Test process descriptors.
Ensure that process descriptors work as expected. We should be able to:
 - pdfork(), like regular fork(), but producing a process descriptor
 - pdgetpid() to convert a PD into a PID
 - pdkill() to send signals to a process identified by a PD

Approved by:  re (kib), mentor (rwatson)
Sponsored by: Google Inc
2011-08-18 23:15:04 +00:00
Jonathan Anderson
d6f7248983 poll(2) implementation for capabilities.
When calling poll(2) on a capability, unwrap first and then poll the
underlying object.

Approved by: re (kib), mentor (rwatson)
Sponsored by: Google Inc
2011-08-16 14:14:56 +00:00
Jonathan Anderson
d1b6899e83 Rename CAP_*_KEVENT to CAP_*_EVENT.
Change the names of a couple of capability rights to be less
FreeBSD-specific.

Approved by: re (kib), mentor (rwatson)
Sponsored by: Google Inc
2011-08-12 14:26:47 +00:00
Jonathan Anderson
a0108be612 Test *at(2) calls with capability-mode lookup.
This commit adds regression testing for openat(), fstatat(), etc. with
capability scoping ("strict relative" lookup), which applies:
 - in capability mode
 - when performing any *at() lookup relative to a capability

These tests will fail until the *at() code is committed; on my local
instance, with the *at() changes, they all pass.

Approved by: re (kib), mentor (rwatson)
Sponsored by: Google Inc
2011-08-12 10:52:46 +00:00
Jonathan Anderson
dbb202b398 Use the right printf() format string without a cast to maxint_t.
As per kib's suggestion, we also change test_count from a size_t to an int;
its value at the moment is 4, and we only expect it to go up to 7.

Approved by: re (kib), mentor (rwatson)
Sponsored by: Google Inc
2011-08-11 15:52:06 +00:00
Robert Watson
a9d2f8d84f Second-to-last commit implementing Capsicum capabilities in the FreeBSD
kernel for FreeBSD 9.0:

Add a new capability mask argument to fget(9) and friends, allowing system
call code to declare what capabilities are required when an integer file
descriptor is converted into an in-kernel struct file *.  With options
CAPABILITIES compiled into the kernel, this enforces capability
protection; without, this change is effectively a no-op.

Some cases require special handling, such as mmap(2), which must preserve
information about the maximum rights at the time of mapping in the memory
map so that they can later be enforced in mprotect(2) -- this is done by
narrowing the rights in the existing max_protection field used for similar
purposes with file permissions.

In namei(9), we assert that the code is not reached from within capability
mode, as we're not yet ready to enforce namespace capabilities there.
This will follow in a later commit.

Update two capability names: CAP_EVENT and CAP_KEVENT become
CAP_POST_KEVENT and CAP_POLL_KEVENT to more accurately indicate what they
represent.

Approved by:	re (bz)
Submitted by:	jonathan
Sponsored by:	Google Inc
2011-08-11 12:30:23 +00:00
Navdeep Parhar
223eb00dd0 Move cxgbtool from usr.sbin to tools/tools.
Approved by:	re (kib)
MFC after:	1 month
2011-08-10 22:03:34 +00:00
Robert Watson
e397f116c3 Properly initialise the "len" argument to getsockname(2) in the tcpdrop
regression test so that it works (more) consistently.

Approved by:	re (bz)
Sponsored by:	Juniper Networks
2011-08-06 19:20:17 +00:00
Jonathan Anderson
b7f2d66a79 Expect fchflags(2) to fail with EOPNOTSUPP on NFS.
Even if we have CAP_FCHFLAGS, fchflags(2) fails on NFS. This is normal
and expected, so don't fail the test because of it.

Note that, whether or not we are on NFS, fchflags(2) should always fail
with ENOTCAPABLE if we are using a capability that does not have the
CAP_FCHFLAGS right.

Approved by: re (kib), mentor (rwatson)
Sponsored by: Google Inc
2011-08-05 17:43:11 +00:00
Jonathan Anderson
da7496721e Flesh out the cap_test regression test.
Add more regression testing, some of which is expected to fail until we
commit more kernel implementation.

Approved by: re (kib), mentor (rwatson)
Sponsored by: Google Inc
2011-08-04 17:17:57 +00:00
Jonathan Anderson
f8c6c2cf5a Flesh out the cap_test regression test.
Add more regression testing, some of which is expected to fail until we
commit more kernel implementation.

Approved by: re (kib), mentor (rwatson)
Sponsored by: Google Inc
2011-08-04 14:20:13 +00:00
Andriy Gapon
235cc4c620 update smp related documentation after recent changes
Remove references to machdep.hlt_logical_cpus and
machdep.hlt_cpus sysctls and tunables.
Document machdep.hyperthreading_allowed and
hint.lapic.X.disabled tunables.

Prompted by:	ru
Proofreading:	bf
Reviewed by:	jhb
Approved by:	re (kib)
2011-07-30 20:42:14 +00:00
Adrian Chadd
9381916024 Add athradar, an implementation of the radar parameter diagnostic
API.

This is a reimplementation from scratch.

Approved by:	re (kib)
2011-07-22 09:34:31 +00:00
Dimitry Andric
411bd29eea Vendor import of llvm trunk r135360:
http://llvm.org/svn/llvm-project/llvm/trunk@135360
2011-07-17 15:36:56 +00:00
Jilles Tjoelker
53b93f2f8a sh: Add a test for a fairly obscure case with aliases.
This also passes on stable/8.
2011-07-16 16:14:14 +00:00
Philip Paeps
daf097c040 Garbage-collect the tools for maintaining the previous PCI vendors list. The
sources this tool collates are no longer available and the format of the
current database is directly usable by pciconf(8) without needing any special
processing.
2011-07-16 15:43:14 +00:00
Jilles Tjoelker
9ea47cacda posix_spawn: If an error is detected in the child process, reap the zombie.
Formerly, in this case an error was returned but the pid was also returned
to the application, requiring the application to use unspecified behaviour
(the returned pid in error situations) to avoid zombies.

Now, reap the zombie and do not return the pid.

MFC after:	2 weeks
2011-07-10 14:20:11 +00:00
Jonathan Anderson
345f2b96e2 Clarify the meaning of a test.
Rather than using err() if either of two failure conditions
fires (which can produce spurious error messages), just use
errx() if the one condition that really matters fires.

In practice, this single test is enough to detect the failure
mode we're looking for (kqueue being inherited across fork).

Approved by: mentor (rwatson), re (Capsicum blanket)
Sponsored by: Google Inc
2011-07-08 12:16:30 +00:00
Jonathan Anderson
0136244a52 Ensure that kqueue is not inherited across fork().
Modify the existing unit test (from libkqueue) which already exercises process events via
fork() and kill(). Now, the child process simply checks that the 'kqfd' descriptor is invalid.

Some minor modifications were required to make err() work correctly. It seems that this test
was imported using the output of a configure script, but config.h was not included in key
places, nor was its syntax correct (need '#define HAVE_FOO 1' rather than '#define HAVE_FOO').

Finally, change main() to run the "proc" suite by default, but widened the '#if TODO' in
proc.c to include the non-functioning test event_trigger().

Approved by: mentor (rwatson), re (Capsicum blanket)
Sponsored by: Google Inc
2011-07-07 18:07:03 +00:00
Jilles Tjoelker
b5845df384 sh: Test that '!' is literal if quoted and first char of bracket expression
This also works on stable/8.
2011-06-25 20:37:43 +00:00
Hans Petter Selasky
c9a6ce0cd8 - Need to respect the module name and the USB mode when accumulating device ID's.
- Be more verbose on file seek failures. Allow a file size of zero.
- Improve the wrapper shell.

MFC after:	14 days
2011-06-25 15:22:44 +00:00
Hans Petter Selasky
4449ead376 - Improve bus_autoconf tool.
- Implement simple and generic language which can
be used to describe any kind of device ID structures.
- Fix endian issues.
- Add an example format file.

Suggested by:	imp @
MFC after:	14 days
2011-06-25 13:44:05 +00:00
Hans Petter Selasky
a433a3d8c9 - We need to sort all USB device ID's together. Else the matching order will
be wrong. This is required because devd only executes one entry.

MFC after:	14 days
2011-06-24 21:27:33 +00:00
Hans Petter Selasky
160d9dc32b - Make sure we don't match the wrong device by adding
a match for the bus the device belongs to.

PR:		misc/157903
MFC after:	14 days
2011-06-24 04:35:58 +00:00
Hans Petter Selasky
e71c21385e - Add additional information to the PnP info of USB HUBs children which
is now required by bus_autoconf.
- Allow interface class matching even if device class is vendor specific.
- Update bus_autoconf tool to not generate system and subsystem match lines
  for the nomatch event.

PR:		misc/157903
MFC after:	14 days
2011-06-24 04:16:06 +00:00
Hans Petter Selasky
f1a16106b6 - Move all USB device ID arrays into so-called sections,
sorted according to the mode which they support:
	host, device or dual mode
- Add generic tool to extract these data:
	tools/bus_autoconf

Discussed with:	imp
Suggested by:	Robert Millan <rmh@debian.org>
PR:		misc/157903
MFC after:	14 days
2011-06-24 02:30:02 +00:00
Jilles Tjoelker
57b1b54fdd sh: Add test for r223282. 2011-06-19 00:00:36 +00:00
Ed Schouten
9f0c9022c2 Add WITHOUT_UTMPX switch to the build system.
This knob removes the tools that are exclusively used to view and
maintain the databases maintained by utmpx, namely last, users, who,
wtmpcvt, ac, lastlogin and utxrm.

The tool w is not in this list, because it has some other functionality
which is unrelated to utmpx; it is hardlinked to the uptime tool.
2011-06-17 21:30:21 +00:00
Ed Schouten
2663175a9e Don't remove the periodic script for ac(8) when setting WITHOUT_ACCT. 2011-06-17 21:20:41 +00:00
Ed Schouten
f1c344b293 Don't omit ac(8) as part of WITHOUT_ACCT.
The WITHOUT_ACCT switch is supposed to omit tools related to process
accounting, namely accton and sa. ac(8) is just a simple tool that
prints statistics based on data in the utx.log database. It has nothing
to do with the former.
2011-06-17 20:47:44 +00:00
Jilles Tjoelker
c9afaa6389 sh: Add case statement fallthrough (with ';&' instead of ';;').
Replacing ;; with the new control operator ;& will cause the next list to be
executed as well without checking its pattern, continuing until a list ends
with ;; or until the end of the case statement. This is like omitting
"break" in a C "switch" statement.

The sequence ;& was formerly invalid.

This feature is proposed for the next POSIX issue in Austin Group issue
#449.
2011-06-17 13:03:49 +00:00
Jilles Tjoelker
f5f215e251 sh: Skip variables with invalid names in "set", "export -p", "readonly -p".
This ensures the output of these commands is valid shell input.
2011-06-17 10:21:24 +00:00
Jilles Tjoelker
c5aef5377c sh: Reduce unnecessary forks with eval.
The eval special builtin now runs the code with EV_EXIT if it was run
with EV_EXIT itself.

In particular, this eliminates one fork when a command substitution contains
an eval command that ends with an external program or a subshell.

This is similar to what r220978 did for functions.
2011-06-16 21:50:28 +00:00
Jilles Tjoelker
ff4dc67299 sh: Add support for named character classes in bracket expressions.
Example:
  case x in [[:alpha:]]) echo yes ;; esac
2011-06-15 21:48:10 +00:00