From 504e0386cca3dc8fd801e13802c39bddb44146e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Mon, 29 May 2023 20:31:27 +0200 Subject: [PATCH] ci: Do not run create runtime dir on script setup We do this per each test now. As per this we need to ensure that one exists when running the virtme tests Part-of: --- .gitlab-ci.yml | 3 --- src/tests/kvm/virtme-run.sh | 10 ++++++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f82f34900..4b7e92ee9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -470,7 +470,6 @@ build-wayland-only@x86_64: .test-setup: variables: - XDG_RUNTIME_DIR: "$CI_PROJECT_DIR/runtime-dir" GSETTINGS_SCHEMA_DIR: "$CI_PROJECT_DIR/build/data" MUTTER_DEBUG_DUMMY_MODE_SPECS: "800x600@10.0" PIPEWIRE_DEBUG: 2 @@ -482,8 +481,6 @@ build-wayland-only@x86_64: GTK_A11Y: "none" before_script: - !reference [.mutter.git-clone, before_script] - # Disable e.g. audio support to not dead lock screen cast tests - - mkdir -m 700 $XDG_RUNTIME_DIR .test-mutter-base: extends: diff --git a/src/tests/kvm/virtme-run.sh b/src/tests/kvm/virtme-run.sh index 3ec8099e2..e509d3443 100755 --- a/src/tests/kvm/virtme-run.sh +++ b/src/tests/kvm/virtme-run.sh @@ -20,6 +20,9 @@ MUTTER_DEBUG=$MUTTER_DEBUG \ $VM_ENV \ " +cleanup_paths="" +trap '{ rm -rf $cleanup_paths; }' EXIT + if [ ! -v $MUTTER_DEBUG_FORCE_KMS_MODE ]; then VIRTME_ENV="$VIRTME_ENV MUTTER_DEBUG_FORCE_KMS_MODE=$MUTTER_DEBUG_FORCE_KMS_MODE" fi @@ -27,6 +30,13 @@ if [ ! -v $MUTTER_DEBUG_KMS_THREAD_TYPE ]; then VIRTME_ENV="$VIRTME_ENV MUTTER_DEBUG_KMS_THREAD_TYPE=$MUTTER_DEBUG_KMS_THREAD_TYPE" fi +if [ ! -v "$XDG_RUNTIME_DIR" ]; then + tmpdir=$(mktemp -d --tmpdir mutter-runtime-XXXXXX) + chmod 700 "$tmpdir" + cleanup_paths="$cleanup_paths $tmpdir" + export XDG_RUNTIME_DIR="$tmpdir" +fi + 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.$$