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:
parent
8e24f5720d
commit
3b14828669
25 changed files with 57 additions and 247 deletions
|
|
@ -10,21 +10,13 @@
|
|||
set -euo pipefail
|
||||
|
||||
source /usr/libexec/osbuild-composer-test/set-env-variables.sh
|
||||
source /usr/libexec/tests/osbuild-composer/shared_lib.sh
|
||||
|
||||
# Colorful output.
|
||||
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=".body${key}"
|
||||
fi
|
||||
jq -r "${key}" "${fname}"
|
||||
}
|
||||
|
||||
# Container image used for cloud provider CLI tools
|
||||
CONTAINER_IMAGE_CLOUD_TOOLS="quay.io/osbuild/cloud-tools:latest"
|
||||
|
||||
|
|
@ -111,14 +103,6 @@ get_compose_metadata () {
|
|||
sudo cat "${COMPOSE_ID}".json | jq -M '.' | tee "$METADATA_FILE" > /dev/null
|
||||
}
|
||||
|
||||
is_weldr_client_installed () {
|
||||
if rpm --quiet -q weldr-client; then
|
||||
echo true
|
||||
else
|
||||
echo false
|
||||
fi
|
||||
}
|
||||
|
||||
# Write an AWS TOML file
|
||||
tee "$AWS_CONFIG" > /dev/null << EOF
|
||||
provider = "aws"
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@ shopt -s expand_aliases
|
|||
set -euo pipefail
|
||||
|
||||
source /usr/libexec/osbuild-composer-test/set-env-variables.sh
|
||||
source /usr/libexec/tests/osbuild-composer/shared_lib.sh
|
||||
|
||||
BRANCH_NAME="${CI_COMMIT_BRANCH:-local}"
|
||||
BUILD_ID="${CI_BUILD_ID:-$(uuidgen)}"
|
||||
HYPER_V_GEN="${HYPER_V_GEN:-V1}"
|
||||
|
|
@ -20,15 +22,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=".body${key}"
|
||||
fi
|
||||
jq -r "${key}" "${fname}"
|
||||
}
|
||||
|
||||
# Container image used for cloud provider CLI tools
|
||||
CONTAINER_IMAGE_CLOUD_TOOLS="quay.io/osbuild/cloud-tools:latest"
|
||||
|
||||
|
|
@ -138,14 +131,6 @@ get_compose_metadata () {
|
|||
sudo cat "${COMPOSE_ID}".json | jq -M '.' | tee "$METADATA_FILE" > /dev/null
|
||||
}
|
||||
|
||||
is_weldr_client_installed () {
|
||||
if rpm --quiet -q weldr-client; then
|
||||
echo true
|
||||
else
|
||||
echo false
|
||||
fi
|
||||
}
|
||||
|
||||
# Export Azure credentials if running on Jenkins
|
||||
set +u
|
||||
if [ -n "$AZURE_CREDS" ]
|
||||
|
|
|
|||
|
|
@ -6,16 +6,8 @@ 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=".body${key}"
|
||||
fi
|
||||
jq -r "${key}" "${fname}"
|
||||
}
|
||||
|
||||
source /usr/libexec/osbuild-composer-test/set-env-variables.sh
|
||||
source /usr/libexec/tests/osbuild-composer/shared_lib.sh
|
||||
|
||||
#
|
||||
# Provision the software under test.
|
||||
|
|
|
|||
|
|
@ -6,16 +6,8 @@ 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=".body${key}"
|
||||
fi
|
||||
jq -r "${key}" "${fname}"
|
||||
}
|
||||
|
||||
source /usr/libexec/osbuild-composer-test/set-env-variables.sh
|
||||
source /usr/libexec/tests/osbuild-composer/shared_lib.sh
|
||||
|
||||
#
|
||||
# Provision the software under test.
|
||||
|
|
|
|||
|
|
@ -10,20 +10,13 @@ source /etc/os-release
|
|||
# Provision the software under test.
|
||||
/usr/libexec/osbuild-composer-test/provision.sh none
|
||||
|
||||
source /usr/libexec/tests/osbuild-composer/shared_lib.sh
|
||||
|
||||
# Colorful output.
|
||||
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=".body${key}"
|
||||
fi
|
||||
jq -r "${key}" "${fname}"
|
||||
}
|
||||
|
||||
TEST_UUID=$(uuidgen)
|
||||
IMAGE_KEY="osbuild-composer-test-${TEST_UUID}"
|
||||
|
||||
|
|
@ -60,12 +53,8 @@ build_image() {
|
|||
greenprint "🚀 Starting compose"
|
||||
# this needs "|| true" at the end for the fail case scenario
|
||||
sudo composer-cli --json compose start "$blueprint_name" "$image_type" | tee "$COMPOSE_START" || true
|
||||
if rpm -q --quiet weldr-client; then
|
||||
STATUS=$(jq -r '.body.status' "$COMPOSE_START")
|
||||
else
|
||||
STATUS=$(jq -r '.status' "$COMPOSE_START")
|
||||
fi
|
||||
|
||||
STATUS=$(get_build_info ".status" "$COMPOSE_START")
|
||||
|
||||
if [[ $want_fail == "$STATUS" ]]; then
|
||||
echo "Something went wrong with the compose. 😢"
|
||||
sudo pkill -P ${WORKER_JOURNAL_PID}
|
||||
|
|
@ -74,11 +63,9 @@ build_image() {
|
|||
elif [[ $want_fail == true && $STATUS == false ]]; then
|
||||
sudo pkill -P ${WORKER_JOURNAL_PID}
|
||||
trap - EXIT
|
||||
if rpm -q --quiet weldr-client; then
|
||||
ERROR_MSG=$(jq 'first(.body.errors[] | select(.id == "ManifestCreationFailed")) | .msg' "$COMPOSE_START")
|
||||
else
|
||||
ERROR_MSG=$(jq 'first(.errors[] | select(.id == "ManifestCreationFailed")) | .msg' "$COMPOSE_START")
|
||||
fi
|
||||
# use get_build_info to extract errors before picking the first
|
||||
errors=$(get_build_info ".errors" "$COMPOSE_START")
|
||||
ERROR_MSG=$(jq 'first(.[] | select(.id == "ManifestCreationFailed")) | .msg' <<< "${errors}")
|
||||
return
|
||||
else
|
||||
COMPOSE_ID=$(get_build_info ".build_id" "$COMPOSE_START")
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
#
|
||||
|
||||
source /usr/libexec/osbuild-composer-test/set-env-variables.sh
|
||||
source /usr/libexec/tests/osbuild-composer/shared_lib.sh
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
|
|
@ -16,15 +17,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=".body${key}"
|
||||
fi
|
||||
jq -r "${key}" "${fname}"
|
||||
}
|
||||
|
||||
# Container image used for cloud provider CLI tools
|
||||
CONTAINER_IMAGE_CLOUD_TOOLS="quay.io/osbuild/cloud-tools:latest"
|
||||
|
||||
|
|
@ -206,14 +198,6 @@ get_compose_metadata () {
|
|||
sudo cat "${COMPOSE_ID}".json | jq -M '.' | tee "$METADATA_FILE" > /dev/null
|
||||
}
|
||||
|
||||
is_weldr_client_installed () {
|
||||
if rpm --quiet -q weldr-client; then
|
||||
echo true
|
||||
else
|
||||
echo false
|
||||
fi
|
||||
}
|
||||
|
||||
# Write an GCP TOML file
|
||||
tee "$GCP_CONFIG" > /dev/null << EOF
|
||||
provider = "gcp"
|
||||
|
|
|
|||
|
|
@ -200,21 +200,13 @@ build_image() {
|
|||
# Start the compose.
|
||||
greenprint "🚀 Starting compose"
|
||||
sudo composer-cli --json compose start "$blueprint_name" "$image_type" | tee "$COMPOSE_START"
|
||||
if rpm -q --quiet weldr-client; then
|
||||
COMPOSE_ID=$(jq -r '.body.build_id' "$COMPOSE_START")
|
||||
else
|
||||
COMPOSE_ID=$(jq -r '.build_id' "$COMPOSE_START")
|
||||
fi
|
||||
COMPOSE_ID=$(get_build_info ".build_id" "${COMPOSE_START}")
|
||||
|
||||
# Wait for the compose to finish.
|
||||
greenprint "⏱ Waiting for compose to finish: ${COMPOSE_ID}"
|
||||
while true; do
|
||||
sudo composer-cli --json compose info "${COMPOSE_ID}" | tee "$COMPOSE_INFO" > /dev/null
|
||||
if rpm -q --quiet weldr-client; then
|
||||
COMPOSE_STATUS=$(jq -r '.body.queue_status' "$COMPOSE_INFO")
|
||||
else
|
||||
COMPOSE_STATUS=$(jq -r '.queue_status' "$COMPOSE_INFO")
|
||||
fi
|
||||
COMPOSE_STATUS=$(get_build_info ".queue_status" "${COMPOSE_INFO}")
|
||||
|
||||
# Is the compose finished?
|
||||
if [[ $COMPOSE_STATUS != RUNNING ]] && [[ $COMPOSE_STATUS != WAITING ]]; then
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ OSBUILD_COMPOSER_TEST_DATA=/usr/share/tests/osbuild-composer/
|
|||
# Get OS data.
|
||||
source /etc/os-release
|
||||
|
||||
source /usr/libexec/tests/osbuild-composer/shared_lib.sh
|
||||
|
||||
# Colorful output.
|
||||
function greenprint {
|
||||
echo -e "\033[1;32m[$(date -Isecond)] ${1}\033[0m"
|
||||
|
|
@ -125,15 +127,6 @@ gen_iso () {
|
|||
# scans and check results
|
||||
sudo dnf install -y xmlstarlet openscap-utils scap-security-guide
|
||||
|
||||
get_build_info() {
|
||||
key="$1"
|
||||
fname="$2"
|
||||
if rpm -q --quiet weldr-client; then
|
||||
key=".body${key}"
|
||||
fi
|
||||
jq -r "${key}" "${fname}"
|
||||
}
|
||||
|
||||
# Get the compose log.
|
||||
get_compose_log () {
|
||||
COMPOSE_ID=$1
|
||||
|
|
|
|||
|
|
@ -13,15 +13,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=".body${key}"
|
||||
fi
|
||||
jq -r "${key}" "${fname}"
|
||||
}
|
||||
|
||||
|
||||
# Install openshift client
|
||||
greenprint "🔧 Installing oenshift client(oc)"
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@ set -euo pipefail
|
|||
# Get OS data.
|
||||
source /usr/libexec/osbuild-composer-test/set-env-variables.sh
|
||||
|
||||
source /usr/libexec/tests/osbuild-composer/shared_lib.sh
|
||||
|
||||
# Get compose url if it's running on unsubscried RHEL
|
||||
if [[ ${ID} == "rhel" ]] && ! sudo subscription-manager status; then
|
||||
source /usr/libexec/osbuild-composer-test/define-compose-url.sh
|
||||
|
|
@ -17,15 +19,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=".body${key}"
|
||||
fi
|
||||
jq -r "${key}" "${fname}"
|
||||
}
|
||||
|
||||
# Start libvirtd and test it.
|
||||
greenprint "🚀 Starting libvirt daemon"
|
||||
sudo systemctl start libvirtd
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ set -euo pipefail
|
|||
|
||||
# Get OS data.
|
||||
source /usr/libexec/osbuild-composer-test/set-env-variables.sh
|
||||
source /usr/libexec/tests/osbuild-composer/shared_lib.sh
|
||||
|
||||
# Get compose url if it's running on unsubscried RHEL
|
||||
if [[ ${ID} == "rhel" ]] && ! sudo subscription-manager status; then
|
||||
|
|
@ -17,15 +18,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=".body${key}"
|
||||
fi
|
||||
jq -r "${key}" "${fname}"
|
||||
}
|
||||
|
||||
# Start libvirtd and test it.
|
||||
greenprint "🚀 Starting libvirt daemon"
|
||||
sudo systemctl start libvirtd
|
||||
|
|
|
|||
|
|
@ -13,14 +13,7 @@ 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=".body${key}"
|
||||
fi
|
||||
jq -r "${key}" "${fname}"
|
||||
}
|
||||
source /usr/libexec/tests/osbuild-composer/shared_lib.sh
|
||||
|
||||
# Start firewalld
|
||||
sudo systemctl enable --now firewalld
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ set -euo pipefail
|
|||
|
||||
# Get OS data.
|
||||
source /usr/libexec/osbuild-composer-test/set-env-variables.sh
|
||||
source /usr/libexec/tests/osbuild-composer/shared_lib.sh
|
||||
|
||||
# Get compose url if it's running on unsubscried RHEL
|
||||
if [[ ${ID} == "rhel" ]] && ! sudo subscription-manager status; then
|
||||
|
|
@ -115,15 +116,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=".body${key}"
|
||||
fi
|
||||
jq -r "${key}" "${fname}"
|
||||
}
|
||||
|
||||
# Start libvirtd and test it.
|
||||
greenprint "🚀 Starting libvirt daemon"
|
||||
sudo systemctl start libvirtd
|
||||
|
|
|
|||
|
|
@ -4,16 +4,9 @@
|
|||
# Get OS data.
|
||||
source /usr/libexec/osbuild-composer-test/set-env-variables.sh
|
||||
|
||||
set -xeuo pipefail
|
||||
source /usr/libexec/tests/osbuild-composer/shared_lib.sh
|
||||
|
||||
function get_build_info() {
|
||||
key="$1"
|
||||
fname="$2"
|
||||
if rpm -q --quiet weldr-client; then
|
||||
key=".body${key}"
|
||||
fi
|
||||
jq -r "${key}" "${fname}"
|
||||
}
|
||||
set -xeuo pipefail
|
||||
|
||||
# Provision the software under test.
|
||||
/usr/libexec/osbuild-composer-test/provision.sh none
|
||||
|
|
|
|||
|
|
@ -11,15 +11,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=".body${key}"
|
||||
fi
|
||||
jq -r "${key}" "${fname}"
|
||||
}
|
||||
|
||||
function generate_certificates {
|
||||
# Generate CA root key
|
||||
sudo openssl genrsa -out ca.key
|
||||
|
|
@ -39,6 +30,7 @@ function generate_certificates {
|
|||
}
|
||||
|
||||
source /usr/libexec/osbuild-composer-test/set-env-variables.sh
|
||||
source /usr/libexec/tests/osbuild-composer/shared_lib.sh
|
||||
|
||||
# Provision the software under tet.
|
||||
/usr/libexec/osbuild-composer-test/provision.sh none
|
||||
|
|
|
|||
|
|
@ -12,15 +12,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=".body${key}"
|
||||
fi
|
||||
jq -r "${key}" "${fname}"
|
||||
}
|
||||
|
||||
function generate_certificates {
|
||||
# Generate CA root key
|
||||
sudo openssl genrsa -out ca.key
|
||||
|
|
@ -68,6 +59,7 @@ function cleanup {
|
|||
}
|
||||
|
||||
source /usr/libexec/osbuild-composer-test/set-env-variables.sh
|
||||
source /usr/libexec/tests/osbuild-composer/shared_lib.sh
|
||||
|
||||
# Provision the software under tet.
|
||||
/usr/libexec/osbuild-composer-test/provision.sh none
|
||||
|
|
|
|||
|
|
@ -14,16 +14,9 @@
|
|||
# Get OS data.
|
||||
source /usr/libexec/osbuild-composer-test/set-env-variables.sh
|
||||
|
||||
set -xeuo pipefail
|
||||
source /usr/libexec/tests/osbuild-composer/shared_lib.sh
|
||||
|
||||
function get_build_info() {
|
||||
key="$1"
|
||||
fname="$2"
|
||||
if rpm -q --quiet weldr-client; then
|
||||
key=".body${key}"
|
||||
fi
|
||||
jq -r "${key}" "${fname}"
|
||||
}
|
||||
set -xeuo pipefail
|
||||
|
||||
# Provision the software under test.
|
||||
/usr/libexec/osbuild-composer-test/provision.sh none
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
set -xeuo pipefail
|
||||
|
||||
source /usr/libexec/osbuild-composer-test/set-env-variables.sh
|
||||
source /usr/libexec/tests/osbuild-composer/shared_lib.sh
|
||||
|
||||
# Provision the software under test.
|
||||
/usr/libexec/osbuild-composer-test/provision.sh none
|
||||
|
|
@ -41,21 +42,13 @@ EOF
|
|||
sudo composer-cli blueprints push "$BLUEPRINT_FILE"
|
||||
sudo composer-cli blueprints depsolve nss-devel
|
||||
sudo composer-cli --json compose start nss-devel qcow2 | tee "${COMPOSE_START}"
|
||||
if rpm -q --quiet weldr-client; then
|
||||
COMPOSE_ID=$(jq -r '.body.build_id' "$COMPOSE_START")
|
||||
else
|
||||
COMPOSE_ID=$(jq -r '.build_id' "$COMPOSE_START")
|
||||
fi
|
||||
COMPOSE_ID=$(get_build_info '.build_id' "$COMPOSE_START")
|
||||
|
||||
# Wait for the compose to finish.
|
||||
echo "⏱ Waiting for compose to finish: ${COMPOSE_ID}"
|
||||
while true; do
|
||||
sudo composer-cli --json compose info "${COMPOSE_ID}" | tee "$COMPOSE_INFO" > /dev/null
|
||||
if rpm -q --quiet weldr-client; then
|
||||
COMPOSE_STATUS=$(jq -r '.body.queue_status' "$COMPOSE_INFO")
|
||||
else
|
||||
COMPOSE_STATUS=$(jq -r '.queue_status' "$COMPOSE_INFO")
|
||||
fi
|
||||
COMPOSE_STATUS=$(get_build_info '.queue_status' "$COMPOSE_INFO")
|
||||
|
||||
# Is the compose finished?
|
||||
if [[ $COMPOSE_STATUS != RUNNING ]] && [[ $COMPOSE_STATUS != WAITING ]]; then
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ function greenprint {
|
|||
}
|
||||
|
||||
source /usr/libexec/osbuild-composer-test/set-env-variables.sh
|
||||
source /usr/libexec/tests/osbuild-composer/shared_lib.sh
|
||||
|
||||
# Provision the software under test.
|
||||
/usr/libexec/osbuild-composer-test/provision.sh none
|
||||
|
|
@ -138,21 +139,13 @@ if [[ "${dummysourceurl}" != "${expectedurl}" ]]; then
|
|||
fi
|
||||
|
||||
sudo composer-cli --json compose start dummy qcow2 | tee "${composestart}"
|
||||
if rpm -q --quiet weldr-client; then
|
||||
composeid=$(jq -r '.body.build_id' "$composestart")
|
||||
else
|
||||
composeid=$(jq -r '.build_id' "${composestart}")
|
||||
fi
|
||||
composeid=$(get_build_info '.build_id' "${composestart}")
|
||||
|
||||
# Wait for the compose to finish.
|
||||
echo "⏱ Waiting for compose to finish: ${composeid}"
|
||||
while true; do
|
||||
sudo composer-cli --json compose info "${composeid}" | tee "${composeinfo}" > /dev/null
|
||||
if rpm -q --quiet weldr-client; then
|
||||
composestatus=$(jq -r '.body.queue_status' "${composeinfo}")
|
||||
else
|
||||
composestatus=$(jq -r '.queue_status' "${composeinfo}")
|
||||
fi
|
||||
composestatus=$(get_build_info '.queue_status' "${composeinfo}")
|
||||
|
||||
# Is the compose finished?
|
||||
if [[ ${composestatus} != RUNNING ]] && [[ ${composestatus} != WAITING ]]; then
|
||||
|
|
|
|||
|
|
@ -5,21 +5,13 @@
|
|||
# Get OS data.
|
||||
source /usr/libexec/osbuild-composer-test/set-env-variables.sh
|
||||
|
||||
source /usr/libexec/tests/osbuild-composer/shared_lib.sh
|
||||
|
||||
set -xeuo pipefail
|
||||
|
||||
# Provision the software under test.
|
||||
/usr/libexec/osbuild-composer-test/provision.sh none
|
||||
|
||||
|
||||
function get_build_info() {
|
||||
key="$1"
|
||||
fname="$2"
|
||||
if rpm -q --quiet weldr-client; then
|
||||
key=".body${key}"
|
||||
fi
|
||||
jq -r "${key}" "${fname}"
|
||||
}
|
||||
|
||||
# Provision the software under test.
|
||||
BLUEPRINT_FILE=/tmp/blueprint.toml
|
||||
COMPOSE_START=/tmp/compose-start.json
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ function greenprint {
|
|||
ARTIFACTS="${ARTIFACTS:-/tmp/artifacts}"
|
||||
|
||||
source /usr/libexec/osbuild-composer-test/set-env-variables.sh
|
||||
source /usr/libexec/tests/osbuild-composer/shared_lib.sh
|
||||
|
||||
# Only run this on x86 and rhel8 GA
|
||||
if [ "$ARCH" != "x86_64" ] || [ "$ID" != rhel ] || ! sudo subscription-manager status; then
|
||||
|
|
|
|||
|
|
@ -7,12 +7,12 @@ function nvrGreaterOrEqual {
|
|||
set +e
|
||||
|
||||
rpm_version=$(rpm -q --qf "%{version}" "${rpm_name}")
|
||||
rpmdev-vercmp "${rpm_version}" "${min_version}"
|
||||
rpmdev-vercmp "${rpm_version}" "${min_version}" 1>&2
|
||||
if [ "$?" != "12" ]; then
|
||||
# 0 - rpm_version == min_version
|
||||
# 11 - rpm_version > min_version
|
||||
# 12 - rpm_version < min_version
|
||||
echo "DEBUG: ${rpm_version} >= ${min_version}"
|
||||
echo "DEBUG: ${rpm_version} >= ${min_version}" 1>&2
|
||||
set -e
|
||||
return
|
||||
fi
|
||||
|
|
@ -20,3 +20,16 @@ function nvrGreaterOrEqual {
|
|||
set -e
|
||||
false
|
||||
}
|
||||
|
||||
function get_build_info() {
|
||||
local key="$1"
|
||||
local fname="$2"
|
||||
if rpm -q --quiet weldr-client; then
|
||||
key=".body${key}"
|
||||
if nvrGreaterOrEqual "weldr-client" "35.6"; then
|
||||
key=".[0]${key}"
|
||||
fi
|
||||
fi
|
||||
jq -r "${key}" "${fname}"
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,21 +10,13 @@
|
|||
set -euo pipefail
|
||||
|
||||
source /usr/libexec/osbuild-composer-test/set-env-variables.sh
|
||||
source /usr/libexec/tests/osbuild-composer/shared_lib.sh
|
||||
|
||||
# Colorful output.
|
||||
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=".body${key}"
|
||||
fi
|
||||
jq -r "${key}" "${fname}"
|
||||
}
|
||||
|
||||
# Provision the software under test.
|
||||
/usr/libexec/osbuild-composer-test/provision.sh none
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
set -euxo pipefail
|
||||
|
||||
source /usr/libexec/tests/osbuild-composer/shared_lib.sh
|
||||
|
||||
WORKSPACE=$(mktemp -d)
|
||||
function cleanup() {
|
||||
echo "== Script execution stopped or finished - Cleaning up =="
|
||||
|
|
@ -9,15 +11,6 @@ function cleanup() {
|
|||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
function get_build_info() {
|
||||
key="$1"
|
||||
fname="$2"
|
||||
if rpm -q --quiet weldr-client; then
|
||||
key=".body${key}"
|
||||
fi
|
||||
jq -r "${key}" "${fname}"
|
||||
}
|
||||
|
||||
# Get the compose log.
|
||||
get_compose_log () {
|
||||
COMPOSE_ID=$1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue