system-config/testinfra
Cédric Jeanneret e7e5504a9e Correct (again) how ansible-galaxy proxy is configured
The mix of <Location> and ProxyPass [path] <target> lead to some issue.
This patch corrects them and makes the config more consistent.

Until now, the last URI was actually an error page from the main galaxy
website. With this change, we now hit the S3 bucket as we should,
allowing ansible-galaxy to download the archive, validate its checksum,
and install the intended collection/role.

This patch was fully tested locally using the httpd container image, a
minimal configuration adding only the needed modules and the
ansible-galaxy vhost/proxy, and running ansible-galaxy directly.

In addition, this patch also makes a better testing of the proxy, using
cURL until we actually download the file.
Since ansible galaxy will provide a file under any condition, we also
assert the downloaded file is really what it should be - a plain
archive. If it's a miss on S3 side, it would be a JSON. And if we get an
ansible galaxy answer, that would be an HTML file.

The following commands were used:
Run the container:
podman run --rm --security-opt label=disable \
        -v ./httpd.conf:/usr/local/apache2/conf/httpd.conf:ro \
        -p 8080:8080 httpd:2.4

Run ansible-galaxy while ensuring we don't rely on its own internal
cache:
rm -rf operator ~/.ansible/galaxy_cache/api.json
ansible-galaxy collection download -vvvvvvv \
        -s http://localhost:8080/ -p ./operator tripleo.operator

Then, the following URI were shown in the ansible-galaxy log:

http://localhost:8080/
http://localhost:8080/api
http://localhost:8080/api/v2/collections/tripleo/operator/
http://localhost:8080/api/v2/collections/tripleo/operator/versions/?page_size=100
http://localhost:8080/api/v2/collections/tripleo/operator/versions/0.9.0/

Then, the actual download:
http://localhost:8080/download/tripleo-operator-0.9.0.tar.gz

Then the checksum validation, and eventually it ended with:
Collection 'tripleo.operator:0.9.0' was downloaded successfully

Change-Id: Ibfe846b59bf987df3f533802cb329e15ce83500b
2023-01-16 14:21:40 +01:00
..
conftest.py More yaml.safe_load() in testinfra/conftest.py 2021-10-13 21:58:41 +00:00
test_adns.py Add DNSSEC configuration for gating.dev 2021-07-22 09:36:17 -07:00
test_base.py Switch bridge to bridge01.opendev.org 2022-10-25 16:08:10 +11:00
test_borg_backups.py system-config-run-borg-backup: rename hosts to distro 2022-08-11 13:32:49 +10:00
test_bridge.py bridge: switch OSC from container to local install 2022-11-25 09:37:40 +00:00
test_codesearch.py hound: enable detect-ref 2022-02-25 17:27:35 +11:00
test_eavesdrop.py ptgbot: rename site to ptg.opendev.org 2021-10-07 09:43:39 +11:00
test_etherpad.py etherpad: redirect container logs 2022-11-09 07:46:15 +11:00
test_gerrit.py Block access to Gitiles 2022-02-18 21:39:27 +00:00
test_gitea_lb.py Add Jammy gitea-lb02 to our inventory 2022-10-13 13:09:13 -07:00
test_gitea.py Update to Gitea 1.17 2022-08-18 14:12:30 -07:00
test_grafana.py testinfra: refactor screenshot taking 2021-09-07 12:54:26 +10:00
test_graphite.py graphite: fix xFilesFactor 2022-06-28 18:41:17 +10:00
test_keycloak.py Correct keycloak proxy config 2021-12-04 10:49:11 -08:00
test_letsencrypt.py Update a few s/bridge01/bridge99 references 2022-11-11 15:05:39 +11:00
test_lists_k_i.py Re-expose our Mailman archives.yaml and robots.txt 2022-09-22 20:10:20 +00:00
test_lists_o_o.py Remove opendev and zuul sites from old mm2 server 2022-12-05 23:13:24 +00:00
test_lists_opendev_org.py Fork the maxking/docker-mailman images 2022-11-21 16:51:02 +00:00
test_meetpad.py Use our jitsi-meet image for meetpad 2020-03-27 09:43:41 -07:00
test_mirror-update.py Add Ceph Quincy mirror 2022-09-27 20:33:33 +00:00
test_mirror.py Correct (again) how ansible-galaxy proxy is configured 2023-01-16 14:21:40 +01:00
test_nodepool.py Add new opendev.org nodepool launchers 2021-03-16 15:21:58 -07:00
test_ns.py Configure opendev nameservers using ansible 2018-11-02 13:49:38 -07:00
test_paste.py paste : move testing host to paste99, remove https hacks 2022-07-07 10:02:46 +10:00
test_refstack.py refstack: Edit URL of public RefStackAPI 2021-03-10 14:09:20 +11:00
test_registry.py Run a docker registry for CI 2019-02-01 10:12:51 -08:00
test_static.py static: move certs to group, update testing name to static99 2022-08-05 08:18:55 +10:00
test_tracing.py Add Jaeger tracing server 2022-09-15 19:21:33 -07:00
test_zookeeper.py Add firewall behavior assertions to testinfra testing 2021-12-15 16:36:45 -08:00
test_zuul_executor.py Remove gearman from Zuul 2022-02-01 13:52:47 -08:00
test_zuul_lb.py Add Zuul load balancer 2022-02-10 13:24:42 -08:00
test_zuul_merger.py Remove gearman from Zuul 2022-02-01 13:52:47 -08:00
test_zuul_preview.py Run zuul-preview 2019-02-25 13:14:51 -08:00
test_zuul_scheduler.py Remove gearman from Zuul 2022-02-01 13:52:47 -08:00
util.py testinfra: Update selenium calls 2022-10-20 09:00:43 +11:00