mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 16:22:46 -04:00
sh: Add simple test for 'set -C' (noclobber).
To ensure fast test runs, race conditions are not tested.
This commit is contained in:
parent
75409ce1dd
commit
3c47cee5c8
2 changed files with 13 additions and 0 deletions
|
|
@ -37,6 +37,7 @@ ${PACKAGE}FILES+= redir4.0
|
|||
${PACKAGE}FILES+= redir5.0
|
||||
${PACKAGE}FILES+= redir6.0
|
||||
${PACKAGE}FILES+= redir7.0
|
||||
${PACKAGE}FILES+= set-C1.0
|
||||
${PACKAGE}FILES+= set-n1.0
|
||||
${PACKAGE}FILES+= set-n2.0
|
||||
${PACKAGE}FILES+= set-n3.0
|
||||
|
|
|
|||
12
bin/sh/tests/execution/set-C1.0
Normal file
12
bin/sh/tests/execution/set-C1.0
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
# $FreeBSD$
|
||||
|
||||
T=$(mktemp -d "${TMPDIR:-/tmp}/sh-test.XXXXXXXX") || exit
|
||||
trap 'rm -rf "$T"' 0
|
||||
|
||||
set -C
|
||||
echo . >"$T/a" &&
|
||||
[ -s "$T/a" ] &&
|
||||
{ ! true >"$T/a"; } 2>/dev/null &&
|
||||
[ -s "$T/a" ] &&
|
||||
ln -s /dev/null "$T/b" &&
|
||||
true >"$T/b"
|
||||
Loading…
Reference in a new issue