summaryrefslogtreecommitdiff
path: root/test/system/030-run.bats
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-11-16 16:27:34 +0100
committerGitHub <noreply@github.com>2021-11-16 16:27:34 +0100
commitf031bd23c6f5f790dde383d542c940bfe2dfaadd (patch)
tree34d460f57b3ecf7491ec92a296ebd68e233e8bf6 /test/system/030-run.bats
parent8430ffc72e74f1271174984674a1c2ee6118779e (diff)
parent44d1618dd7eeb2560571b14ba5cece69a93dcaff (diff)
downloadpodman-f031bd23c6f5f790dde383d542c940bfe2dfaadd.tar.gz
podman-f031bd23c6f5f790dde383d542c940bfe2dfaadd.tar.bz2
podman-f031bd23c6f5f790dde383d542c940bfe2dfaadd.zip
Merge pull request #12100 from rhatdan/env
Add option --unsetenv to remove default environment variables
Diffstat (limited to 'test/system/030-run.bats')
-rw-r--r--test/system/030-run.bats22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/system/030-run.bats b/test/system/030-run.bats
index 2c8d08b99..ba21cd21d 100644
--- a/test/system/030-run.bats
+++ b/test/system/030-run.bats
@@ -736,4 +736,26 @@ EOF
is "$output" "$random_1" "output matches STDIN"
}
+@test "podman run defaultenv" {
+ run_podman run --rm $IMAGE printenv
+ is "$output" ".*TERM=xterm" "output matches TERM"
+ is "$output" ".*container=podman" "output matches container=podman"
+
+ run_podman run --unsetenv=TERM --rm $IMAGE printenv
+ is "$output" ".*container=podman" "output matches container=podman"
+ run grep TERM <<<$output
+ is "$output" "" "unwanted TERM environment variable despite --unsetenv=TERM"
+
+ run_podman run --unsetenv-all --rm $IMAGE /bin/printenv
+ run grep TERM <<<$output
+ is "$output" "" "unwanted TERM environment variable despite --unsetenv-all"
+ run grep container <<<$output
+ is "$output" "" "unwanted container environment variable despite --unsetenv-all"
+ run grep PATH <<<$output
+ is "$output" "" "unwanted PATH environment variable despite --unsetenv-all"
+
+ run_podman run --unsetenv-all --env TERM=abc --rm $IMAGE /bin/printenv
+ is "$output" ".*TERM=abc" "missing TERM environment variable despite TERM being set on commandline"
+}
+
# vim: filetype=sh