#44 run-tests-yml: check built packages are used in the test system
Opened a year ago by fbo. Modified a year ago
fbo/fedora-zuul-jobs checkinstalled  into  master

@@ -0,0 +1,30 @@ 

+ #!/bin/bash

+ 

+ # https://pagure.io/fedora-zuul-jobs/issue/40

+ 

+ # PSEUDO CODE

+ #for rpm in scratchbuild:

+ #    if rpm.arch == 'src':

+ #        continue

+ #    if package_is_installed(rpm.name):

+ #        if not exactly_this_built_is_installed(rpm):

+ #            try:

+ #                reinstall_exactly_this_rpm(rpm)

+ #            except ReinstallationFailed:

+ #                die_horribly()

+ 

+ for package in $(repoquery -q --disablerepo=* --enablerepo=zuul-built --all --qf='%{name}' | egrep -v '.src$'); do

Maybe replace --disablerepo=* --enablerepo=zuul-built with --repo=zuul-built? Also, the dot in .src$ should probably be escaped.

+     echo ""

+     echo "=== package $package ==="

+     if rpm -q $package; then

+         echo "== is built $package version installed =="

+         if ! rpm -q $(repoquery -q --disablerepo=* --enablerepo=zuul-built --all --qf='%{name}-%{version}' $package); then

+             if ! dnf --disablerepo=* --enablerepo=zuul-built update -y $package; then

+                 echo "ERROR: Unable to update $package to the built version"

+                 exit 1

+             fi

+         fi

+     else

+         continue

+     fi

+ done

@@ -7,7 +7,10 @@ 

  

  - name: Install Ansible

    yum:

-     name: ansible

+     name:

+       - ansible

+       - dnf-utils

+       - findutils

      state: latest

      use_backend: "dnf"

    become: yes
@@ -30,7 +33,24 @@ 

    become: yes

    shell: >

      dnf list --installed >

-     {{ ansible_user_dir }}/{{ zuul.project.src_dir }}/tests/artifacts/installed-packages.list

+     tests/artifacts/installed-packages.list

+   args:

+     chdir: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}"

+ 

+ - name: List tested package rpm install status

+   become: yes

+   shell: >

+     repoquery --disablerepo=*

+     --enablerepo=zuul-built

+     --all | egrep -v '.src$' | xargs rpm -q | tee -a

+     tests/artifacts/tested-installed-packages.list

+   args:

+     chdir: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}"

+ 

+ - name: Run check-installed script

+   become: true

+   script:

+      cmd: files/check-installed.sh

  

  - name: Check a STI results.yml file exists in the artifacts

    stat:

Depends-on: https://pagure.io/zuul-distro-jobs/pull-request/51

  • Display installation status for built packages
  • If one of the package part of the built packages is
    installed to an old version on the test system then
    try to update it and fails if it does not pass (check-installed.sh)

Build succeeded.

rebased onto 39c62dd5e8ff62f91005b0cb3995b6aa21a35bda

a year ago

rebased onto 02e22f9b3c6fe1a79db585157c8ed3e1e3e59e6a

a year ago

Build succeeded.

rebased onto 2232ce9

a year ago

Build succeeded.

Build succeeded.

Maybe replace --disablerepo=* --enablerepo=zuul-built with --repo=zuul-built? Also, the dot in .src$ should probably be escaped.

This should work for PRs that bump version/release. However I am worried that if the evr wasn't bumped, this doesn't get the job done.

What if:

  • the /etc/yum.repos.d/zuul-build.repo has cost=1
  • we call reinstall if the installed package is signed?