[PATCH 0/2] ci: Fix upstream QEMU integration job

Or at least, hopefully it does! This is completely untested, as validating changes to the integration tests is difficult/annoying. The job's currently broken anyway, so it's not like these changes could possibly make things worse :) Andrea Bolognani (2): ci: Fix .integration_tests_upstream_qemu ci: Do more as part of .qemu-build-template ci/integration-template.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- 2.43.0

We enter $SCRATCH_DIR before going through the process of cloning QEMU's upstream repo and building it, but once we're done we don't get back to libvirt's sources, so the very next step fails with /tmp/script.: line 188: ci/jobs.sh: No such file or directory Use pushd/popd to ensure that we're back to the correct place once QEMU has been built and installed. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- ci/integration-template.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ci/integration-template.yml b/ci/integration-template.yml index 544264c3d5..1ccf64f4c1 100644 --- a/ci/integration-template.yml +++ b/ci/integration-template.yml @@ -83,9 +83,10 @@ .integration_tests_upstream_qemu: before_script: - !reference [.integration_tests, before_script] - - cd "$SCRATCH_DIR" + - pushd "$SCRATCH_DIR" - *qemu-build-template - sudo restorecon -R /usr + - popd .integration_tests_upstream_qemu_prebuilt_env: extends: -- 2.43.0

Entering $SCRATCH_DIR, going back to the original directory and setting SELinux labels for the newly-installed QEMU binaries are all steps that logically belong to this template rather than its callers. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- ci/integration-template.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ci/integration-template.yml b/ci/integration-template.yml index 1ccf64f4c1..166445527c 100644 --- a/ci/integration-template.yml +++ b/ci/integration-template.yml @@ -1,4 +1,5 @@ .qemu-build-template: &qemu-build-template + - pushd "$SCRATCH_DIR" - git clone --depth 1 https://gitlab.com/qemu-project/qemu.git - cd qemu # @@ -22,6 +23,8 @@ # other user - sudo git config --global --add safe.directory "$SCRATCH_DIR/qemu" - sudo make install + - sudo restorecon -R /usr + - popd .collect-logs: &collect-logs @@ -83,10 +86,7 @@ .integration_tests_upstream_qemu: before_script: - !reference [.integration_tests, before_script] - - pushd "$SCRATCH_DIR" - *qemu-build-template - - sudo restorecon -R /usr - - popd .integration_tests_upstream_qemu_prebuilt_env: extends: -- 2.43.0

On 1/12/24 11:11, Andrea Bolognani wrote:
Or at least, hopefully it does!
This is completely untested, as validating changes to the integration tests is difficult/annoying. The job's currently broken anyway, so it's not like these changes could possibly make things worse :)
Andrea Bolognani (2): ci: Fix .integration_tests_upstream_qemu ci: Do more as part of .qemu-build-template
ci/integration-template.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Michal
participants (2)
-
Andrea Bolognani
-
Michal Prívozník