Skip to content

Commit

Permalink
add test for container push on Katello 4.13+
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeni committed Sep 5, 2024
1 parent 1ebf690 commit b3c1a67
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
10 changes: 10 additions & 0 deletions bats/fb-katello-container.bats
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,13 @@ load fixtures/content
CONTAINER_PULL_LABEL=$(echo "${ORGANIZATION_LABEL}-${PRODUCT_LABEL}-${CONTAINER_REPOSITORY_LABEL}"| tr '[:upper:]' '[:lower:]')
podman pull "${HOSTNAME}/${CONTAINER_PULL_LABEL}"
}

@test "push container to katello" {
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:]')
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}"
podman search "${HOSTNAME}/" | grep -q "${CONTAINER_PUSH_LABEL}"
}
7 changes: 7 additions & 0 deletions bats/foreman_helper.bash
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ tSkipIfOlderThan43() {
fi
}

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

tIsPulp2() {
tPackageExists pulp-server
}
Expand Down

0 comments on commit b3c1a67

Please sign in to comment.