]> git.proxmox.com Git - mirror_qemu.git/commit
iotests: connect stdin to /dev/null when running tests
authorDaniel P. Berrangé <berrange@redhat.com>
Wed, 15 Mar 2023 17:43:21 +0000 (17:43 +0000)
committerAlex Bennée <alex.bennee@linaro.org>
Wed, 22 Mar 2023 15:08:26 +0000 (15:08 +0000)
commitcb845eaa88eb266c5023af06989e94d95c712871
tree27f4291a80912df0d5fb6779b812cb54a4bc7cdb
parent6e5792a1f6ecc155fc977e3813e75fc8ede478ab
iotests: connect stdin to /dev/null when running tests

Currently the tests have their stdin inherited from the test harness,
meaning they are connected to a TTY. The QEMU processes spawned by
certain tests, however, modify TTY settings and if the test exits
abnormally the settings might not be restored.

The python test harness thus has some logic which will capture the
initial TTY settings and restore them once all tests are finished.

This does not, however, take into account the possibility of many
copies of the 'check' program running in parallel. With parallel
execution, a later invokation may save the TTY state that QEMU has
already modified, and thus restore bad state leaving the TTY
non-functional.

None of the I/O tests shnould actually be interactive requiring
user input and so they should not require a TTY at all. To avoid
this while TTY save/restore complexity we can connect the test
stdin to /dev/null instead.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Acked-by: Hanna Czenczek <hreitz@redhat.com>
Tested-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20230303160727.3977246-6-berrange@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20230315174331.2959-23-alex.bennee@linaro.org>
tests/qemu-iotests/testrunner.py