diff --git a/test/cases/ostree.sh b/test/cases/ostree.sh index 6e9748c47..14527c028 100755 --- a/test/cases/ostree.sh +++ b/test/cases/ostree.sh @@ -53,6 +53,15 @@ function greenprint { echo -e "\033[1;32m${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 @@ -170,13 +179,13 @@ build_image() { else sudo composer-cli --json compose start "$blueprint_name" $IMAGE_TYPE | tee "$COMPOSE_START" fi - COMPOSE_ID=$(jq -r '.build_id' "$COMPOSE_START") + 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 - COMPOSE_STATUS=$(jq -r '.queue_status' "$COMPOSE_INFO") + COMPOSE_STATUS=$(get_build_info ".queue_status" "$COMPOSE_INFO") # Is the compose finished? if [[ $COMPOSE_STATUS != RUNNING ]] && [[ $COMPOSE_STATUS != WAITING ]]; then