sh/tests: Add a second kind of binary scripts without #!One of the reasons for git commite0f5c1387df23c8c4811f5b24a7ef6ecac51a71a was to make "actually portableexecutables" work. Add a test that
sh/tests: Add a second kind of binary scripts without #!One of the reasons for git commite0f5c1387df23c8c4811f5b24a7ef6ecac51a71a was to make "actually portableexecutables" work. Add a test that is more like those.MFC after: 1 week
show more ...
sh: Keep ignored SIGINT/SIGQUIT after set in a background jobIf job control is not enabled, a background job (... &) ignores SIGINT andSIGQUIT, but this can be reverted using the trap builtin in t
sh: Keep ignored SIGINT/SIGQUIT after set in a background jobIf job control is not enabled, a background job (... &) ignores SIGINT andSIGQUIT, but this can be reverted using the trap builtin in the same shellenvironment.Using the set builtin to change options would also revert SIGINT and SIGQUITto their previous dispositions.This broke due to r317298. Calling setsignal() reverts the effect ofignoresig().Reported by: bdreweryMFC after: 1 week
sh/tests: Fix flaky execution/bg12.0When job control is not enabled, the shell ignores SIGINT while waiting fora foreground process unless that process exits on SIGINT. In this case, theforegroun
sh/tests: Fix flaky execution/bg12.0When job control is not enabled, the shell ignores SIGINT while waiting fora foreground process unless that process exits on SIGINT. In this case, theforeground process is sleep and it does not exit on SIGINT because thesignal is only sent to the shell. Depending on order of events, this couldcause the SIGINT to be unexpectedly ignored.On lightly loaded bare metal, the chance of this happening tends to be lessthan 0.01% but with higher loads and/or virtualization it becomes morelikely.Starting the sleep in background and using the wait builtin ensures SIGINTwill not be ignored.PR: 247559Reported by: lwhsuMFC after: 1 week
sh/tests: Add tests for SIGINT in non-jobc background commandsIf job control is not enabled, background commands shall ignore SIGINT andSIGQUIT, and it shall be possible to override that ignore in
sh/tests: Add tests for SIGINT in non-jobc background commandsIf job control is not enabled, background commands shall ignore SIGINT andSIGQUIT, and it shall be possible to override that ignore in the same shell.MFC after: 1 week
sh: Allow more scripts without #!Austin Group bugs #1226 and #1250 changed the requirements for shell scriptswithout #! (POSIX does not specify #!; this is about the shell executionwhen execve(2)
sh: Allow more scripts without #!Austin Group bugs #1226 and #1250 changed the requirements for shell scriptswithout #! (POSIX does not specify #!; this is about the shell executionwhen execve(2) returns an [ENOEXEC] error).POSIX says we shall allow execution if the initial part intended to beparsed by the shell consists of characters and does not contain the NULcharacter. This allows concatenating a shell script (ending with exec orexit) and a binary payload.In order to reject common binary files such as PNG images, check that thereis a lowercase letter or expansion before the last newline before the NULcharacter, in addition to the check for the newline character suggested byPOSIX.
sh: Fix double INTON with vforkThe shell maintains a count of the number of times SIGINT processing hasbeen disabled via INTOFF, so SIGINT processing resumes when all disableshave enabled again (
sh: Fix double INTON with vforkThe shell maintains a count of the number of times SIGINT processing hasbeen disabled via INTOFF, so SIGINT processing resumes when all disableshave enabled again (INTON).If an error occurs in a vfork() child, the processing of the error enablesSIGINT processing again, and the INTON in vforkexecshell() causes the countto become negative.As a result, a later INTOFF may not actually disable SIGINT processing. Thismight cause memory corruption if a SIGINT arrives at an inopportune time. Asof r360452, it causes the shell to abort when it would unsafely allocate orfree memory in certain ways.Note that various places such as errors in non-special builtinsunconditionally reset the count to 0, so the problem might still not alwaysbe visible.PR: 246497Reported by: jbeichMFC after: 2 weeks
sh: Test that executing various binary files is rejectedIf executing a file fails with an [ENOEXEC] error, the shell executes thefile as a shell script, except that this execution may instead resu
sh: Test that executing various binary files is rejectedIf executing a file fails with an [ENOEXEC] error, the shell executes thefile as a shell script, except that this execution may instead result in anerror message if the file is binary.Per a recent Austin Group interpretation, we will need to change this toallow a concatenation of a shell script and a binary payload. SeeAustin Group bugs #1226 and #1250.MFC after: 1 week
sh: Add set -o pipefailThe pipefail option allows checking the exit status of all commands in apipeline more easily, at a limited cost of complexity in sh itself. It workssimilarly to the option
sh: Add set -o pipefailThe pipefail option allows checking the exit status of all commands in apipeline more easily, at a limited cost of complexity in sh itself. It workssimilarly to the option in bash, ksh93 and mksh.Like ksh93 and unlike bash and mksh, the state of the option is saved when apipeline is started. Therefore, even in the case of commands like A | B &a later change of the option does not change the exit status, the same way (A | B) &works.Since SIGPIPE is not handled specially, more work in the script is requiredfor a proper exit status for pipelines containing commands such as head thatmay terminate successfully without reading all input. This can be somethinglike( cmd1 r=$? if [ "$r" -gt 128 ] && [ "$(kill -l "$r")" = PIPE ]; then exit 0 else exit "$r" fi) | headPR: 224270Relnotes: yes
sh: Add test for exported but unset variablesPR: 233545
sh: Add simple test for 'set -C' (noclobber).To ensure fast test runs, race conditions are not tested.
Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installedafter r298107Summary of changes:- Replace all instances of FILES/TESTS with ${PACKAGE}FILES. This ensures that na
Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installedafter r298107Summary of changes:- Replace all instances of FILES/TESTS with ${PACKAGE}FILES. This ensures that namespacing is kept with FILES appropriately, and that this shouldn't need to be repeated if the namespace changes -- only the definition of PACKAGE needs to be changed- Allow PACKAGE to be overridden by callers instead of forcing it to always be `tests`. In the event we get to the point where things can be split up enough in the base system, it would make more sense to group the tests with the blocks they're a part of, e.g. byacc with byacc-tests, etc- Remove PACKAGE definitions where possible, i.e. where FILES wasn't used previously.- Remove unnecessary TESTSPACKAGE definitions; this has been elided into bsd.tests.mk- Remove unnecessary BINDIRs used previously with ${PACKAGE}FILES; ${PACKAGE}FILESDIR is now automatically defined in bsd.test.mk.- Fix installation of files under data/ subdirectories in lib/libc/tests/hash and lib/libc/tests/net/getaddrinfo- Remove unnecessary .include <bsd.own.mk>s (some opportunistic cleanup)Document the proposed changes in share/examples/tests/tests/... via examplesso it's clear that ${PACKAGES}FILES is the suggested way forward in terms ofreplacing FILES. share/mk/bsd.README didn't seem like the appropriate methodof communicating that info.MFC after: never probablyX-MFC with: r298107PR: 209114Relnotes: yesTested with: buildworld, installworld, checkworld; buildworld, packageworldSponsored by: EMC / Isilon Storage Division
DIRDEPS_BUILD: Connect MK_TESTS.Sponsored by: EMC / Isilon Storage Division
Avoid adding the '-release' suffix to non-debug kernel packages.Sponsored by: The FreeBSD Foundation
sh: Make sure output suitable as shell input is also printable.Commands like 'export -p', 'set' and 'trap', and tracing enabled via 'set-x' generate output suitable as shell input by adding quotes
sh: Make sure output suitable as shell input is also printable.Commands like 'export -p', 'set' and 'trap', and tracing enabled via 'set-x' generate output suitable as shell input by adding quotes as necessary.If there are control characters other than newline or invalid UTF-8sequences, use $'...' and \OOO to display them safely.The resulting output is not parsable by a strict POSIX.1-2008 shell but shfrom FreeBSD 9.0 and newer and many other shells can parse it.
Convert bin/sh/tests to ATFThe new code uses a "test discovery mechanism" to determinewhat tests are available for executionThe test shell can be specified via: kyua test -v test_suites.FreeB
Convert bin/sh/tests to ATFThe new code uses a "test discovery mechanism" to determinewhat tests are available for executionThe test shell can be specified via: kyua test -v test_suites.FreeBSD.bin.sh.test_shell=/path/to/test/shSponsored by: EMC / Isilon Storage DivisionApproved by: jmmv (mentor)Reviewed by: jilles (maintainer)
Migrate tools/regression/bin/ tests to the new layout.This change is a proof of concept on how to easily integrate existingtests from the tools/regression/ hierarchy into the /usr/tests/ testsuit
Migrate tools/regression/bin/ tests to the new layout.This change is a proof of concept on how to easily integrate existingtests from the tools/regression/ hierarchy into the /usr/tests/ testsuite and on how to adapt them to the new layout for src.To achieve these goals, this change:- Moves tests from tools/regression/bin/<tool>/ to bin/<tool>/tests/.- Renames the previous regress.sh files to legacy_test.sh.- Adds Makefiles to build and install the tests and all their supporting data files into /usr/tests/bin/.- Plugs the legacy_test test programs into the test suite using the new TAP backend for Kyua (appearing in 0.8) so that the code of the test programs does not have to change.- Registers the new directories in the BSD.test.dist mtree file.Reviewed by: freebsd-testingApproved by: rpaulo (mentor)