Skip to content

Commit

Permalink
Use newer container naming in container BATS (#1881)
Browse files Browse the repository at this point in the history
  • Loading branch information
ianballou authored Nov 25, 2024
1 parent dd0cb40 commit 0409f28
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
12 changes: 10 additions & 2 deletions bats/fb-katello-container.bats
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,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 "${KATELLO_VERSION}" 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}"
}

Expand All @@ -19,7 +23,11 @@ load fixtures/content
tContainerPushSupported
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 "${KATELLO_VERSION}" 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
CONTAINER_PUSH_LABEL=$(echo "${ORGANIZATION_LABEL}/${PRODUCT_LABEL}/${CONTAINER_REPOSITORY_LABEL}-bats-$(date -u '+%s')"| tr '[:upper:]' '[:lower:]')
podman push "${HOSTNAME}/${CONTAINER_PULL_LABEL}" "${HOSTNAME}/${CONTAINER_PUSH_LABEL}"
# Sleep for 5 seconds due to an intermittent issue where pushed content
Expand Down
4 changes: 2 additions & 2 deletions bats/foreman_helper.bash
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ tSkipIfOlderThan43() {

tContainerPushSupported() {
KATELLO_VERSION=$(tKatelloVersion)
if ! tIsVersionNewer "${KATELLO_VERSION}" 4.15; then
skip "Container push is only supported on Katello 4.15+"
if ! tIsVersionNewer "${KATELLO_VERSION}" 4.14; then
skip "Container push is only supported on Katello 4.14+"
fi
}

Expand Down

0 comments on commit 0409f28

Please sign in to comment.