1 .qemu-build-template: &qemu-build-template
3 - git clone --depth 1 https://gitlab.com/qemu-project/qemu.git
6 # inspired by upstream QEMU's buildtest-template.yml
7 - export JOBS="$(expr $(nproc) + 1)"
10 - ../configure --prefix=/usr
14 --target-list=x86_64-softmmu || (cat config.log meson-logs/meson-log.txt && exit 1)
16 - if test -n "$MAKE_CHECK_ARGS";
18 make -j"$JOBS" check-build;
21 # we need the following since the fix for CVE-2022-24765 now causes a fatal
22 # error if a user issues a git command from within a directory owned by some
24 - sudo git config --global --add safe.directory "$SCRATCH_DIR/qemu"
26 - sudo restorecon -R /usr
30 .collect-logs: &collect-logs
34 - test -d "$SCRATCH_DIR"/avocado && mkdir logs/avocado
35 - sudo coredumpctl &>/dev/null && sudo coredumpctl info --no-pager > logs/coredumpctl.txt
36 - sudo mv /var/log/libvirt logs/libvirt
37 # filter only the failed tests, omitting successful job logs
38 - for test_log in "$SCRATCH_DIR"/avocado/latest/test-results/by-status/{ERROR,FAIL}/*;
40 sudo mv "$(realpath $test_log)" logs/avocado;
42 - sudo chown -R $(whoami):$(whoami) logs
43 # rename all Avocado stderr/stdout logs to *.log so that GitLab's web UI doesn't mangle the MIME type
44 - find logs/avocado/ -type f ! -name "*.log" -exec
45 sh -c 'DIR=$(dirname {}); NAME=$(basename {}); mv $DIR/$NAME{,.log}' \;
49 stage: integration_tests
51 - if: '$LIBVIRT_CI_INTEGRATION == null'
53 - !reference [.gitlab_native_build_job, rules]
55 - mkdir "$SCRATCH_DIR"
56 - sudo dnf install -y libvirt-rpms/* libvirt-perl-rpms/* libvirt-python-rpms/*
61 - test "$CI_JOB_STATUS" = "success" && exit 0;
64 SCRATCH_DIR: "/tmp/scratch"
73 # YAML anchors don't work with Shell conditions so we can't use a variable
74 # to conditionally build+install QEMU from source.
75 # Instead, create a new test job template for this scenario.
76 .integration_tests_upstream_qemu:
80 - !reference [.integration_tests, before_script]
81 - *qemu-build-template