Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add test for container push on Katello 4.14+ #1862

Merged
merged 2 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.15; then
skip "Container push is only supported on Katello 4.15+"
fi
}

tIsPulp2() {
tPackageExists pulp-server
}
Expand Down