aboutsummaryrefslogtreecommitdiff
path: root/bin/sh/tests/parameters
Commit message (Collapse)AuthorAgeFilesLines
* sh tests: Fix ktrace usage now that envvars are traced by defaultMark Johnston2024-11-172-2/+2
| | | | | | | | | | Some sh tests use ktrace to see whether a particular file, specified in the environment, was accessed by the shell. After commit 65a4daeaf324, this test matches the ktrace record generated by execve. Use ktrace to only log name lookups, to avoid such false matches. Fixes: 65a4daeaf324 ("ktrace: log execve(2) arguments and environment")
* Remove residual blank line at start of MakefileWarner Losh2024-07-151-1/+0
| | | | | | | This is a residual of the $FreeBSD$ removal. MFC After: 3 days (though I'll just run the command on the branches) Sponsored by: Netflix
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-1620-20/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* sh: Do not import IFS's value from the environment.Jilles Tjoelker2016-10-082-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | Per Austin group issue #884, always set IFS to $' \t\n'. As before, IFS will be exported iff it was in the environment. Most shells (e.g. bash, ksh93 and mksh) already did this. This change improves predictability, in that scripts can simply rely on the default value. However, the effect on security is little, since applications should not be calling the shell with attacker-controlled environment variable names in the first place and other security-sensitive variables such as PATH should be and are imported by the shell. When using a new sh with an old (before 10.2) libc wordexp(), IFS is no longer passed on. Otherwise, wordexp() continues to pass along IFS from the environment per its documentation. Discussed with: pfg Relnotes: yes Notes: svn path=/head/; revision=306843
* Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installedEnji Cooper2016-05-041-21/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | after r298107 Summary 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 examples so it's clear that ${PACKAGES}FILES is the suggested way forward in terms of replacing FILES. share/mk/bsd.README didn't seem like the appropriate method of communicating that info. MFC after: never probably X-MFC with: r298107 PR: 209114 Relnotes: yes Tested with: buildworld, installworld, checkworld; buildworld, packageworld Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=299094
* MFHGlen Barber2016-03-101-0/+11
|\ | | | | | | | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=296625
| * DIRDEPS_BUILD: Connect MK_TESTS.Bryan Drewery2016-03-091-0/+11
| | | | | | | | | | | | | | Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=296587
* | Fix build.Glen Barber2016-02-031-1/+0
| | | | | | | | | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=295215
* | First pass to fix the 'tests' packages.Glen Barber2016-02-021-0/+4
|/ | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=295171
* sh: Add limited test for ${#@} and ${#*}.Jilles Tjoelker2015-12-062-0/+19
| | | | | | | | POSIX leaves the result of expanding ${#@} and ${#*} unspecified, but ensure it is numeric. Notes: svn path=/head/; revision=291903
* sh: Link tests/parameters/positional8.0 to the build.Jilles Tjoelker2015-12-051-0/+1
| | | | | | | This was forgotten in r291025. Notes: svn path=/head/; revision=291857
* sh: Fix ""$@, which should not use the special case for "$@".Jilles Tjoelker2015-11-181-0/+31
| | | | | | | | "$@" should expand to no words if there are no positional parameters, but ""$@ should always expand to at least an empty word. Notes: svn path=/head/; revision=291025
* Treat IFS separators in "$*" as quoted.Jilles Tjoelker2014-10-283-0/+17
| | | | | | | This makes a difference if IFS starts with *, ?, [ or a CTL* byte. Notes: svn path=/head/; revision=273802
* Convert bin/sh/tests to ATFEnji Cooper2014-08-131-3/+5
| | | | | | | | | | | | | | | | The new code uses a "test discovery mechanism" to determine what tests are available for execution The test shell can be specified via: kyua test -v test_suites.FreeBSD.bin.sh.test_shell=/path/to/test/sh Sponsored by: EMC / Isilon Storage Division Approved by: jmmv (mentor) Reviewed by: jilles (maintainer) Notes: svn path=/head/; revision=269902
* sh: Correctly handle positional parameters beyond INT_MAX on 64-bit systems.Jilles Tjoelker2014-07-122-0/+15
| | | | | | | | | | | | | | | | Currently, there can be no more than INT_MAX positional parameters. Make sure to treat all higher ones as unset to avoid incorrect results and crashes. On 64-bit systems, our atoi() takes the low 32 bits of the strtol() and sign-extends them. On 32-bit systems, the call to atoi() returned INT_MAX for too high values and there is not enough address space for so many positional parameters, so there was no issue. Notes: svn path=/head/; revision=268576
* sh: Consistently treat ${01} like $1.Jilles Tjoelker2014-07-122-0/+5
| | | | | | | | Leading zeroes were ignored when checking whether a positional parameter is set, but not when expanding its value. Ignore leading zeroes in any case. Notes: svn path=/head/; revision=268568
* sh: Add test for ${01} and ${010} that already works.Jilles Tjoelker2014-07-082-0/+5
| | | | | | | | | | | Although it is probably unwise to use this, POSIX is clear that leading zeroes are permitted in positional parameters (and do not indicate octal). Such positional parameters are checked for being unset and/or null correctly, but their value is incorrectly expanded. Notes: svn path=/head/; revision=268436
* sh: Initialize OPTIND=1 even if it came from the environment.Jilles Tjoelker2013-12-242-0/+4
| | | | Notes: svn path=/head/; revision=259846
* Migrate tools/regression/bin/ tests to the new layout.Julio Merino2013-12-1110-0/+184
This change is a proof of concept on how to easily integrate existing tests from the tools/regression/ hierarchy into the /usr/tests/ test suite 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-testing Approved by: rpaulo (mentor) Notes: svn path=/head/; revision=259210