git: a1423456415a - main - sh: nullify ENV in tests
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 20 Aug 2022 11:30:11 UTC
The branch main has been updated by pstef:
URL: https://cgit.FreeBSD.org/src/commit/?id=a1423456415ad4784b31513cfe11438d2446881f
commit a1423456415ad4784b31513cfe11438d2446881f
Author: Piotr Pawel Stefaniak <pstef@FreeBSD.org>
AuthorDate: 2022-08-20 10:16:18 +0000
Commit: Piotr Pawel Stefaniak <pstef@FreeBSD.org>
CommitDate: 2022-08-20 11:27:42 +0000
sh: nullify ENV in tests
This is to avoid loading .shrc which may contain commands that would
result in output different than expected.
Reviewed by: jilles
Differential Revision: https://reviews.freebsd.org/D35876
---
bin/sh/tests/builtins/cd10.0 | 2 +-
bin/sh/tests/builtins/fc1.0 | 2 +-
bin/sh/tests/execution/int-cmd1.0 | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/bin/sh/tests/builtins/cd10.0 b/bin/sh/tests/builtins/cd10.0
index f4b5e0ffca5c..5c165cb21fcc 100644
--- a/bin/sh/tests/builtins/cd10.0
+++ b/bin/sh/tests/builtins/cd10.0
@@ -3,4 +3,4 @@
# Precondition
(cd /bin) || exit
# Verify write error is ignored.
-$SH +m -ic 'CDPATH=/:; cd bin 1</dev/null'
+ENV= $SH +m -ic 'CDPATH=/:; cd bin 1</dev/null'
diff --git a/bin/sh/tests/builtins/fc1.0 b/bin/sh/tests/builtins/fc1.0
index ab7a387b5077..df4852f0b8ac 100644
--- a/bin/sh/tests/builtins/fc1.0
+++ b/bin/sh/tests/builtins/fc1.0
@@ -8,7 +8,7 @@ T=$(mktemp -d sh-test.XXXXXX)
cd $T
mkfifo input output error
-HISTFILE=/dev/null ${SH} +m -i <input >output 2>error &
+ENV= HISTFILE=/dev/null ${SH} +m -i <input >output 2>error &
{
# Syntax error
echo ')' >&3
diff --git a/bin/sh/tests/execution/int-cmd1.0 b/bin/sh/tests/execution/int-cmd1.0
index a1f097b774d6..6b1d366b2e7a 100644
--- a/bin/sh/tests/execution/int-cmd1.0
+++ b/bin/sh/tests/execution/int-cmd1.0
@@ -1,3 +1,3 @@
# $FreeBSD$
-! echo echo bad | $SH -ic 'fi' 2>/dev/null
+! echo echo bad | ENV= $SH -ic 'fi' 2>/dev/null