summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartłomiej Piotrowski <bpiotrowski@gnome.org>2022-02-09 10:50:43 +0100
committerMarge Bot <marge-bot@gnome.org>2022-03-28 16:17:21 +0000
commit4ce233b89ef9986f8c164ae31b88e2b2e0e5e3ba (patch)
tree3482dd5c57de1159a3160c40207e0a8bffba45b8
parent31bc1c80abb30a6d1a4f5890b74cffbe30222d07 (diff)
downloadmutter-4ce233b89ef9986f8c164ae31b88e2b2e0e5e3ba.tar.gz
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>
-rwxr-xr-xsrc/tests/kvm/virtme-run.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/tests/kvm/virtme-run.sh b/src/tests/kvm/virtme-run.sh
index ec05f913c..3b9fda63f 100755
--- a/src/tests/kvm/virtme-run.sh
+++ b/src/tests/kvm/virtme-run.sh
@@ -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 \