#3 Sync CI with RHEL
Merged 5 years ago by gicmo. Opened 5 years ago by gicmo.
rpms/ gicmo/bolt ci_one_script  into  master

file modified
+35 -4
@@ -1,13 +1,44 @@ 

  #!/usr/bin/bash

  set -u

  

- IT="$1"

+ # helper functions

+ vcmp_lt () {

+     # argument $1 is less than $2

+     MV=$(echo "$@" | tr " " "\n" | sort -rV | head -n1)

+     test "$1" != "$MV"

+ }

+ 

+ # main script

+ IT="${1:-source/tests/test-integration}"

+ 

+ # check if we need to install additional packages

+ # which is the case if we are on RHEL 8

+ source /etc/os-release || exit 1

+ 

+ if [[ "$ID" = *"rhel"* ]] && [[ "$VERSION_ID" == *"8"* ]]; then

+     dnf config-manager -y --add-repo umockdev.repo

+     dnf install -y umockdev-devel python3-gobject-base

+     pip3 install python-dbusmock

+ fi

+ 

+ BOLT_VERSION=$(boltctl --version | cut -d " " -f2)

+ 

+ # check if we can even discover the tests

+ "$IT" list-tests > /dev/null || exit 1

+ 

+ # The format of "list-tests" changed with 0.6

+ if vcmp_lt $BOLT_VERSION 0.6; then

+     echo "Old style integration test names"

+     DELIM=" "

+ else

+     DELIM=$'\n'

+ fi

  

  # discover all the tests

- TESTS=()

- while IFS= read -r line; do

+ declare -a TESTS=()

+ while IFS= read -r -d "$DELIM" line; do

      TESTS+=( "${line% *}" )

- done < <( "$1" list-tests )

+ done < <( $IT list-tests )

  

  # execute all the tests, one by one

  RESULT=0

file modified
+1
@@ -6,6 +6,7 @@ 

      - always

    - role: standard-test-basic

      tags:

+     - atomic

      - classic

      required_packages:

      - bolt

Sync back the changes mode for the RHEL CI.

Pull-Request has been merged by gicmo

5 years ago