From c0ac38c2c96d61acbcf76a4960d82d12514544d9 Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Tue, 19 May 2020 09:05:36 -0700 Subject: [PATCH] Listen on Quay Registry Mirror Ports We need to tell apache to listen on the ports used by the Quay Registry Mirror. Without this we aren't actually able to provide connections to this vhost. Add testing to ensure this is working in a simple manner. Change-Id: I28bdb7aeb9c3252c6319658acaa530a7d7c25a72 --- .../roles/mirror/templates/mirror.vhost.j2 | 5 +++++ testinfra/test_mirror.py | 20 ++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/playbooks/roles/mirror/templates/mirror.vhost.j2 b/playbooks/roles/mirror/templates/mirror.vhost.j2 index 87ed9cdd23..e277775d01 100644 --- a/playbooks/roles/mirror/templates/mirror.vhost.j2 +++ b/playbooks/roles/mirror/templates/mirror.vhost.j2 @@ -22,6 +22,11 @@ NameVirtualHost *:8083 Listen 4446 NameVirtualHost *:4446 +Listen 8084 +NameVirtualHost *:8084 +Listen 4447 +NameVirtualHost *:4447 + {% raw %} LogFormat "%h %l %u [%{%F %T}t.%{msec_frac}t] \"%r\" %>s %b %{cache-status}e \"%{Referer}i\" \"%{User-agent}i\"" combined-cache ErrorLogFormat "[%{cu}t] [%-m:%l] [pid %P:tid %T] %7F: %E: [client\ %a] %M% , \ referer\ %{Referer}i" diff --git a/testinfra/test_mirror.py b/testinfra/test_mirror.py index 886ef1c3c1..4021e600ff 100644 --- a/testinfra/test_mirror.py +++ b/testinfra/test_mirror.py @@ -91,4 +91,22 @@ def test_dockerv2_mirror(host): cmd = host.run("wget -O- http://[%s]:8082/v2/" %addr) assert '401 Unauthorized' in cmd.stderr -# TODO test RHRegistryMirror and QuayMirror +def test_quay_mirror(host): + # QuayRegistryMirror + for addr in host.addr(host.backend.host).ipv4_addresses: + cmd = host.run("wget --no-check-certificate -qO- " + "https://%s:4447/" % addr) + assert 'quay' in cmd.stdout + + cmd = host.run("wget -qO- http://%s:8084/" % addr) + assert 'quay' in cmd.stdout + + for addr in host.addr(host.backend.host).ipv6_addresses: + cmd = host.run("wget --no-check-certificate -qO- " + "https://[%s]:4447/" % addr) + assert 'quay' in cmd.stdout + + cmd = host.run("wget -qO- http://[%s]:8084/" % addr) + assert 'quay' in cmd.stdout + +# TODO test RHRegistryMirror