tests/virtme-run: Create fake stdin

When running in CI, the stdin may be /dev/null, which causes issues
for qemu. Avoid this issue by creating our own fake stdin.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2152>
This commit is contained in:
Bartłomiej Piotrowski 2022-02-09 10:50:43 +01:00 committed by Marge Bot
parent 31bc1c80ab
commit 4ce233b89e

View File

@ -20,6 +20,12 @@ XDG_DATA_DIRS=$XDG_DATA_DIRS \
$VM_ENV \
"
if [[ "$(stat -c '%t:%T' -L /proc/$$/fd/0)" == "0:0" ]]; then
mkfifo $XDG_RUNTIME_DIR/fake-stdin.$$
exec 0<> $XDG_RUNTIME_DIR/fake-stdin.$$
rm -f $XDG_RUNTIME_DIR/fake-stdin.$$
fi
virtme-run \
--memory=256M \
--rw \