Commit Graph

2067 Commits

Author SHA1 Message Date
Matt Jacob
a55e712763 Add a multipath oriented test. 2010-08-09 00:36:22 +00:00
Jilles Tjoelker
40d2ccc36f sh: Add more testcases for ${var:-word}.
Whether POSIX requires these is unclear.

They pass with 8-stable sh as well.
2010-08-08 17:03:23 +00:00
Pawel Jakub Dawidek
6a8ecf4c59 Various cleanups, mostly to make the test work on FreeBSD/ZFS. 2010-08-06 23:58:54 +00:00
Pawel Jakub Dawidek
f8287aa0ac ${GREP} can only be used after loading 'conf'. 2010-08-06 21:58:53 +00:00
Pawel Jakub Dawidek
8f3ff75868 Don't use egrep directly - use ${GREP}. 2010-08-06 21:57:11 +00:00
Pawel Jakub Dawidek
3556206aad Check first todo() argument against operating system name and operating system
name plus file system name.
2010-08-06 21:56:32 +00:00
Pawel Jakub Dawidek
520fad0247 For FreeBSD and Linux use awk's toupper() function.
Suggested by:	ed
2010-08-06 21:53:50 +00:00
Pawel Jakub Dawidek
f7bfc405c7 Convert file system type to upper case. 2010-08-06 21:02:53 +00:00
Pawel Jakub Dawidek
bbbc67e6ff Add tests for mknod(2).
Submitted by:	Jan Senolt <senoltj@centrum.cz>
Submitted by:	Milan Cermak <Milan.Cermak@Sun.COM>
Polished by:	pjd
2010-08-06 20:51:39 +00:00
Pawel Jakub Dawidek
ce29a12f91 Add mknod(2) support.
Submitted by:	Jan Senolt <senoltj@centrum.cz>
Submitted by:	Milan Cermak <Milan.Cermak@Sun.COM>
2010-08-06 20:48:10 +00:00
Pawel Jakub Dawidek
c9ea9723b0 Sort includes. 2010-08-06 20:46:26 +00:00
Pawel Jakub Dawidek
6c4a79e1b1 open(2) returns EOPNOTSUPP when trying to open a socket. 2010-08-06 19:22:42 +00:00
Pawel Jakub Dawidek
ce2decb660 Test for EACCES also when opening FIFO or directory. 2010-08-06 19:20:35 +00:00
Pawel Jakub Dawidek
482fdb1334 Test O_RDONLY|O_RDWR flags as potentially invalid. 2010-08-06 19:19:14 +00:00
Pawel Jakub Dawidek
adab8b00ab Make description readable. 2010-08-06 19:18:19 +00:00
Pawel Jakub Dawidek
b8f0e1661c Add missing -U argument to usage. 2010-08-06 19:16:48 +00:00
Pawel Jakub Dawidek
feb6813113 Implement two new syscalls: bind(2) and connect(2) for operating on UNIX
domain sockets.
2010-08-06 19:16:20 +00:00
Jilles Tjoelker
b84d7af7c6 sh: Return 0 from eval if no command was given.
This makes a difference if there is a command substitution.

To make this work, evalstring() has been changed to set exitstatus to 0 if
no command was executed (the string contained only whitespace).

Example:
  eval $(false); echo $?
should print 0.
2010-08-03 22:17:29 +00:00
Jilles Tjoelker
d0a59d85df sh: Add a test for a corner case in eval that already works correctly. 2010-08-01 22:39:07 +00:00
Ulrich Spörlein
32ba16b6e6 Fix a couple of typos.
PR:		docs/148891
Submitted by:	olgeni
MFC after:	1 week
2010-07-30 11:58:18 +00:00
Jilles Tjoelker
6c0c240366 sh: Fix crash due to uninitialized here-document.
If an ; or & token was followed by an EOF token, pending here-documents were
left uninitialized. Execution would crash, either in the main shell process
for literal here-documents or in a child process for expanded
here-documents. In the latter case the problem is hard to detect apart from
the core dumps and log messages.

Side effect: slightly different retries on inputs where EOF is not
persistent.

Note that tools/regression/bin/sh/parser/heredoc6.0 still causes a similar
crash in a child process. The text passed to eval is malformed and should be
rejected.
2010-07-25 22:25:52 +00:00
Gabor Kovesdan
4dc88ebedf Add BSD grep to the base system and make it our default grep.
Deliverables: Small and clean code (1,4 KSLOC vs GNU's 8,5 KSLOC),
              lower memory usage than GNU grep, GNU compatibility,
              BSD license.

TODO:         Performance is somewhat behind GNU grep but it is only
              significant for bigger searches.  The reason is complex, the
              most important factor is that GNU grep uses lots of
              optimizations to improve the speed of the regex library.
              First, we need a modern regex library (practically by adopting
              TRE), add support for GNU-style non-standard regexes and then
              reevalute the performance issues and look for bottlenecks.  In
              the meantime, for those, who need better performance, it is
              possible to build GNU grep by setting WITH_GNU_GREP.

Approved by:            delphij (mentor)
Obtained from:          OpenBSD (http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/grep/),
                        freegrep (http://github.com/howardjp/freegrep)
Sponsored by:           Google SoC 2008
Portbuild tests run by: kris, pav, erwin
Acknowledgements to:    fjoe (as SoC 2008 mentor),
                        everyone who helped in reviewing and testing
2010-07-22 19:11:57 +00:00
Simon L. B. Nielsen
74d53216ac Hook newsyslog regression tests to the Makefile 'build'.
MFC after:	3 weeks
2010-07-22 11:38:48 +00:00
Simon L. B. Nielsen
0f68c374aa Add regression tests for newsyslog. These are far from a complete
test of newsyslog, as they were mainly made to test 'newsyslog -t',
but they do test the basic functionality.

The test 'framework' was based on dds@'s code in
src/tools/regression/bin/mv/.

Note that currently these tests are not fully correct for the
non-timestamp based rotation case, as it seems like newsyslog actually
by default keeps a file too much around.

MFC after:	3 weeks
2010-07-22 11:37:54 +00:00
Ed Schouten
781ad8efe1 Chase LLVM version bump to 2.8. 2010-07-21 08:27:56 +00:00
Jilles Tjoelker
cac4830ce4 sh: Allow a background command consisting solely of redirections.
Example:
  </dev/null &

MFC after:	2 weeks
2010-07-18 12:45:31 +00:00
Ed Maste
5d61e252b4 Use canonical spelling of FreeBSD.org
Submitted by:	Garrett Cooper
2010-07-06 19:43:40 +00:00
Ed Maste
45e6a6a1a5 Switch to my @freebsd.org email address. 2010-07-06 17:00:20 +00:00
Jilles Tjoelker
778c4480f4 sh: Remove comment that the comma operator is missing in arithmetic
expansion.

The comma operator is not listed in POSIX.1-2008 XCU 1.1.2.1 Arithmetic
Precision and Operations (referenced by XCU 2.6.4 Arithmetic Expansion) and
is therefore not required.
2010-07-02 21:31:24 +00:00
Robert Watson
7812ede3ff Add TCP scalability testing wrapper scripts for tcpp.
Sponsored by:	Juniper Networks
MFC after:	1 week
2010-06-22 10:46:57 +00:00
Robert Watson
a34eb060cc Revised tuning advice for tcpp benchmarking: do it in loader.conf, and
tweak more TCP/stack parameters.

Sponsored by:	Juniper Networks
MFC after:	1 week
2010-06-22 10:45:35 +00:00
Brian Somers
5fa77f4fe4 Remove vestiges of 'slip'.
PR:		145648
Submitted by:	alexbestms at wwu dot de and spam at rm-rf dot kiev dot ua
MFC after:	1 week
2010-06-19 09:21:34 +00:00
Alexander Leidinger
e137ba592e Add the ZFS periodic daily scripts to the ZFS part. 2010-06-17 12:37:50 +00:00
Warner Losh
8886dc1652 Allow boot.config to have different values than just -h.
Submitted by:	bsdrp by way of freenas and olivier cochard-labbe
MFC after:	3 days
2010-06-15 23:55:42 +00:00
Warner Losh
358b781628 Allow population of /cfg and /data. Begin the move to making all
slice creation overrideable too, but there's a few problems doing that
for the duplicated partitions (s1 and s2), so just comment that it
needs work.

MFC after:	3 days
2010-06-15 18:18:31 +00:00
Warner Losh
77f9b8a393 Create a make.conf. not needed for runtime, but some ports want to spam it
at compile or install time.

MFC after:	3 days
2010-06-15 18:16:45 +00:00
Warner Losh
d8e85077eb make these convenience functions more convenient by accepting all
args, not just the first.  makes mechanical conversion of old style
more forgiving.

MFC after:	3 days
2010-06-15 18:11:37 +00:00
Ed Schouten
edec9228fa Add Clang to OptionalObsoleteFiles.inc.
This means you can now deinstall Clang by running make delete-old with
WITHOUT_CLANG set.
2010-06-14 19:10:30 +00:00
Ed Schouten
c58a2cf366 Fix typo.
Spotted by:	Garrett Cooper
2010-06-10 06:20:26 +00:00
Ed Schouten
9e303702a0 This should be commented out. 2010-06-09 20:18:18 +00:00
Roman Divacky
2dd5cc396f Add WITHOUT_CLANG file with a description.
Approved by:	ed (mentor)
2010-06-09 20:11:35 +00:00
Matt Jacob
8d7b838eee Add the VHBA package. It is here in tools because it's really a testbed.
Sponsored by:	Panasas
MFC after:	1 month
2010-06-08 22:26:47 +00:00
Robert Watson
698337f653 Rework tcpp output so that it generates a comma-delimited list of values,
optionally with a header if "-h" is passed.  Toast CPU time measurement
in the server for now.  Remove -C and -T, since we now always report
both connections/sec and Gb/sec.

MFC after:	1 week
Sponsored by:	Juniper Networks
2010-06-06 15:27:08 +00:00
Robert Watson
73dd1f4339 Although we currently don't compile in CPU-pinning support by default,
add a -P to enable it if it were.

MFC after:	1 week
Sponsored by:	Juniper Networks
2010-06-05 22:59:37 +00:00
Maxim Konovalov
4a509b9cbf o The typo was intended as it stated in the comment. Revert last.
Spotted by:	dfr
2010-06-04 14:22:49 +00:00
Maxim Konovalov
22fdc015e2 o Makefile BSDfication.
PR:		misc/147461 (with my changes)
Submitted by:	Erik Cederstrand
2010-06-04 08:19:43 +00:00
Maxim Konovalov
1accefb1e1 o Fix typo: .uudef -> .undef.
PR:		misc/147462
Submitted by:	Erik Cederstrand
2010-06-04 08:14:30 +00:00
Brian Somers
9c24af3d15 Fix stuttering sequences and reverse ranges
PR:		123635
Submitted by:	Ulrich Spörlein, uqs at spoerlein dot net
2010-06-02 07:47:29 +00:00
Jilles Tjoelker
5d91007000 sh: Fix a crash if a heredoc was not properly ended and parsing continued.
Example (in interactive mode):
  cat <<EOF && )
The next command typed caused sh to segfault, because the state for the here
document was not reset.

Like parser_temp, this uses the fact that the parser is not re-entered.
2010-05-30 14:20:32 +00:00
Jilles Tjoelker
ba02a307fe sh: Change interaction of command substitution and here documents.
If a command substitution contains a newline token, this no longer starts
here documents of outer commands. This way, we follow POSIX's idea of the
command substitution being a separate script more closely. It also matches
other shells better and is consistent with newline characters in quotes not
starting here documents.

The extension tested in parser/heredoc3.0 ($(cat <<EOF)\ntext\nEOF\n)
continues to be supported.

In particular, this change allows things like
  cat <<EOF && echo `pwd`
(a `` command substitution after a here document)
which formerly silently used an empty file as the here document, because the
EOF of the inner command "pwd" also forced an empty here document.
2010-05-30 14:11:27 +00:00
Jilles Tjoelker
c1564db05d sh: Recognize "--" in . and exec.
Although "--" historically has not been required to be recognized for
certain special builtins that do not take options in POSIX, some other
implementations recognize options for them, requiring scripts to use "--" or
avoid operands starting with "-".

Operands starting with "-" can be avoided with eval by prepending a space,
and cannot occur with break, continue, exit, return and shift as they only
take numbers, nor with times as it does not take operands. With . and exec,
avoiding "-" is not so easy as it may require reimplementing the PATH
search; therefore the current proposal for POSIX is to require recognition
of "--" for them.

We continue to accept other strings starting with "-" as operands to . and
exec, and also "--" if it is alone to . (which would otherwise be invalid
anyway).
2010-05-28 22:40:24 +00:00
Jilles Tjoelker
bc4c1a0670 sh: Add some simple tests for ., exec and return from . script. 2010-05-28 22:08:34 +00:00
Robert Watson
1e4bf1e35f Correct several nits/problems in the unix_close_race regression test.
Submitted by:	Mikolaj Golub <to.my.trociny at gmail.com>
MFC after:	3 days
2010-05-27 15:28:55 +00:00
Robert Watson
07c2a9537e Add unix_close_race, a regresion test to catch ENOTCONN being returned
improperly from one of two instances of close(2) being called
simultaneously on both ends of a connected UNIX domain socket.  The test
tool is slightly tweaked to improve failure modes, and while often does
trigger the problem, doesn't do so consistently due to the nature of the
race.

PR:		kern/144061
Submitted by:	Mikolaj Golub <to.my.trociny@gmail.com>
MFC after:	3 days
2010-05-26 10:46:03 +00:00
Rafal Jaworowski
4f1ca2a872 Introduce a new build knob for Flattened Device Tree support.
Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
2010-05-25 15:12:21 +00:00
Jilles Tjoelker
f7b46e74b3 sh: Add some simplistic tests for the wait builtin. 2010-05-23 22:10:20 +00:00
Jung-uk Kim
bea3599d7d Add an option file for WITHOUT_MAN_UTILS to regenerate src.conf(5). 2010-05-20 00:07:21 +00:00
Ulrich Spörlein
62486687ed mdoc: consistently spell our email addresses <foo@FreeBSD.org>
Reviewed by:	ru
2010-05-19 08:57:53 +00:00
Ulrich Spörlein
0afc94c17a mdoc: move CAVEATS, BUGS and SECURITY CONSIDERATIONS sections to the
bottom of the manpages and order them consistently.

GNU groff doesn't care about the ordering, and doesn't even mention
CAVEATS and SECURITY CONSIDERATIONS as common sections and where to put
them.

Found by:	mdocml lint run
Reviewed by:	ru
2010-05-13 12:07:55 +00:00
Jilles Tjoelker
4710b07ecf sh: Fix pathname expansion with quoted slashes like *\/.
These are git commits 36f0fa8fcbc8c7b2b194addd29100fb40e73e4e9 and
d6d06ff5c2ea0fa44becc5ef4340e5f2f15073e4 in dash.

Because this is the first code I'm importing from dash to expand.c, add the
Herbert Xu copyright notice which is in dash's expand.c.

When pathname expanding *\/, the CTLESC representing the quoted state was
erroneously taken as part of the * pathname component. This CTLESC was then
seen by the pattern matching code as escaping the '\0' terminating the
string.

The code is slightly different because dash converts the CTLESC characters
to backslashes and removes all the other CTL* characters to allow
substituting glob(3).

The effect of the bug was also slightly different from dash (where nothing
matched at all). Because a CTLESC can escape a '\0' in some way, whether
files were included despite the bug depended on memory that should not be
read. In particular, on many machines /*\/ expanded to a strict subset of
what /*/ expanded to.

Example:
  echo /*"/null"

This should print /dev/null, not /*/null.

PR:		bin/146378
Obtained from:	dash
2010-05-11 23:19:28 +00:00
Jilles Tjoelker
58729dbfc4 sh: Add some simple testcases for pathname expansion. 2010-05-11 22:28:55 +00:00
Jilles Tjoelker
cd06f6e065 Fix error in comment. 2010-05-09 17:15:26 +00:00
Jilles Tjoelker
084d796d16 sh: Add some parser tests.
case1.0 tests POSIX requirements and one more for keywords in case
statements. The others test very special cases of command substitution.

These also work on stable/8.
2010-05-09 17:10:50 +00:00
Jilles Tjoelker
4b7fb70199 Generate some tests for sh's case command from the fnmatch tests.
I'm committing the generated files because I don't like a build dependency
for the sh(1) tests, and they are small and will not change much.
2010-05-09 16:15:40 +00:00
Jilles Tjoelker
941af8d6c6 sh: Fix bug in assignment error test.
The test failed if the command returned nonzero exit status, and it really
should return that.
2010-05-09 16:04:32 +00:00
Jilles Tjoelker
e4b50334ec sh: Apply locale vars on builtins, recognize LC_MESSAGES as a locale var.
This allows doing things like LC_ALL=C some_builtin to run a builtin under a
different locale, just like is possible with external programs. The
immediate reason is that this allows making printf(1) a builtin without
breaking things like LC_NUMERIC=C printf '%f\n' 1.2

This change also affects special builtins, as even though the assignment is
persistent, the export is only to the builtin (unless the variable was
already exported).

Note: for this to work for builtins that also exist as external programs
such as /bin/test, the setlocale() call must be under #ifndef SHELL. The
shell will do the setlocale() calls which may not agree with the environment
variables.
2010-05-05 21:48:40 +00:00
Philip Paeps
63a88d586e Fix typo in usage message. Add -n to the list of valid arguments.
MFC after:	1 day
2010-04-30 15:12:30 +00:00
Marius Strobl
b09fefd1f6 Add a TestFloat based test suite for floating-point implementations
currently supporting sparc64. After a `make depend all` there are
three programs; testsoftfloat for testing against the SoftFloat in
src/lib/libc/softfloat for reference purposes, testemufloat for
testing the emulator source in src/lib/libc/sparc64/fpu and testfloat
for testing with the installed libc. Support for other architectures
can be added as needed.

PR:		144900
Submitted by:	Peter Jeremy
2010-04-24 12:11:41 +00:00
Jung-uk Kim
ed9dd82fa2 Adjust a test case and make it more jump optimization neutral for JIT case. 2010-04-23 22:42:49 +00:00
Jilles Tjoelker
e9615a1a0e sh: Add some more tests for ${v#...} and ${v%...}.
These pass on stable/8 as well.
2010-04-23 17:26:49 +00:00
Robert Watson
0e4ae43e17 Merge @176820, @176822, @177156 to tcpp from P4 to HEAD:
Improve accuracy of connection data transfer math.

  Disable Nagle's algorithm to avoid delaying transfers of data --
  will want to refine this to combine payload with header transfer,
  however.

  Now that we're running w/o Nagle, try to send the initial data
  burst with the header in a single TCP segment.

  Prefer %zu to %ju for size_t.

MFC after:	1 week
Sponsored by:	Juniper, Inc.
2010-04-21 00:52:55 +00:00
Rui Paulo
4ad53b2511 Dump the AR_PHY_TURBO register on the AR5416. This register holds 11n
configurations.

Sponsored by:	iXsystems, inc.
2010-04-19 17:16:23 +00:00
Jilles Tjoelker
348c81a032 sh: Add testcases for double-quotes within quoted ${var+-...} (non-POSIX).
POSIX leaves things like "${var+"word"}" undefined.
We follow traditional ash behaviour here.
Hence, these testcases also work on stable/8.
2010-04-18 22:13:45 +00:00
Jilles Tjoelker
8eac1f9477 sh: On startup of the shell, use PWD from the environment if it is valid.
Unset PWD if it is incorrect and no value for it can be determined.
This preserves the logical current directory across shell invocations.

Example (assuming /home is a symlink):
$ cd
$ pwd
/home/foo
$ sh
$ pwd
/home/foo

Formerly the second pwd would show the physical path (symlinks resolved).
2010-04-17 14:35:46 +00:00
Jilles Tjoelker
139ac6b239 fnmatch: Fix bad FNM_PERIOD disabling if an asterisk has been seen.
Example: fnmatch("a*b/*", "abbb/.x", FNM_PATHNAME | FNM_PERIOD)

PR:		116074
MFC after:	1 week
2010-04-16 22:29:24 +00:00
Jilles Tjoelker
bfbe51816a Add some tests for fnmatch(3).
MFC after:	1 week
2010-04-16 22:15:26 +00:00
Jilles Tjoelker
e74e09f851 sh: Test that bogus values of PWD are not imported from the environment.
Current versions pass this test trivially by never importing PWD, but I plan
to change sh to import PWD if it is an absolute pathname for the current
directory, possibly containing symlinks.
2010-04-11 20:21:34 +00:00
Warner Losh
6a47fc38e2 Fix comment about NANO_ARCH. It can be set now. Also add a warning
about how it confuses TARGET and TARGET_ARCH and the need to separate
the two out into independent variables.
2010-04-06 16:23:12 +00:00
Jilles Tjoelker
8ef6f9f2d2 sh: Add test for nested arithmetic substitution.
Pre-r206145 sh changes nested arithmetic substitution to parentheses, which
is not always correct, as exercised by this test.
2010-04-04 16:48:33 +00:00
Jilles Tjoelker
07c0b06768 sh: Add test for some associativity in arithmetic. 2010-04-04 16:29:48 +00:00
Jilles Tjoelker
634e9188af sh: Do tilde expansion in substitutions.
This applies to word in ${v-word}, ${v+word}, ${v=word}, ${v?word} (which
inherits quoting from the outside) and in ${v%word}, ${v%%word}, ${v#word},
${v##word} (which does not inherit any quoting).

In all cases tilde expansion is only attempted at the start of word, even if
word contains spaces. This agrees with POSIX and other shells.

This is the last part of the patch tested in the exp-run.

Exp-run done by: erwin (with some other sh(1) changes)
2010-04-03 22:04:44 +00:00
Jilles Tjoelker
5cada825b4 sh: Fix duplicate variable name in test. 2010-04-03 21:56:24 +00:00
Jilles Tjoelker
382e6ae29d sh: Add some testcases for the working parts of tilde expansion. 2010-04-03 21:32:22 +00:00
Jilles Tjoelker
6415a1293f sh: Allow quoting pattern match characters in ${v%pat} and ${v#pat}.
Note that this depends on r206145 for allowing pattern match characters to
have their special meaning inside a double-quoted expansion like "${v%pat}".

PR:		bin/117748
Exp-run done by:	erwin (with some other sh(1) changes)
2010-04-03 21:07:50 +00:00
Jilles Tjoelker
8cf06f5eee sh: Fix various things about expansions:
* remove the backslash from \} inside double quotes inside +-=?
  substitutions, e.g. "${$+\}a}"
* maintain separate double-quote state for ${v#...} and ${v%...};
  single and double quotes are special inside, even in a double-quoted
  string or here document
* keep track of correct order of substitutions and arithmetic

This is different from dash's approach, which does not track individual
double quotes in the parser, trying to fix this up during expansion.
This treats single quotes inside "${v#...}" incorrectly, however.

This is similar to NetBSD's approach (as submitted in PR bin/57554), but
recognizes the difference between +-=? and #% substitutions hinted at in
POSIX and is more refined for arithmetic expansion and here documents.

PR:		bin/57554
Exp-run done by:	erwin (with some other sh(1) changes)
2010-04-03 20:55:56 +00:00
Jilles Tjoelker
cc4b8e985d sh: Add some testcases for the working parts of ${v%...} and ${v#...}. 2010-04-03 20:14:10 +00:00
Warner Losh
9ffdaef2bf Two fixes:
(1) We don't need a custom install_kernel.  We can install without
symbols by adding INSTALL_NODEBUG (which likely should be
WITHOUT_KERNEL_SYMBOLS_FILE, or something shorter) to CONF_INSTALL
(2) for make buildenv stage, use NANO_MAKE_CONF_BUILD rather than the
non-existant NANO_MAKE_CONF.

MFC after:	7 days
2010-03-31 18:18:37 +00:00
Warner Losh
638554f5f2 Stop hard coding i386 as the arch for the build. Instead, default to the
processor we're running on.  Also, supply amd64 version of create_diskimage
that's the same as i386's.

# didn't fix the confusion between using the processor for this and using
# the machine (which would be more appropriate).  NANO_ARCH smashes the two
# together right now.

MFC after:	7 days
2010-03-31 14:42:07 +00:00
Xin LI
36e60cda45 Remove GNU cpio after fix of CVE-2010-0624.
Note that this is actually a no-op for most users, as this GNU
cpio was broken on -HEAD and 8-STABLE since last March until
the recent fix.

FreeBSD 8.0+ uses BSD cpio by default and the code is being
actively maintained.

Blessed by:	kientzle
With hat:	secteam
MFC after:	3 days
2010-03-26 17:02:32 +00:00
Poul-Henning Kamp
ac33b97078 Use gpart(8) to set the active boot partition. 2010-03-24 11:21:33 +00:00
Edwin Groothuis
531a1a4b2c Replace -b with -C and -B (as proposed by Alexander).
Add -3, -A and -B to the usage.
Update regression test for the new parameters.
2010-03-21 21:33:21 +00:00
Konstantin Belousov
fe03378831 Add missing headers. While there, arrange headers alphabetically.
MFC after:	3 days
2010-03-16 20:42:54 +00:00
Konstantin Belousov
888025e45a Add missing headers.
MFC after:	3 days
2010-03-16 20:41:45 +00:00
Jilles Tjoelker
c3bb858966 sh: Do not abort on a redirection error on a compound command.
Redirection errors on subshells already did not abort the shell because
the redirection is executed in the subshell.

Other shells seem to agree that these redirection errors should not abort
the shell.

Also ensure that the redirections will be cleaned up properly in cases like
  command eval '{ shift x; } 2>/dev/null'

Example:
  { echo bad; } </var/empty/x; echo good
2010-03-14 14:24:35 +00:00
Jilles Tjoelker
a4a58620d3 sh: Add test for redirection error on subshell (should not abort). 2010-03-14 13:51:12 +00:00
Konstantin Belousov
43648bc031 Remove dot at the end of errx() message.
Noted by:	bde
MFC after:	3 days
2010-03-14 13:29:09 +00:00
Konstantin Belousov
6e2e67160e Adjust style, fix typo, do not print errno because it is meaningless there.
This test fails for now.

MFC after:	3 days
2010-03-14 13:05:48 +00:00
Konstantin Belousov
31f957034a Make it compile on LP64 arches.
MFC after:	3 days
2010-03-14 13:04:09 +00:00
Edwin Groothuis
3d7b0d842d Create regression tests for ncal:
- A couple of tests to check if the layout of the generated calenders
  is correct.

- A couple of tests to see if impossible combinations for -3, -A,
  -m, -y etc properly abort.

- A couple of test to confirm that the order of -A, -B, -3 etc give
  the right number of months.
2010-03-14 10:24:03 +00:00
Jilles Tjoelker
3a64dbc20a sh: Do not abort on a redirection error if there is no command word.
Although simple commands without a command word (only assignments and/or
redirections) are much like special builtins, POSIX and most shells seem to
agree that redirection errors should not abort the shell in this case. Of
course, the assignments persist and assignment errors are fatal.

To get the old behaviour portably, use the ':' special builtin.
To get the new behaviour portably, given that there are no assignments, use
the 'true' regular builtin.
2010-03-13 22:53:17 +00:00
Jilles Tjoelker
45249f152b sh: Add test for assignment errors (e.g. trying to change a readonly var).
We currently ignore readonly status for assignments before regular builtins
and external programs (these assignments are not persistent anyway), so just
check that the readonly variable really is not changed.
The test depends on the command builtin changes for 'command :'.
2010-03-13 22:30:52 +00:00
Jilles Tjoelker
d5c6bd74d9 sh: Add tests for " and $ inside `. 2010-03-12 23:23:46 +00:00
Jilles Tjoelker
0de1173276 sh: Add some testcases for ${v=w}, ${v-w}, ${v+w}.
These expansions, which were already in the Bourne shell, work correctly for
the most part. The testcases are only about the parts that already work
correctly.
2010-03-07 18:43:29 +00:00
Jilles Tjoelker
0019284ae8 sh: Add various testcases for here documents.
They are mainly about expansions in here documents but because all the
testcases are in $() command substitution, we also test that $() command
substitution is recursively parsed (or very close to it).
2010-03-07 15:08:42 +00:00
Jilles Tjoelker
1749097497 sh: Make sure to popredir() even if a function caused an error. 2010-03-06 17:31:09 +00:00
Jilles Tjoelker
544754df6f sh: Make sure to popredir() even if a special builtin caused an error. 2010-03-06 17:09:22 +00:00
Jilles Tjoelker
c848bc18e8 sh: Improve the command builtin:
* avoid unnecessary fork
* allow executing builtins via command
* executing a special builtin via command removes its special properties

Obtained from:	NetBSD (parts)
2010-03-06 16:57:53 +00:00
Jaakko Heinonen
12794df244 - Use errx(3) instead of err(3) when checking if snprintf(3) succeeded.
snprintf(3) doesn't set errno in the tested cases.
- If the same argument reference (for example %1) was specified more than
  once, the command didn't necessarily fit to the final command buffer. Fix
  this using a dynamic sbuf buffer. Add a few regression tests for the case.

PR:		bin/95079
No objections:	freebsd-hackers
2010-03-05 15:23:01 +00:00
Joel Dahl
0371d265dc The NetBSD Foundation has granted permission to remove clause 3 and 4 from
their software.

Obtained from:	NetBSD
2010-03-03 07:38:12 +00:00
Joel Dahl
2509081a31 The NetBSD Foundation has granted permission to remove clause 3 and 4 from
their software.

Obtained from:	NetBSD
2010-03-02 22:25:50 +00:00
Joel Dahl
7f890ba505 The NetBSD Foundation has granted permission to remove clause 3 and 4 from
their software.

Obtained from:	NetBSD
2010-03-02 17:05:19 +00:00
Ulrich Spörlein
47e1a877c5 Always assign WARNS using ?=
- fix some nearby style bugs
- include Makefile.inc where it makes sense and reduces duplication

Approved by:	ed (co-mentor)
2010-03-02 16:58:04 +00:00
Antoine Brodin
b974b08f1d Add files to remove when MK_PPP=no. 2010-02-28 14:43:55 +00:00
Antoine Brodin
72647fe8e4 Add files to remove when MK_PORTSNAP=no. 2010-02-28 14:41:28 +00:00
Antoine Brodin
78d8164c0f Add files to remove when MK_PKGTOOLS=no. 2010-02-28 14:39:39 +00:00
Antoine Brodin
c13190b297 Add files to remove when MK_PF=no. 2010-02-28 14:37:39 +00:00
Antoine Brodin
58f47440a2 Add files to remove when MK_NTP=no. 2010-02-28 14:32:29 +00:00
Antoine Brodin
fda29b2349 Update files to remove when MK_RCMDS=no. 2010-02-28 14:29:22 +00:00
Antoine Brodin
50d16bbe9f Add files to remove when MK_RCS=no. 2010-02-28 14:26:28 +00:00
Antoine Brodin
236443476e Add files to remove when MK_ROUTED=no. 2010-02-28 14:24:38 +00:00
Antoine Brodin
1fe4843a49 Add files to remove when MK_TELNET=no. 2010-02-28 14:23:38 +00:00
Antoine Brodin
94cd15a9ee Add files to remove when MK_NDIS=no. 2010-02-28 14:21:15 +00:00
Antoine Brodin
8c7d0ea263 Update files to remove when MK_NCP=no. 2010-02-28 14:13:33 +00:00
Antoine Brodin
c742deed4f Update files to remove when MK_LPR=no. 2010-02-28 14:12:05 +00:00
Antoine Brodin
9586e95257 Add files to remove when MK_WIRELESS=no. 2010-02-28 14:08:12 +00:00
Antoine Brodin
e94be45c0c Do not remove fmt.1 when MK_MAIL=no.
X-MFC-With:	r203584
2010-02-26 23:26:15 +00:00
Ruslan Ermilov
9fd69f37d2 Fixed missing or broken library dependencies. 2010-02-25 14:42:26 +00:00
Ruslan Ermilov
a6d8ff1d6d Moved mcgrab(1) into a separate directory -- our .mk infrastructure
doesn't currently have support for building multiple programs in a
single makefile.

While here, fixed manpages and makefiles (missing dependencies).
2010-02-25 14:36:50 +00:00
Rebecca Cran
8dd83f1e16 Update the sendfile regression test so that it outputs results in the
TAP format.
Add a checksum to verify that the data hasn't been corrupted between
being read from disk and being received.

Approved by:	rrs (mentor)
2010-02-24 23:00:16 +00:00
Attilio Rao
4ed925457a Add a regression test for the kthread(9) interface.
Submitted by:	Giovanni Trematerra
		<giovanni dot trematerra at gmail dot com>
2010-02-20 15:20:28 +00:00
Jilles Tjoelker
9f21d0a3a5 sh: arith: Add a test for a bug in the dash arith code,
which I plan to import at some point.
Our current code handles it fine and it should stay that way.
2010-02-17 22:25:22 +00:00
Jilles Tjoelker
70293312f8 sh: arith: Test an octal constant as well. 2010-02-17 22:22:20 +00:00
Ulrich Spörlein
54673381cd Add missing newline in last line of file.
Uncovered via:	fromcvs vs. svn
Approved by:	ed (co-mentor)
2010-02-16 09:10:21 +00:00
Pawel Jakub Dawidek
7b0706f670 - Implement -q option for pgrep(1).
- Add regression test to test -q option.
2010-02-12 18:52:24 +00:00
Ruslan Ermilov
2949bd100b Fixed error checking of pthread(3) functions.
PR:		143807
Submitted by:	pluknet (partly)
2010-02-12 16:33:03 +00:00
Xin LI
cebcc1ac1b Symbolic link to mailwrapper should only be removed if both MK_MAILWRAPPER
and MK_SENDMAIL is "no".

Reported by:	Rob Farmer <rfarmer at predatorlabs.net>
2010-02-10 00:01:35 +00:00
Xin LI
07ea9a7c2f As it turns out, fmt(1) is being used by the base system as well as the
ports tree extensively and it is probably a good idea to keep it
regardless of NO_MAIL setting.

Reported by:	Alexander Best
Reviewed by:	antoine
X-MFC-With:	r203584
2010-02-09 18:22:26 +00:00
Jilles Tjoelker
91f2621cd1 sh: Make sure the mail2.0 test can actually fail if $MAIL is not touched. 2010-02-08 18:57:18 +00:00
Xin LI
4c63c240fb Add files for NO_MAIL, NO_SENDMAIL and NO_MAILWRAPPER.
MFC after:	2 weeks
2010-02-07 00:38:31 +00:00
Jilles Tjoelker
5706357661 sh: Do not stat() $MAIL/$MAILPATH in non-interactive shells.
These may be NFS mounted, and we should not touch them unless we are going
to do something useful with the information.
2010-02-06 22:57:24 +00:00
Antoine Brodin
a48279bb03 Update files to remove when MK_KERBEROS=no. 2010-02-06 20:21:03 +00:00
Antoine Brodin
e86622b3d7 Add files to remove when MK_JAIL=no. 2010-02-06 20:11:23 +00:00
Antoine Brodin
2677a43216 Update files to remove when MK_IPX=no. 2010-02-06 20:09:55 +00:00
Antoine Brodin
02eb407f8c Add files to remove when MK_IPFW=no. 2010-02-06 20:08:46 +00:00
Antoine Brodin
91ff065b11 Move rescue/ping6 from files to remove when MK_INET6=no to file to remove
when MK_INET6_SUPPORT=no.  (MK_INET6=no implies MK_INET6_SUPPORT=no)
2010-02-06 20:06:06 +00:00
Antoine Brodin
a2ccbc2954 Add file to remove when MK_IDEA=no. 2010-02-06 20:02:56 +00:00
Antoine Brodin
b6d220d05b Add files to remove when MK_GSSAPI=no. 2010-02-06 20:00:35 +00:00
Antoine Brodin
96e9532b9d Add files to remove when MK_GPIB=no. 2010-01-30 19:36:55 +00:00
Antoine Brodin
2ea25692d0 Add files to remove when MK_GDB=no. 2010-01-30 19:33:45 +00:00
Antoine Brodin
051426045b Add files to remove when MK_GAMES=no. 2010-01-30 19:32:01 +00:00