QEMU: allow to hot plugging virtio-serial-pci device
[libvirt.git] / ci / integration-template.yml
blobded57cfaafa2f94f390293cb841828e9c02ba858
1 .qemu-build-template: &qemu-build-template
2   - pushd "$SCRATCH_DIR"
3   - git clone --depth 1 https://gitlab.com/qemu-project/qemu.git
4   - cd qemu
5   #
6   # inspired by upstream QEMU's buildtest-template.yml
7   - export JOBS="$(expr $(nproc) + 1)"
8   - mkdir build
9   - cd build
10   - ../configure --prefix=/usr
11                  --enable-werror
12                  --disable-tcg
13                  --disable-docs
14                  --target-list=x86_64-softmmu || (cat config.log meson-logs/meson-log.txt && exit 1)
15   - make -j"$JOBS"
16   - if test -n "$MAKE_CHECK_ARGS";
17     then
18       make -j"$JOBS" check-build;
19     fi
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
23   # other user
24   - sudo git config --global --add safe.directory "$SCRATCH_DIR/qemu"
25   - sudo make install
26   - sudo restorecon -R /usr
27   - popd
30 .collect-logs: &collect-logs
31   - set +e
32   - shopt -s nullglob
33   - mkdir 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}/*;
39     do
40       sudo mv "$(realpath $test_log)" logs/avocado;
41     done;
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}' \;
48 .integration_tests:
49   stage: integration_tests
50   rules:
51     - if: '$LIBVIRT_CI_INTEGRATION == null'
52       when: never
53     - !reference [.gitlab_native_build_job, rules]
54   before_script:
55     - mkdir "$SCRATCH_DIR"
56     - sudo dnf install -y libvirt-rpms/* libvirt-perl-rpms/* libvirt-python-rpms/*
57   script:
58     - source ci/jobs.sh
59     - run_integration
60   after_script:
61     - test "$CI_JOB_STATUS" = "success" && exit 0;
62     - *collect-logs
63   variables:
64     SCRATCH_DIR: "/tmp/scratch"
65   artifacts:
66     name: logs
67     expire_in: 1 day
68     paths:
69       - logs
70     when: on_failure
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:
77   extends:
78     - .integration_tests
79   before_script:
80     - !reference [.integration_tests, before_script]
81     - *qemu-build-template