avocado.core.runner: Disable stdin for tests
We already disable stdin by setting sys.stdin for tests, but there is
still way to access it via `os.read(0, ...)`. This patch replaces the
`0` (STDIN) file descriptor with the `/dev/null` file descriptor.
Simple check is:
avocado run /bin/read
which hangs until data are provided and fails with this patch.
Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
Showing
想要评论请 注册 或 登录