From 31bc1c80abb30a6d1a4f5890b74cffbe30222d07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Wed, 9 Feb 2022 10:47:50 +0100 Subject: [PATCH] tests/kvm: Forward the test environment variables to the VM This will help with finding the right libdefault.so and correctly setup the GLib test framework. Part-of: --- src/tests/kvm/meson.build | 8 ++++++++ src/tests/kvm/virtme-run.sh | 2 ++ 2 files changed, 10 insertions(+) diff --git a/src/tests/kvm/meson.build b/src/tests/kvm/meson.build index ec5f6a084..bdd74ff54 100644 --- a/src/tests/kvm/meson.build +++ b/src/tests/kvm/meson.build @@ -27,6 +27,12 @@ endif virtme_run = find_program('virtme-run.sh') +vm_env_entries = [] +foreach name, value: test_env_variables + vm_env_entries += ['@0@=@1@'.format(name, value)] +endforeach +vm_env = ' '.join(vm_env_entries) + foreach test_case: privileged_tests test('kvm-' + test_case['name'], virtme_run, suite: ['core', 'mutter/kvm', 'mutter/kvm/' + test_case['suite']], @@ -34,12 +40,14 @@ foreach test_case: privileged_tests kernel_image_target, ], workdir: mutter_srcdir, + env: test_env, args: [ kernel_image_path, meta_dbus_runner.full_path(), '--kvm', test_case['executable'].full_path(), meson.current_build_dir(), + vm_env, ] ) endforeach diff --git a/src/tests/kvm/virtme-run.sh b/src/tests/kvm/virtme-run.sh index eb62a6798..ec05f913c 100755 --- a/src/tests/kvm/virtme-run.sh +++ b/src/tests/kvm/virtme-run.sh @@ -8,6 +8,7 @@ WRAPPER="$2" WRAPPER_ARGS="$3" TEST_EXECUTABLE="$4" TEST_BUILD_DIR="$5" +VM_ENV="$6" TEST_RESULT_FILE=$(mktemp -p "$TEST_BUILD_DIR" -t test-result-XXXXXX) echo 1 > "$TEST_RESULT_FILE" @@ -16,6 +17,7 @@ VIRTME_ENV="\ HOME=$HOME \ LD_LIBRARY_PATH=$LD_LIBRARY_PATH \ XDG_DATA_DIRS=$XDG_DATA_DIRS \ +$VM_ENV \ " virtme-run \