Commit Graph

746 Commits

Author SHA1 Message Date
David E. O'Brien
adcda09cbc Catch up with UNIX98-style PTY's. 2010-01-04 10:59:14 +00:00
David E. O'Brien
41f83263a5 'prove -r' isn't as smart as grog thought. 2010-01-04 10:58:08 +00:00
David E. O'Brien
72cef5b74f You need to be root to run this test. 2010-01-04 09:59:18 +00:00
David E. O'Brien
cd8b25c92c Also cleanup after the test run. 2010-01-04 09:57:00 +00:00
David E. O'Brien
01d217bcc1 Don't process 'lastcomm' if "AUTOMATED" is defined.
The tests for it require manual setup.
2010-01-04 09:54:24 +00:00
David E. O'Brien
8dcfd5d1d6 It is expected these are chmod +x. 2010-01-04 09:50:30 +00:00
David E. O'Brien
faddcb5783 Regression test for r201456. 2010-01-04 09:49:23 +00:00
Jilles Tjoelker
dc82a6f600 sh: Send the "not found" message for builtin <cmd> to redirected fd 2. 2010-01-03 15:01:38 +00:00
Jilles Tjoelker
b485cf94fb sh: Add a regression test that tries out all arithmetic ops.
MFC after:	1 week
2010-01-03 12:50:27 +00:00
David E. O'Brien
043ccc7cf3 Use t1 & t2 as more symbolic than 'a' and 'b' for the two times. 2010-01-03 12:17:51 +00:00
David E. O'Brien
70ec99bfd2 Provide clean output with 'prove -r'. 2010-01-03 11:53:48 +00:00
David E. O'Brien
91212b8c98 Hide expected error output so the 'prove -r' results are easy to read. 2010-01-03 09:31:33 +00:00
David E. O'Brien
a56d32a6a0 Allow to be driven by 'prove -r'. 2010-01-03 09:30:50 +00:00
David E. O'Brien
a174aecc2e Make sure 'pack' is usable for 'prove -r'. 2010-01-03 08:44:18 +00:00
David E. O'Brien
25255d7808 Transform from kernel file to userland source. 2010-01-03 08:33:24 +00:00
Jilles Tjoelker
f7cc73afc8 sh: Fix some bugs with backquoted builtins:
- correctly handle error output in $(builtin 2>&1), clarify out1/out2 vs
  output/errout in the code
- treat all builtins as regular builtins so errors do not abort the shell
  and variable assignments do not persist
- respect the caller's INTOFF

Some bugs still exist:
- expansion errors may still abort the shell
- some side effects of expansions and builtins persist
2010-01-01 18:17:46 +00:00
Brooks Davis
a6fffd6cb0 The devices that supported EVFILT_NETDEV kqueue filters were removed in
r195175.  Remove all definitions, documentation, and usage.

fifo_misc.c:
	Remove all kqueue tests as fifo_io.c performs all those that
	would have remained.

Reviewed by:	rwatson
MFC after:	3 weeks
X-MFC note:	don't change vlan_link_state() function signature
2009-12-31 20:29:58 +00:00
Jilles Tjoelker
0fb60646df sh: Use PATH= assignment in type.
Example:
  PATH=/var/empty; PATH=/bin type ls
2009-12-31 17:44:24 +00:00
Jilles Tjoelker
06a8a57f82 sh: Allow command -pv and command -pV (lookup using _PATH_STDPATH). 2009-12-31 16:13:33 +00:00
Jilles Tjoelker
63ccda7719 sh: arith: Return only 0 and 1 from && and ||.
This agrees with C, POSIX and other shells.
2009-12-30 15:59:40 +00:00
Antoine Brodin
13e403fdea (S)LIST_HEAD_INITIALIZER takes a (S)LIST_HEAD as an argument.
Fix some wrong usages.
Note: this does not affect generated binaries as this argument is not used.

PR:		137213
Submitted by:	Eygene Ryabinkin (initial version)
MFC after:	1 month
2009-12-28 22:56:30 +00:00
Edward Tomasz Napierala
20c87efe63 Make tests for ACL preservation by mv(1) and cp(1) more complete
and easier to follow.
2009-12-27 13:05:56 +00:00
Jilles Tjoelker
29d401c22d sh: Do not run callers' exception handlers in subshells.
Reset the exception handler in the child to main's.

This avoids inappropriate double cleanups or shell duplication when the
exception is caught, such as 'fc' and future 'command eval' and 'command .'.
2009-12-25 20:21:35 +00:00
Edward Tomasz Napierala
28df1e77ee Add regression test for NFSv4 ACLs on UFS. 2009-12-21 20:47:41 +00:00
Robert Watson
407cf730b6 Merge libkqueue test suite through r119
Submitted by:	Mark Heily <mark@heily.com>
2009-12-15 10:43:20 +00:00
Robert Watson
60a396a4f7 Add Mark Heily's libkqueue test suite as a general kqueue test suite to
tools/regression.  It tests a number of aspects of kqueue behavior,
although not all currently pass (possibly bugs in the test suite?).

Submitted by:	Mark Heily <mark at heily.com>
Obtained from:	svn://mark.heily.com/libkqueue/trunk/test (r114)
2009-12-13 20:27:46 +00:00
Jaakko Heinonen
d8eba599f5 Don't read the newline character to line buffer because lines are passed
to wcscoll(3). Newline characters could cause incorrect results when
comparing lines.

Also, if an input line didn't contain a newline character, it was
omitted from the output. According to my interpretation, SUSv3 requires
that the newline is always printed.

Add regression tests for the cases. [1]

PR:		bin/140976
Submitted by:	D'Arcy Cain (original version) [1]
Approved by:	trasz (mentor)
2009-12-12 18:18:46 +00:00
Jilles Tjoelker
df8d66693f sh: Test ;<newline> as well as ; in the 'for' parser test. 2009-12-06 23:31:23 +00:00
Brian Feldman
20f492f0eb Do not gratuitously fail *env(3) operations due to corrupt ('='-less)
**environ entries.  This puts non-getenv(3) operations in line with
getenv(3) in that bad environ entries do not cause all operations to
fail.  There is still some inconsistency in that getenv(3) in the
absence of any environment-modifying operation does not emit corrupt
environ entry warnings.

I also fixed another inconsistency in getenv(3) where updating the
global environ pointer would not be reflected in the return values.
It would have taken an intermediary setenv(3)/putenv(3)/unsetenv(3)
in order to see the change.
2009-12-01 05:04:31 +00:00
Jilles Tjoelker
772e9b41df Disable job control when running 'sh -i' in the testsuite.
Job control tty manipulations sometimes cause the tests to stop (SIGTTOU
and the like) when run from the 'prove' tool.
2009-11-29 22:58:10 +00:00
Jilles Tjoelker
e1ef314121 Fix some cases where file descriptors from redirections leak to programs.
- Redirecting fds that were not open before kept two copies of the
  redirected file.
    sh -c '{ :; } 7>/dev/null; fstat -p $$; true'
    (both fd 7 and 10 remained open)
- File descriptors used to restore things after redirection were not
  set close-on-exec, instead they were explicitly closed before executing
  a program normally and before executing a shell procedure. The latter
  must remain but the former is replaced by close-on-exec.
    sh -c 'exec 7</; { exec fstat -p $$; } 7>/dev/null; true'
    (fd 10 remained open)

The examples above are simpler than the testsuite because I do not want to
use fstat or procstat in the testsuite.
2009-11-29 22:33:59 +00:00
Jung-uk Kim
0cdc14c810 Make this test case little bit more interesting. 2009-11-23 22:28:15 +00:00
Jilles Tjoelker
eaa3489312 sh: Ensure the same command input file is on top after executing a builtin.
This avoids weirdness when 'fc -e vi' or the like is done and there is a
syntax error in the file. Formerly an interactive shell tried to execute
stuff after the syntax error and exited.

This should also avoid similar issues with 'command eval' and 'command .'
when 'command' is implemented properly as in NetBSD sh.

Special builtins did not have this problem since errors in them cause the
shell to exit or to reset various state such as the current command input
file.
2009-11-22 14:04:20 +00:00
Jilles Tjoelker
e3c2cd7237 trap: do not consider a bad signal name a fatal error.
POSIX explicitly prescribes this.
Continue processing any other signals and return status 1.
2009-11-21 20:44:34 +00:00
Stefan Farfeleder
80d5dd5fdb Add a test for r199631. 2009-11-21 14:54:35 +00:00
Stefan Farfeleder
ee47d334ef Add a few very basic tests for cd -{L,P} and pwd -{L,P}. 2009-11-21 14:12:51 +00:00
Jung-uk Kim
908d88b03b Correct copyright date in the BPF regression test. 2009-11-20 19:01:09 +00:00
Jung-uk Kim
448a7ff2ec Adjust BPF JIT compiler regression tests to catch up with r199603. 2009-11-20 18:53:38 +00:00
Jung-uk Kim
b78db64f58 Add a test case for very long BPF program. 2009-11-19 00:00:31 +00:00
Jilles Tjoelker
7ab07e8ada sh: Allow a newline before "in" in a for command, as required by POSIX. 2009-11-14 22:08:32 +00:00
Dag-Erling Smørgrav
2deaa94b6a Add test-pidfile.c and increase warning level. 2009-11-12 01:37:25 +00:00
Dag-Erling Smørgrav
761ea75d41 Test cases for pidfile(3) - including two designed to catch issues arising
from the incorrect use of fcntl(2) instead of flock(2).
2009-11-12 01:37:02 +00:00
Dag-Erling Smørgrav
6830953bc1 Fix warnings and remove one unnecessary use of vfork(). The other could
also be removed with a little more work.
2009-11-12 01:34:55 +00:00
Dag-Erling Smørgrav
a2f8e5b371 Fix warnings 2009-11-12 01:33:57 +00:00
Dag-Erling Smørgrav
1a29dc59c5 Check fork() return value 2009-11-10 10:42:48 +00:00
Jilles Tjoelker
64254a667a sh: Exempt $@ and $* from set -u
This seems more useful and will likely be in the next POSIX standard.

Also document more precisely in the man page what set -u does (note that
$@, $* and $! are the only special parameters that can ever be unset, all
the others are always set, although they may be empty).
2009-10-24 21:20:04 +00:00
Jilles Tjoelker
941538c0f4 Add some tests for ${var?} and set -u. 2009-10-24 20:57:11 +00:00
Jilles Tjoelker
364e9ccb9c wordexp(3): fix some bugs with signals and long outputs
* retry various system calls on EINTR
* retry the rest after a short read (common if there is more than about 1K
  of output)
* block SIGCHLD like system(3) does (note that this does not and cannot
  work fully in threaded programs, they will need to be careful with wait
  functions)

PR:		90580
MFC after:	1 month
2009-10-23 14:50:11 +00:00
Pawel Jakub Dawidek
2cf3d848b6 Fix a case where rename actually succeeds, which is also expected behaviour
according to POSIX. This fixes ZFS on Solaris testing.

Submitted by:	Milan Cermak <Milan.Cermak@Sun.COM>
2009-10-20 21:08:32 +00:00
Dag-Erling Smørgrav
b146811680 Update copyright. 2009-10-19 07:56:03 +00:00