From 00949d0bd8a08dcb4d619bebddd1dc3ef3b62e73 Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Thu, 18 Mar 2021 06:33:25 -0400 Subject: Check if stdin is a term in --interactive --tty mode If you are attempting to run a container in interactive mode, and want a --tty, then there must be a terminal in use. Docker exits right away when a user specifies to use a --interactive and --TTY but the stdin is not a tty. Currently podman will pull the image and then fail much later. Podman will continue to run but will print an warning message. Discussion in : https://github.com/containers/podman/issues/8916 Signed-off-by: Daniel J Walsh --- test/system/030-run.bats | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test/system') diff --git a/test/system/030-run.bats b/test/system/030-run.bats index b2999a9e7..39ade22af 100644 --- a/test/system/030-run.bats +++ b/test/system/030-run.bats @@ -668,4 +668,15 @@ json-file | f is "$output" ".*HOME=/.*" } +@test "podman run --tty -i failure with no tty" { + run_podman run --tty -i --rm $IMAGE echo hello < /dev/null + is "$output" ".*The input device is not a TTY.*" + + run_podman run --tty=false -i --rm $IMAGE echo hello < /dev/null + is "$output" "hello" + + run_podman run --tty -i=false --rm $IMAGE echo hello < /dev/null + is "$output" "hello" +} + # vim: filetype=sh -- cgit v1.2.3-54-g00ecf