tests/kvm: Pass test executable last

This is in preparation to pass an arbitrary command with arguments.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2561>
This commit is contained in:
Jonas Ådahl 2022-08-04 12:47:14 +02:00
parent d70b0c78e0
commit 2df9ccd598
3 changed files with 7 additions and 7 deletions

View File

@ -45,9 +45,9 @@ foreach test_case: privileged_tests
kernel_image_path, kernel_image_path,
meta_dbus_runner.full_path(), meta_dbus_runner.full_path(),
'--kvm', '--kvm',
test_case['executable'].full_path(),
meson.current_build_dir(), meson.current_build_dir(),
vm_env, vm_env,
test_case['executable'].full_path(),
], ],
is_parallel: false, is_parallel: false,
) )

View File

@ -4,8 +4,8 @@ set -e
WRAPPER="$1" WRAPPER="$1"
WRAPPER_ARGS="$2" WRAPPER_ARGS="$2"
TEST_EXECUTABLE="$3" TEST_RESULT="$3"
TEST_RESULT="$4" TEST_EXECUTABLE="$4"
export XDG_RUNTIME_DIR="/tmp/sub-runtime-dir-$UID" export XDG_RUNTIME_DIR="/tmp/sub-runtime-dir-$UID"
export GSETTINGS_SCHEMA_DIR="$PWD/build/data" export GSETTINGS_SCHEMA_DIR="$PWD/build/data"

View File

@ -6,9 +6,9 @@ DIRNAME="$(dirname "$0")"
IMAGE="$1" IMAGE="$1"
WRAPPER="$2" WRAPPER="$2"
WRAPPER_ARGS="$3" WRAPPER_ARGS="$3"
TEST_EXECUTABLE="$4" TEST_BUILD_DIR="$4"
TEST_BUILD_DIR="$5" VM_ENV="$5"
VM_ENV="$6" TEST_EXECUTABLE="$6"
TEST_RESULT_FILE=$(mktemp -p "$TEST_BUILD_DIR" -t test-result-XXXXXX) TEST_RESULT_FILE=$(mktemp -p "$TEST_BUILD_DIR" -t test-result-XXXXXX)
echo 1 > "$TEST_RESULT_FILE" echo 1 > "$TEST_RESULT_FILE"
@ -35,7 +35,7 @@ virtme-run \
--rw \ --rw \
--pwd \ --pwd \
--kimg "$IMAGE" \ --kimg "$IMAGE" \
--script-sh "sh -c \"env $VIRTME_ENV $DIRNAME/run-kvm-test.sh \\\"$WRAPPER\\\" \\\"$WRAPPER_ARGS\\\" \\\"$TEST_EXECUTABLE\\\" \\\"$TEST_RESULT_FILE\\\"\"" \ --script-sh "sh -c \"env $VIRTME_ENV $DIRNAME/run-kvm-test.sh \\\"$WRAPPER\\\" \\\"$WRAPPER_ARGS\\\" \\\"$TEST_RESULT_FILE\\\" \\\"$TEST_EXECUTABLE\\\"\"" \
--qemu-opts -cpu host,pdcm=off -smp 2 --qemu-opts -cpu host,pdcm=off -smp 2
TEST_RESULT="$(cat "$TEST_RESULT_FILE")" TEST_RESULT="$(cat "$TEST_RESULT_FILE")"