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

Backport #604 to 3.22 #611

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES/603.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ensure we are using the correct version of pulp-cli tests
37 changes: 26 additions & 11 deletions images/s6_assets/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ mkdir -p settings pulp_storage pgsql containers
echo "CONTENT_ORIGIN='$scheme://localhost:8080'" >> settings/settings.py
echo "ALLOWED_EXPORT_PATHS = ['/tmp']" >> settings/settings.py
echo "ORPHAN_PROTECTION_TIME = 0" >> settings/settings.py
# pulp_rpm < 3.25 requires sha1 in allowed checksums
echo "ALLOWED_CONTENT_CHECKSUMS = ['sha1', 'sha256', 'sha512']" >> settings/settings.py

if [ "$old_image" != "" ]; then
start_container_and_wait $old_image
Expand All @@ -66,15 +68,28 @@ start_container_and_wait $image
if [[ ${image} != *"galaxy"* ]];then
curl --insecure --fail $scheme://localhost:8080/assets/rest_framework/js/default.js
grep "127.0.0.1 pulp" /etc/hosts || echo "127.0.0.1 pulp" | sudo tee -a /etc/hosts

echo "Installing Pulp-CLI"
pip install pulp-cli

# Retreive installed pulp-cli version
PULP_CLI_VERSION=$(python3 -c \
'import importlib.metadata; \
from packaging.version import Version; \
print(Version(importlib.metadata.version("pulp-cli")))')

# Checkout git repo for pulp-cli at correct version to fetch tests
if [ -d pulp-cli ]; then
cd pulp-cli
git fetch origin
git reset --hard origin/main
git fetch --tags origin
git reset --hard $PULP_CLI_VERSION
else
git clone --depth=1 https://github.com/pulp/pulp-cli.git
git clone --depth=1 https://github.com/pulp/pulp-cli.git -b "${PULP_CLI_VERSION}"
cd pulp-cli
fi

pip install -r test_requirements.txt || pip install --no-build-isolation -r test_requirements.txt

if [ -e tests/cli.toml ]; then
mv tests/cli.toml "tests/cli.toml.bak.$(date -R)"
fi
Expand All @@ -88,21 +103,21 @@ if [[ ${image} != *"galaxy"* ]];then
fi
echo "Setup the signing services"
# Setup key on the Pulp container
curl -L https://github.com/pulp/pulp-fixtures/raw/master/common/GPG-KEY-pulp-qe |podman exec -i pulp su pulp -c "cat > /tmp/GPG-KEY-pulp-qe"
curl -L https://github.com/pulp/pulp-fixtures/raw/master/common/GPG-PRIVATE-KEY-pulp-qe |podman exec -i pulp su pulp -c "gpg --import"
echo "6EDF301256480B9B801EBA3D05A5E6DA269D9D98:6:" |podman exec -i pulp gpg --import-ownertrust
curl -L https://github.com/pulp/pulp-fixtures/raw/master/common/GPG-KEY-fixture-signing |podman exec -i pulp su pulp -c "cat > /tmp/GPG-KEY-fixture-signing"
curl -L https://github.com/pulp/pulp-fixtures/raw/master/common/GPG-PRIVATE-KEY-fixture-signing |podman exec -i pulp su pulp -c "gpg --import"
echo "0C1A894EBB86AFAE218424CADDEF3019C2D4A8CF:6:" |podman exec -i pulp gpg --import-ownertrust
# Setup key on the test machine
curl -L https://github.com/pulp/pulp-fixtures/raw/master/common/GPG-KEY-pulp-qe | cat > /tmp/GPG-KEY-pulp-qe
curl -L https://github.com/pulp/pulp-fixtures/raw/master/common/GPG-PRIVATE-KEY-pulp-qe | gpg --import
echo "6EDF301256480B9B801EBA3D05A5E6DA269D9D98:6:" | gpg --import-ownertrust
curl -L https://github.com/pulp/pulp-fixtures/raw/master/common/GPG-KEY-fixture-signing | cat > /tmp/GPG-KEY-pulp-qe
curl -L https://github.com/pulp/pulp-fixtures/raw/master/common/GPG-PRIVATE-KEY-fixture-signing | gpg --import
echo "0C1A894EBB86AFAE218424CADDEF3019C2D4A8CF:6:" | gpg --import-ownertrust
echo "Setup ansible signing service"
podman exec -u pulp -i pulp bash -c "cat > /var/lib/pulp/scripts/sign_detached.sh" < "${PWD}/tests/assets/sign_detached.sh"
podman exec -u pulp pulp chmod a+rx /var/lib/pulp/scripts/sign_detached.sh
podman exec -u pulp pulp bash -c "pulpcore-manager add-signing-service --class core:AsciiArmoredDetachedSigningService sign_ansible /var/lib/pulp/scripts/sign_detached.sh 'Pulp QE'"
podman exec -u pulp pulp bash -c "pulpcore-manager add-signing-service --class core:AsciiArmoredDetachedSigningService sign_ansible /var/lib/pulp/scripts/sign_detached.sh 'pulp-fixture-signing-key'"
echo "Setup deb release signing service"
podman exec -u pulp -i pulp bash -c "cat > /var/lib/pulp/scripts/sign_deb_release.sh" < "${PWD}/tests/assets/sign_deb_release.sh"
podman exec -u pulp pulp chmod a+rx /var/lib/pulp/scripts/sign_deb_release.sh
podman exec -u pulp pulp bash -c "pulpcore-manager add-signing-service --class deb:AptReleaseSigningService sign_deb_release /var/lib/pulp/scripts/sign_deb_release.sh 'Pulp QE'"
podman exec -u pulp pulp bash -c "pulpcore-manager add-signing-service --class deb:AptReleaseSigningService sign_deb_release /var/lib/pulp/scripts/sign_deb_release.sh 'pulp-fixture-signing-key'"
make test
else
curl --insecure --fail $scheme://localhost:8080/static/galaxy_ng/index.html
Expand Down