From 7eed8042fd7c08c0181a19e50bd9f0a40e1ce5aa Mon Sep 17 00:00:00 2001 From: Ian Ballou Date: Tue, 26 Nov 2024 12:49:08 -0500 Subject: [PATCH] Check for Katello version properly for container tests --- bats/fb-katello-client-global-registration.bats | 6 +++++- bats/fb-katello-container.bats | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/bats/fb-katello-client-global-registration.bats b/bats/fb-katello-client-global-registration.bats index 0c2390fb6..5cd0c1900 100644 --- a/bats/fb-katello-client-global-registration.bats +++ b/bats/fb-katello-client-global-registration.bats @@ -77,7 +77,11 @@ load fixtures/content @test "try fetching container content" { tPackageExists podman || tPackageInstall podman podman login "${HOSTNAME}" -u admin -p changeme - CONTAINER_PULL_LABEL=$(echo "${ORGANIZATION_LABEL}-${PRODUCT_LABEL}-${CONTAINER_REPOSITORY_LABEL}"| tr '[:upper:]' '[:lower:]') + if tIsVersionNewer "$(tKatelloVersion)" 4.16; then + CONTAINER_PULL_LABEL=$(echo "${ORGANIZATION_LABEL}/${PRODUCT_LABEL}/${CONTAINER_REPOSITORY_LABEL}"| tr '[:upper:]' '[:lower:]') + else + CONTAINER_PULL_LABEL=$(echo "${ORGANIZATION_LABEL}-${PRODUCT_LABEL}-${CONTAINER_REPOSITORY_LABEL}"| tr '[:upper:]' '[:lower:]') + fi podman pull "${HOSTNAME}/${CONTAINER_PULL_LABEL}" } diff --git a/bats/fb-katello-container.bats b/bats/fb-katello-container.bats index 5ffee4d78..2727b1c2d 100644 --- a/bats/fb-katello-container.bats +++ b/bats/fb-katello-container.bats @@ -10,7 +10,7 @@ load fixtures/content @test "try fetching container content" { tPackageExists podman || tPackageInstall podman podman login "${HOSTNAME}" -u admin -p changeme - if tIsVersionNewer "${KATELLO_VERSION}" 4.16; then + if tIsVersionNewer "$(tKatelloVersion)" 4.16; then CONTAINER_PULL_LABEL=$(echo "${ORGANIZATION_LABEL}/${PRODUCT_LABEL}/${CONTAINER_REPOSITORY_LABEL}"| tr '[:upper:]' '[:lower:]') else CONTAINER_PULL_LABEL=$(echo "${ORGANIZATION_LABEL}-${PRODUCT_LABEL}-${CONTAINER_REPOSITORY_LABEL}"| tr '[:upper:]' '[:lower:]') @@ -23,7 +23,7 @@ load fixtures/content tContainerPushSupported tPackageExists podman || tPackageInstall podman podman login "${HOSTNAME}" -u admin -p changeme - if tIsVersionNewer "${KATELLO_VERSION}" 4.16; then + if tIsVersionNewer "$(tKatelloVersion)" 4.16; then CONTAINER_PULL_LABEL=$(echo "${ORGANIZATION_LABEL}/${PRODUCT_LABEL}/${CONTAINER_REPOSITORY_LABEL}"| tr '[:upper:]' '[:lower:]') else CONTAINER_PULL_LABEL=$(echo "${ORGANIZATION_LABEL}-${PRODUCT_LABEL}-${CONTAINER_REPOSITORY_LABEL}"| tr '[:upper:]' '[:lower:]')