test: new weldr client compatibility for test scripts

- Handle the array responses from the new weldr-client (>= 35.6).
- Move the `get_build_info` function to shared_libs.sh to source and
  reuse in multiple places.
This commit is contained in:
Achilleas Koutsou 2022-08-30 15:59:01 +02:00 committed by Tom Gundersen
parent 8e24f5720d
commit 3b14828669
25 changed files with 57 additions and 247 deletions

View file

@ -4,6 +4,8 @@ set -euo pipefail
# Provision the software under test.
/usr/libexec/osbuild-composer-test/provision.sh none
source /usr/libexec/tests/osbuild-composer/shared_lib.sh
# Get OS data.
source /etc/os-release
ARCH=$(uname -m)
@ -13,15 +15,6 @@ function greenprint {
echo -e "\033[1;32m[$(date -Isecond)] ${1}\033[0m"
}
function get_build_info() {
key="$1"
fname="$2"
if rpm -q --quiet weldr-client; then
key=".[0].body${key}"
fi
jq -r "${key}" "${fname}"
}
# Start libvirtd and test it.
greenprint "🚀 Starting libvirt daemon"
sudo systemctl start libvirtd