Commit Graph

2337 Commits

Author SHA1 Message Date
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
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