Merge ~pjdc/ubuntu-mirror-charm/+git/ubuntu-mirror-charm:add-apache-template-testcases into ubuntu-mirror-charm:master

Proposed by Paul Collins
Status: Merged
Approved by: Haw Loeung
Approved revision: 5448a70cb108659a03d0142ed39dfdc4e1fa797f
Merged at revision: 1646a02f2dc28ced8dd952626e05c8d53e39eee3
Proposed branch: ~pjdc/ubuntu-mirror-charm/+git/ubuntu-mirror-charm:add-apache-template-testcases
Merge into: ubuntu-mirror-charm:master
Diff against target: 1047 lines (+902/-10)
16 files modified
scripts/generate-testdata.py (+5/-4)
tests/unit/test_templates.py (+216/-6)
tests/unit/testdata/cdimage/cdimage.txt (+62/-0)
tests/unit/testdata/cdimage/thirdparty.txt (+20/-0)
tests/unit/testdata/cloud-images/cloud-images.txt (+54/-0)
tests/unit/testdata/maas-images/maas-images.txt (+56/-0)
tests/unit/testdata/old-releases/old-releases.txt (+84/-0)
tests/unit/testdata/ports/ports.txt (+22/-0)
tests/unit/testdata/ports/thirdparty.txt (+46/-0)
tests/unit/testdata/releases/releases.txt (+54/-0)
tests/unit/testdata/releases/thirdparty.txt (+20/-0)
tests/unit/testdata/simple-streams/simple-streams.txt (+54/-0)
tests/unit/testdata/ubuntu-cloud-archive/ubuntu-cloud-archive.txt (+39/-0)
tests/unit/testdata/ubuntu-unsafe/ubuntu-unsafe.txt (+42/-0)
tests/unit/testdata/ubuntu/thirdparty.txt (+84/-0)
tests/unit/testdata/ubuntu/ubuntu.txt (+44/-0)
Reviewer Review Type Date Requested Status
Haw Loeung +1 Approve
Canonical IS Reviewers Pending
Review via email: mp+411387@code.launchpad.net

Commit message

add tests for remaining apache templates

The first-party test data is simply the virtualhost configs copied from actiontoad with the Juju header removed. `make generate-testdata` is a no-op.

To post a comment you must log in.
Revision history for this message
Paul Collins (pjdc) wrote :

Output of makes lint, generate-testdata, unittest

Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
Haw Loeung (hloeung) wrote :

LGTM

review: Approve (+1)
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision 1646a02f2dc28ced8dd952626e05c8d53e39eee3

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/scripts/generate-testdata.py b/scripts/generate-testdata.py
2index caabf3e..3d00944 100755
3--- a/scripts/generate-testdata.py
4+++ b/scripts/generate-testdata.py
5@@ -16,7 +16,7 @@ for name, cls in inspect.getmembers(test_templates, inspect.isclass):
6 if not hasattr(cls, '_role'):
7 print('skipping {}: no `_role` attribute'.format(name))
8 continue
9- testcase = cls(methodName='test_template')
10+ testcase = cls(methodName='test_apache_template')
11 testcase.setUp()
12 template_path = testcase._template_path(testcase._role)
13 with warnings.catch_warnings():
14@@ -25,6 +25,7 @@ for name, cls in inspect.getmembers(test_templates, inspect.isclass):
15 with open(os.path.join(testcase.testdata_dir, testcase._role + '.txt'), 'w') as out:
16 print('generating {}'.format(out.name))
17 out.write(str(Template(file=template_path, searchList=testcase._search_list)))
18- with open(os.path.join(testcase.testdata_dir, 'thirdparty.txt'), 'w') as out:
19- out.write(str(Template(file=template_path, searchList=testcase._thirdparty_search_list)))
20- print('generating {}'.format(out.name))
21+ if testcase._thirdparty_search_list:
22+ with open(os.path.join(testcase.testdata_dir, 'thirdparty.txt'), 'w') as out:
23+ out.write(str(Template(file=template_path, searchList=testcase._thirdparty_search_list)))
24+ print('generating {}'.format(out.name))
25diff --git a/tests/unit/test_templates.py b/tests/unit/test_templates.py
26index a9cf4e6..cf21256 100644
27--- a/tests/unit/test_templates.py
28+++ b/tests/unit/test_templates.py
29@@ -5,6 +5,15 @@ import unittest
30 from Cheetah.Template import Template
31
32
33+# as per hooks/hooks.py (yes, this should live in a shared location!)
34+APACHE_TLS_SETTINGS = {
35+ 'ssl_cipher_suite': 'EECDH+AESGCM+AES128:EDH+AESGCM+AES128:EECDH+AES128:EDH+AES128:ECDH+AESGCM+AES128:aRSA+AESGCM+AES128:ECDH+AES128:DH+AES128:aRSA+AES128:EECDH+AESGCM:EDH+AESGCM:EECDH:EDH:ECDH+AESGCM:aRSA+AESGCM:ECDH:DH:aRSA:HIGH:!MEDIUM:!aNULL:!NULL:!LOW:!3DES:!DSS:!EXP:!PSK:!SRP', # noqa: E501
36+ 'ssl_honor_cipher_order': 'on',
37+ # per IS policy, TLS 1.2 is the minimum acceptable version
38+ 'ssl_protocol': 'ALL -SSLv2 -SSLv3 -TLSv1 -TLSv1.1',
39+}
40+
41+
42 class TemplateTestCase(object):
43 """Base class for template test cases.
44
45@@ -24,6 +33,8 @@ class TemplateTestCase(object):
46 self.assertEqual(str(template), wanted)
47
48 def _template_path(self, role):
49+ if role == 'ubuntu-unsafe':
50+ role = 'ubuntu'
51 return os.path.join(os.getcwd(), 'templates', 'apache-{}.tmpl'.format(role))
52
53 # Cheetah warns about using the Python version of NameMapper, so
54@@ -31,7 +42,7 @@ class TemplateTestCase(object):
55 # seem to work, probably because it begins with a newline and
56 # Python's warnings matching code anchors the message regexp.
57 @pytest.mark.filterwarnings("ignore::UserWarning:Cheetah")
58- def test_template(self):
59+ def test_apache_template(self):
60 self._template_compare(
61 self._template_path(self._role),
62 self._search_list,
63@@ -42,11 +53,14 @@ class TemplateTestCase(object):
64 # seem to work, probably because it begins with a newline and
65 # Python's warnings matching code anchors the message regexp.
66 @pytest.mark.filterwarnings("ignore::UserWarning:Cheetah")
67- def test_template_thirdparty(self):
68- self._template_compare(
69- self._template_path(self._role),
70- self._thirdparty_search_list,
71- os.path.join(self.testdata_dir, 'thirdparty.txt'))
72+ def test_apache_template_thirdparty(self):
73+ if self._thirdparty_search_list:
74+ self._template_compare(
75+ self._template_path(self._role),
76+ self._thirdparty_search_list,
77+ os.path.join(self.testdata_dir, 'thirdparty.txt'))
78+ else:
79+ self.skipTest('_thirdparty_search_list is empty')
80
81
82 LINUXCONTAINERS_THIRDPARTY_SEARCH_LIST = {
83@@ -68,3 +82,199 @@ class TestLinuxcontainers(TemplateTestCase, unittest.TestCase):
84 _role = 'linuxcontainers'
85 _search_list = LINUXCONTAINERS_SEARCH_LIST
86 _thirdparty_search_list = LINUXCONTAINERS_THIRDPARTY_SEARCH_LIST
87+
88+
89+UBUNTU_SEARCH_LIST = {
90+ 'addresses': ['*'],
91+ 'name': 'archive.ubuntu.com',
92+ 'aliases': ['*.archive.ubuntu.com', 'archive.ubuntulinux.org', '*.archive.ubuntulinux.org', 'ftp.ubuntu.com', 'ftp.ubuntulinux.org', 'ftp.no-name-yet.com'], # noqa: E501
93+ 'ports': [80],
94+ 'logdir': '/var/log/apache2',
95+ 'unsafe': False,
96+}
97+
98+UBUNTU_THIRDPARTY_SEARCH_LIST = {
99+ 'addresses': ['*'],
100+ 'name': 'ubuntu.mirrors.example.net',
101+ 'aliases': [],
102+ 'ports': [80, 443],
103+ 'logdir': '/var/log/apache2',
104+ 'unsafe': False,
105+}
106+UBUNTU_THIRDPARTY_SEARCH_LIST.update(APACHE_TLS_SETTINGS)
107+
108+
109+class TestUbuntu(TemplateTestCase, unittest.TestCase):
110+ _role = 'ubuntu'
111+ _search_list = UBUNTU_SEARCH_LIST
112+ _thirdparty_search_list = UBUNTU_THIRDPARTY_SEARCH_LIST
113+
114+
115+RELEASES_SEARCH_LIST = {
116+ 'addresses': ['91.189.88.247', '[2001:67c:1360:8001::33]'],
117+ 'name': 'releases.ubuntu.com',
118+ 'aliases': ['*.releases.ubuntu.com', 'releases.ubuntulinux.org', '*.releases.ubuntulinux.org'],
119+ 'ports': [80, 443],
120+ 'logdir': '/var/log/apache2',
121+}
122+RELEASES_SEARCH_LIST.update(APACHE_TLS_SETTINGS)
123+
124+RELEASES_THIRDPARTY_SEARCH_LIST = {
125+ 'addresses': ['*'],
126+ 'name': 'ubuntu-releases.mirrors.example.net',
127+ 'aliases': [],
128+ 'ports': [80],
129+ 'logdir': '/var/log/apache2',
130+}
131+RELEASES_THIRDPARTY_SEARCH_LIST.update(APACHE_TLS_SETTINGS)
132+
133+
134+class TestReleases(TemplateTestCase, unittest.TestCase):
135+ _role = 'releases'
136+ _search_list = RELEASES_SEARCH_LIST
137+ _thirdparty_search_list = RELEASES_THIRDPARTY_SEARCH_LIST
138+
139+
140+CDIMAGE_SEARCH_LIST = {
141+ 'addresses': ['91.189.88.247', '[2001:67c:1360:8001::33]'],
142+ 'name': 'cdimage.ubuntu.com',
143+ 'aliases': ['cdimages.ubuntu.com', '*.cdimage.ubuntu.com', '*.cdimages.ubuntu.com', 'cdimage.ubuntulinux.org', 'cdimages.ubuntulinux.org', '*.cdimage.ubuntulinux.org', '*.cdimages.ubuntulinux.org'], # noqa: E501
144+ 'ports': [80, 443],
145+ 'logdir': '/var/log/apache2',
146+}
147+CDIMAGE_SEARCH_LIST.update(APACHE_TLS_SETTINGS)
148+
149+CDIMAGE_THIRDPARTY_SEARCH_LIST = {
150+ 'addresses': ['*'],
151+ 'name': 'ubuntu-cdimage.mirrors.example.net',
152+ 'aliases': [],
153+ 'ports': [80],
154+ 'logdir': '/var/log/apache2',
155+}
156+CDIMAGE_THIRDPARTY_SEARCH_LIST.update(APACHE_TLS_SETTINGS)
157+
158+
159+class TestCDImage(TemplateTestCase, unittest.TestCase):
160+ _role = 'cdimage'
161+ _search_list = CDIMAGE_SEARCH_LIST
162+ _thirdparty_search_list = CDIMAGE_THIRDPARTY_SEARCH_LIST
163+
164+
165+PORTS_SEARCH_LIST = {
166+ 'addresses': ['*'],
167+ 'name': 'ports.ubuntu.com',
168+ 'aliases': ['ports.ubuntulinux.org', '*.ports.ubuntu.com', '*.ports.ubuntulinux.org'],
169+ 'ports': [80],
170+ 'logdir': '/var/log/apache2',
171+}
172+PORTS_SEARCH_LIST.update(APACHE_TLS_SETTINGS)
173+
174+PORTS_THIRDPARTY_SEARCH_LIST = {
175+ 'addresses': ['*'],
176+ 'name': 'ubuntu-ports.mirrors.example.net',
177+ 'aliases': [],
178+ 'ports': [80, 443],
179+ 'logdir': '/var/log/apache2',
180+}
181+PORTS_THIRDPARTY_SEARCH_LIST.update(APACHE_TLS_SETTINGS)
182+
183+
184+class TestPorts(TemplateTestCase, unittest.TestCase):
185+ _role = 'ports'
186+ _search_list = PORTS_SEARCH_LIST
187+ _thirdparty_search_list = PORTS_THIRDPARTY_SEARCH_LIST
188+
189+
190+UBUNTU_UNSAFE_SEARCH_LIST = {
191+ 'addresses': ['91.189.88.245', '[2001:67c:1360:8001::35]'],
192+ 'name': 'clouds.archive.ubuntu.com',
193+ 'aliases': ['*.clouds.archive.ubuntu.com'],
194+ 'ports': [80],
195+ 'logdir': '/var/log/apache2',
196+ 'unsafe': True,
197+}
198+
199+
200+class TestUbuntuUnsafe(TemplateTestCase, unittest.TestCase):
201+ _role = 'ubuntu-unsafe'
202+ _search_list = UBUNTU_UNSAFE_SEARCH_LIST
203+ _thirdparty_search_list = None # There had better not be third-party mirrors of this!
204+
205+
206+CLOUD_IMAGES_SEARCH_LIST = {
207+ 'addresses': ['91.189.88.247', '[2001:67c:1360:8001::33]'],
208+ 'name': 'cloud-images.ubuntu.com',
209+ 'aliases': ['*.cloud-images.ubuntu.com', 'uec-images.ubuntu.com', 'uec-images.ubuntulinux.org'],
210+ 'ports': [80, 443],
211+ 'logdir': '/var/log/apache2',
212+}
213+CLOUD_IMAGES_SEARCH_LIST.update(APACHE_TLS_SETTINGS)
214+
215+
216+class TestCloudImages(TemplateTestCase, unittest.TestCase):
217+ _role = 'cloud-images'
218+ _search_list = CLOUD_IMAGES_SEARCH_LIST
219+ _thirdparty_search_list = None # There are probably not going to be third-party mirrors of this.
220+
221+
222+MAAS_IMAGES_SEARCH_LIST = {
223+ 'addresses': ['91.189.88.247', '[2001:67c:1360:8001::33]'],
224+ 'name': 'images.maas.io',
225+ 'aliases': ['stats.images.maas.io', 'new.images.maas.io'],
226+ 'ports': [80, 443],
227+ 'logdir': '/var/log/apache2',
228+}
229+MAAS_IMAGES_SEARCH_LIST.update(APACHE_TLS_SETTINGS)
230+
231+
232+class TestMAASImages(TemplateTestCase, unittest.TestCase):
233+ _role = 'maas-images'
234+ _search_list = MAAS_IMAGES_SEARCH_LIST
235+ _thirdparty_search_list = None # There are probably not going to be third-party mirrors of this.
236+
237+
238+SIMPLE_STREAMS_SEARCH_LIST = {
239+ 'addresses': ['91.189.88.247', '[2001:67c:1360:8001::33]'],
240+ 'name': 'streams.canonical.com',
241+ 'aliases': [],
242+ 'ports': [80, 443],
243+ 'logdir': '/var/log/apache2',
244+}
245+SIMPLE_STREAMS_SEARCH_LIST.update(APACHE_TLS_SETTINGS)
246+
247+
248+class TestSimpleStreams(TemplateTestCase, unittest.TestCase):
249+ _role = 'simple-streams'
250+ _search_list = SIMPLE_STREAMS_SEARCH_LIST
251+ _thirdparty_search_list = None # There are probably not going to be third-party mirrors of this.
252+
253+
254+UBUNTU_CLOUD_ARCHIVE_SEARCH_LIST = {
255+ 'addresses': ['*'],
256+ 'name': 'ubuntu-cloud.archive.canonical.com',
257+ 'aliases': [],
258+ 'ports': [80],
259+ 'logdir': '/var/log/apache2',
260+}
261+
262+
263+class TestUbuntuCloudArchive(TemplateTestCase, unittest.TestCase):
264+ _role = 'ubuntu-cloud-archive'
265+ _search_list = UBUNTU_CLOUD_ARCHIVE_SEARCH_LIST
266+ _thirdparty_search_list = None # There are probably not going to be third-party mirrors of this.
267+
268+
269+OLD_RELEASES_SEARCH_LIST = {
270+ 'addresses': ['91.189.88.247', '[2001:67c:1360:8001::33]'],
271+ 'name': 'old-releases.ubuntu.com',
272+ 'aliases': [],
273+ 'ports': [80, 443],
274+ 'logdir': '/var/log/apache2',
275+}
276+OLD_RELEASES_SEARCH_LIST.update(APACHE_TLS_SETTINGS)
277+
278+
279+class TestOldReleases(TemplateTestCase, unittest.TestCase):
280+ _role = 'old-releases'
281+ _search_list = OLD_RELEASES_SEARCH_LIST
282+ _thirdparty_search_list = None # There are probably not going to be third-party mirrors of this.
283diff --git a/tests/unit/testdata/cdimage/cdimage.txt b/tests/unit/testdata/cdimage/cdimage.txt
284new file mode 100644
285index 0000000..a9c2c86
286--- /dev/null
287+++ b/tests/unit/testdata/cdimage/cdimage.txt
288@@ -0,0 +1,62 @@
289+<VirtualHost 91.189.88.247:80 [2001:67c:1360:8001::33]:80>
290+ ServerName cdimage.ubuntu.com
291+ ServerAlias cdimages.ubuntu.com
292+ ServerAlias *.cdimage.ubuntu.com
293+ ServerAlias *.cdimages.ubuntu.com
294+ ServerAlias cdimage.ubuntulinux.org
295+ ServerAlias cdimages.ubuntulinux.org
296+ ServerAlias *.cdimage.ubuntulinux.org
297+ ServerAlias *.cdimages.ubuntulinux.org
298+
299+ CustomLog /var/log/apache2/cdimage.ubuntu.com-access.log combined-port
300+ ErrorLog /var/log/apache2/cdimage.ubuntu.com-error.log
301+ LogFormat "%h %p %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined-port
302+
303+ DocumentRoot /srv/cdimage.ubuntu.com/www
304+ Alias /cdimage "/srv/cdimage.ubuntu.com/www/"
305+
306+ FileETag MTime Size
307+ <Directory "/srv/cdimage.ubuntu.com/">
308+ Require all granted
309+ IndexOptions NameWidth=* +SuppressDescription
310+ Options +Indexes +FollowSymLinks
311+ IndexIgnore favicon.ico
312+ AllowOverride FileInfo Indexes
313+ </Directory>
314+</VirtualHost>
315+
316+<VirtualHost 91.189.88.247:443 [2001:67c:1360:8001::33]:443>
317+ ServerName cdimage.ubuntu.com
318+ ServerAlias cdimages.ubuntu.com
319+ ServerAlias *.cdimage.ubuntu.com
320+ ServerAlias *.cdimages.ubuntu.com
321+ ServerAlias cdimage.ubuntulinux.org
322+ ServerAlias cdimages.ubuntulinux.org
323+ ServerAlias *.cdimage.ubuntulinux.org
324+ ServerAlias *.cdimages.ubuntulinux.org
325+
326+ CustomLog /var/log/apache2/cdimage.ubuntu.com-access.log combined-port
327+ ErrorLog /var/log/apache2/cdimage.ubuntu.com-error.log
328+ LogFormat "%h %p %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined-port
329+
330+ SSLEngine On
331+ SSLCertificateFile /etc/apache2/ssl/cdimage.ubuntu.com.crt
332+ SSLCertificateKeyFile /etc/apache2/ssl/cdimage.ubuntu.com.key
333+ SSLCertificateChainFile /etc/apache2/ssl/cdimage.ubuntu.com_chain.crt
334+ SSLCipherSuite EECDH+AESGCM+AES128:EDH+AESGCM+AES128:EECDH+AES128:EDH+AES128:ECDH+AESGCM+AES128:aRSA+AESGCM+AES128:ECDH+AES128:DH+AES128:aRSA+AES128:EECDH+AESGCM:EDH+AESGCM:EECDH:EDH:ECDH+AESGCM:aRSA+AESGCM:ECDH:DH:aRSA:HIGH:!MEDIUM:!aNULL:!NULL:!LOW:!3DES:!DSS:!EXP:!PSK:!SRP
335+ SSLHonorCipherOrder on
336+ SSLProtocol ALL -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
337+
338+ DocumentRoot /srv/cdimage.ubuntu.com/www
339+ Alias /cdimage "/srv/cdimage.ubuntu.com/www/"
340+
341+ FileETag MTime Size
342+ <Directory "/srv/cdimage.ubuntu.com/">
343+ Require all granted
344+ IndexOptions NameWidth=* +SuppressDescription
345+ Options +Indexes +FollowSymLinks
346+ IndexIgnore favicon.ico
347+ AllowOverride FileInfo Indexes
348+ </Directory>
349+</VirtualHost>
350+
351diff --git a/tests/unit/testdata/cdimage/thirdparty.txt b/tests/unit/testdata/cdimage/thirdparty.txt
352new file mode 100644
353index 0000000..6245040
354--- /dev/null
355+++ b/tests/unit/testdata/cdimage/thirdparty.txt
356@@ -0,0 +1,20 @@
357+<VirtualHost *:80>
358+ ServerName ubuntu-cdimage.mirrors.example.net
359+
360+ CustomLog /var/log/apache2/ubuntu-cdimage.mirrors.example.net-access.log combined-port
361+ ErrorLog /var/log/apache2/ubuntu-cdimage.mirrors.example.net-error.log
362+ LogFormat "%h %p %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined-port
363+
364+ DocumentRoot /srv/ubuntu-cdimage.mirrors.example.net/www
365+ Alias /cdimage "/srv/ubuntu-cdimage.mirrors.example.net/www/"
366+
367+ FileETag MTime Size
368+ <Directory "/srv/ubuntu-cdimage.mirrors.example.net/">
369+ Require all granted
370+ IndexOptions NameWidth=* +SuppressDescription
371+ Options +Indexes +FollowSymLinks
372+ IndexIgnore favicon.ico
373+ AllowOverride FileInfo Indexes
374+ </Directory>
375+</VirtualHost>
376+
377diff --git a/tests/unit/testdata/cloud-images/cloud-images.txt b/tests/unit/testdata/cloud-images/cloud-images.txt
378new file mode 100644
379index 0000000..6cdd52f
380--- /dev/null
381+++ b/tests/unit/testdata/cloud-images/cloud-images.txt
382@@ -0,0 +1,54 @@
383+<VirtualHost 91.189.88.247:80 [2001:67c:1360:8001::33]:80>
384+ ServerName cloud-images.ubuntu.com
385+ ServerAlias *.cloud-images.ubuntu.com
386+ ServerAlias uec-images.ubuntu.com
387+ ServerAlias uec-images.ubuntulinux.org
388+
389+ CustomLog /var/log/apache2/cloud-images.ubuntu.com-access.log combined-port
390+ ErrorLog /var/log/apache2/cloud-images.ubuntu.com-error.log
391+ LogFormat "%h %p %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined-port
392+
393+ DocumentRoot /srv/cloud-images.ubuntu.com/www
394+ Alias /cloud-images "/srv/cloud-images.ubuntu.com/www/"
395+
396+ FileETag MTime Size
397+ <Directory "/srv/cloud-images.ubuntu.com/">
398+ Require all granted
399+ IndexOptions NameWidth=* +SuppressDescription
400+ Options +Indexes +FollowSymLinks
401+ IndexIgnore favicon.ico
402+ AllowOverride FileInfo Indexes
403+ </Directory>
404+</VirtualHost>
405+
406+<VirtualHost 91.189.88.247:443 [2001:67c:1360:8001::33]:443>
407+ ServerName cloud-images.ubuntu.com
408+ ServerAlias *.cloud-images.ubuntu.com
409+ ServerAlias uec-images.ubuntu.com
410+ ServerAlias uec-images.ubuntulinux.org
411+
412+ CustomLog /var/log/apache2/cloud-images.ubuntu.com-access.log combined-port
413+ ErrorLog /var/log/apache2/cloud-images.ubuntu.com-error.log
414+ LogFormat "%h %p %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined-port
415+
416+ SSLEngine On
417+ SSLCertificateFile /etc/apache2/ssl/cloud-images.ubuntu.com.crt
418+ SSLCertificateKeyFile /etc/apache2/ssl/cloud-images.ubuntu.com.key
419+ SSLCertificateChainFile /etc/apache2/ssl/cloud-images.ubuntu.com_chain.crt
420+ SSLCipherSuite EECDH+AESGCM+AES128:EDH+AESGCM+AES128:EECDH+AES128:EDH+AES128:ECDH+AESGCM+AES128:aRSA+AESGCM+AES128:ECDH+AES128:DH+AES128:aRSA+AES128:EECDH+AESGCM:EDH+AESGCM:EECDH:EDH:ECDH+AESGCM:aRSA+AESGCM:ECDH:DH:aRSA:HIGH:!MEDIUM:!aNULL:!NULL:!LOW:!3DES:!DSS:!EXP:!PSK:!SRP
421+ SSLHonorCipherOrder on
422+ SSLProtocol ALL -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
423+
424+ DocumentRoot /srv/cloud-images.ubuntu.com/www
425+ Alias /cloud-images "/srv/cloud-images.ubuntu.com/www/"
426+
427+ FileETag MTime Size
428+ <Directory "/srv/cloud-images.ubuntu.com/">
429+ Require all granted
430+ IndexOptions NameWidth=* +SuppressDescription
431+ Options +Indexes +FollowSymLinks
432+ IndexIgnore favicon.ico
433+ AllowOverride FileInfo Indexes
434+ </Directory>
435+</VirtualHost>
436+
437diff --git a/tests/unit/testdata/maas-images/maas-images.txt b/tests/unit/testdata/maas-images/maas-images.txt
438new file mode 100644
439index 0000000..5202aff
440--- /dev/null
441+++ b/tests/unit/testdata/maas-images/maas-images.txt
442@@ -0,0 +1,56 @@
443+<VirtualHost 91.189.88.247:80 [2001:67c:1360:8001::33]:80>
444+ ServerName images.maas.io
445+ ServerAlias stats.images.maas.io
446+ ServerAlias new.images.maas.io
447+
448+ CustomLog /var/log/apache2/images.maas.io-access.log combined-port
449+ ErrorLog /var/log/apache2/images.maas.io-error.log
450+ LogFormat "%h %p %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined-port
451+
452+ # RT#128160
453+ RedirectMatch permanent ^/ephemeral-v3/+daily/(.*) /ephemeral-v3/stable/$1
454+
455+ DocumentRoot /srv/images.maas.io/www
456+
457+ FileETag MTime Size
458+ <Directory "/srv/images.maas.io/">
459+ Require all granted
460+ IndexOptions NameWidth=* +SuppressDescription
461+ Options +Indexes +FollowSymLinks
462+ IndexIgnore favicon.ico
463+ AllowOverride FileInfo Indexes
464+ </Directory>
465+</VirtualHost>
466+
467+<VirtualHost 91.189.88.247:443 [2001:67c:1360:8001::33]:443>
468+ ServerName images.maas.io
469+ ServerAlias stats.images.maas.io
470+ ServerAlias new.images.maas.io
471+
472+ CustomLog /var/log/apache2/images.maas.io-access.log combined-port
473+ ErrorLog /var/log/apache2/images.maas.io-error.log
474+ LogFormat "%h %p %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined-port
475+
476+ SSLEngine On
477+ SSLCertificateFile /etc/apache2/ssl/images.maas.io.crt
478+ SSLCertificateKeyFile /etc/apache2/ssl/images.maas.io.key
479+ SSLCertificateChainFile /etc/apache2/ssl/images.maas.io_chain.crt
480+ SSLCipherSuite EECDH+AESGCM+AES128:EDH+AESGCM+AES128:EECDH+AES128:EDH+AES128:ECDH+AESGCM+AES128:aRSA+AESGCM+AES128:ECDH+AES128:DH+AES128:aRSA+AES128:EECDH+AESGCM:EDH+AESGCM:EECDH:EDH:ECDH+AESGCM:aRSA+AESGCM:ECDH:DH:aRSA:HIGH:!MEDIUM:!aNULL:!NULL:!LOW:!3DES:!DSS:!EXP:!PSK:!SRP
481+ SSLHonorCipherOrder on
482+ SSLProtocol ALL -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
483+
484+ # RT#128160
485+ RedirectMatch permanent ^/ephemeral-v3/+daily/(.*) /ephemeral-v3/stable/$1
486+
487+ DocumentRoot /srv/images.maas.io/www
488+
489+ FileETag MTime Size
490+ <Directory "/srv/images.maas.io/">
491+ Require all granted
492+ IndexOptions NameWidth=* +SuppressDescription
493+ Options +Indexes +FollowSymLinks
494+ IndexIgnore favicon.ico
495+ AllowOverride FileInfo Indexes
496+ </Directory>
497+</VirtualHost>
498+
499diff --git a/tests/unit/testdata/old-releases/old-releases.txt b/tests/unit/testdata/old-releases/old-releases.txt
500new file mode 100644
501index 0000000..19e302d
502--- /dev/null
503+++ b/tests/unit/testdata/old-releases/old-releases.txt
504@@ -0,0 +1,84 @@
505+<VirtualHost 91.189.88.247:80 [2001:67c:1360:8001::33]:80>
506+ ServerName old-releases.ubuntu.com
507+
508+ CustomLog /var/log/apache2/old-releases.ubuntu.com-access.log combined-port
509+ ErrorLog /var/log/apache2/old-releases.ubuntu.com-error.log
510+ LogFormat "%h %p %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined-port
511+
512+ DocumentRoot /srv/old-releases.ubuntu.com/www
513+ # Munge the Cache-Control/Expires response headers to try make
514+ # transparent proxy servers DTRT.
515+ <Files ~ "Release(\.gpg)?|InRelease|Packages\.(xz|bz2|gz)|Sources\.(xz|bz2|gz)?|Translation-.*?$">
516+ ExpiresActive On
517+ ExpiresDefault "modification plus 1800 seconds"
518+ Header append Cache-Control "proxy-revalidate"
519+ </Files>
520+ # Allow intermediate caches to cache .deb|.udeb|.ddeb files for a day.
521+ # This could be increased in the future since deb files are the perfect
522+ # case for cacheable resources (invariant, versioned URLs, and external
523+ # integrity verification)
524+ <FilesMatch ".+\.[ud]?deb$">
525+ Header append Cache-Control "max-age=86400"
526+ </FilesMatch>
527+ # Allow intermediate caches to store by-hash files for up to a day.
528+ # Again, these files are by definition invariant so they are perfectly
529+ # cacheable.
530+ <FilesMatch "\/by-hash\/">
531+ Header append Cache-Control "max-age=86400"
532+ </FilesMatch>
533+
534+ FileETag MTime Size
535+ <Directory "/srv/old-releases.ubuntu.com/">
536+ Require all granted
537+ IndexOptions NameWidth=* +SuppressDescription
538+ Options +Indexes +FollowSymLinks
539+ IndexIgnore favicon.ico
540+ </Directory>
541+</VirtualHost>
542+
543+<VirtualHost 91.189.88.247:443 [2001:67c:1360:8001::33]:443>
544+ ServerName old-releases.ubuntu.com
545+
546+ CustomLog /var/log/apache2/old-releases.ubuntu.com-access.log combined-port
547+ ErrorLog /var/log/apache2/old-releases.ubuntu.com-error.log
548+ LogFormat "%h %p %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined-port
549+
550+ SSLEngine On
551+ SSLCertificateFile /etc/apache2/ssl/old-releases.ubuntu.com.crt
552+ SSLCertificateKeyFile /etc/apache2/ssl/old-releases.ubuntu.com.key
553+ SSLCertificateChainFile /etc/apache2/ssl/old-releases.ubuntu.com_chain.crt
554+ SSLCipherSuite EECDH+AESGCM+AES128:EDH+AESGCM+AES128:EECDH+AES128:EDH+AES128:ECDH+AESGCM+AES128:aRSA+AESGCM+AES128:ECDH+AES128:DH+AES128:aRSA+AES128:EECDH+AESGCM:EDH+AESGCM:EECDH:EDH:ECDH+AESGCM:aRSA+AESGCM:ECDH:DH:aRSA:HIGH:!MEDIUM:!aNULL:!NULL:!LOW:!3DES:!DSS:!EXP:!PSK:!SRP
555+ SSLHonorCipherOrder on
556+ SSLProtocol ALL -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
557+
558+ DocumentRoot /srv/old-releases.ubuntu.com/www
559+ # Munge the Cache-Control/Expires response headers to try make
560+ # transparent proxy servers DTRT.
561+ <Files ~ "Release(\.gpg)?|InRelease|Packages\.(xz|bz2|gz)|Sources\.(xz|bz2|gz)?|Translation-.*?$">
562+ ExpiresActive On
563+ ExpiresDefault "modification plus 1800 seconds"
564+ Header append Cache-Control "proxy-revalidate"
565+ </Files>
566+ # Allow intermediate caches to cache .deb|.udeb|.ddeb files for a day.
567+ # This could be increased in the future since deb files are the perfect
568+ # case for cacheable resources (invariant, versioned URLs, and external
569+ # integrity verification)
570+ <FilesMatch ".+\.[ud]?deb$">
571+ Header append Cache-Control "max-age=86400"
572+ </FilesMatch>
573+ # Allow intermediate caches to store by-hash files for up to a day.
574+ # Again, these files are by definition invariant so they are perfectly
575+ # cacheable.
576+ <FilesMatch "\/by-hash\/">
577+ Header append Cache-Control "max-age=86400"
578+ </FilesMatch>
579+
580+ FileETag MTime Size
581+ <Directory "/srv/old-releases.ubuntu.com/">
582+ Require all granted
583+ IndexOptions NameWidth=* +SuppressDescription
584+ Options +Indexes +FollowSymLinks
585+ IndexIgnore favicon.ico
586+ </Directory>
587+</VirtualHost>
588+
589diff --git a/tests/unit/testdata/ports/ports.txt b/tests/unit/testdata/ports/ports.txt
590new file mode 100644
591index 0000000..ea6aaf7
592--- /dev/null
593+++ b/tests/unit/testdata/ports/ports.txt
594@@ -0,0 +1,22 @@
595+<VirtualHost *:80>
596+ ServerName ports.ubuntu.com
597+ ServerAlias ports.ubuntulinux.org
598+ ServerAlias *.ports.ubuntu.com
599+ ServerAlias *.ports.ubuntulinux.org
600+
601+ CustomLog /var/log/apache2/ports.ubuntu.com-access.log combined-port
602+ ErrorLog /var/log/apache2/ports.ubuntu.com-error.log
603+ LogFormat "%h %p %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined-port
604+
605+ DocumentRoot /srv/ports.ubuntu.com/www
606+ Alias /cdimage "/srv/ports.ubuntu.com/www/"
607+
608+ FileETag MTime Size
609+ <Directory "/srv/ports.ubuntu.com/">
610+ Require all granted
611+ IndexOptions NameWidth=* +SuppressDescription
612+ Options +Indexes +FollowSymLinks
613+ IndexIgnore favicon.ico
614+ </Directory>
615+</VirtualHost>
616+
617diff --git a/tests/unit/testdata/ports/thirdparty.txt b/tests/unit/testdata/ports/thirdparty.txt
618new file mode 100644
619index 0000000..b31b5e6
620--- /dev/null
621+++ b/tests/unit/testdata/ports/thirdparty.txt
622@@ -0,0 +1,46 @@
623+<VirtualHost *:80>
624+ ServerName ubuntu-ports.mirrors.example.net
625+
626+ CustomLog /var/log/apache2/ubuntu-ports.mirrors.example.net-access.log combined-port
627+ ErrorLog /var/log/apache2/ubuntu-ports.mirrors.example.net-error.log
628+ LogFormat "%h %p %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined-port
629+
630+ DocumentRoot /srv/ubuntu-ports.mirrors.example.net/www
631+ Alias /cdimage "/srv/ubuntu-ports.mirrors.example.net/www/"
632+
633+ FileETag MTime Size
634+ <Directory "/srv/ubuntu-ports.mirrors.example.net/">
635+ Require all granted
636+ IndexOptions NameWidth=* +SuppressDescription
637+ Options +Indexes +FollowSymLinks
638+ IndexIgnore favicon.ico
639+ </Directory>
640+</VirtualHost>
641+
642+<VirtualHost *:443>
643+ ServerName ubuntu-ports.mirrors.example.net
644+
645+ CustomLog /var/log/apache2/ubuntu-ports.mirrors.example.net-access.log combined-port
646+ ErrorLog /var/log/apache2/ubuntu-ports.mirrors.example.net-error.log
647+ LogFormat "%h %p %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined-port
648+
649+ SSLEngine On
650+ SSLCertificateFile /etc/apache2/ssl/ubuntu-ports.mirrors.example.net.crt
651+ SSLCertificateKeyFile /etc/apache2/ssl/ubuntu-ports.mirrors.example.net.key
652+ SSLCertificateChainFile /etc/apache2/ssl/ubuntu-ports.mirrors.example.net_chain.crt
653+ SSLCipherSuite EECDH+AESGCM+AES128:EDH+AESGCM+AES128:EECDH+AES128:EDH+AES128:ECDH+AESGCM+AES128:aRSA+AESGCM+AES128:ECDH+AES128:DH+AES128:aRSA+AES128:EECDH+AESGCM:EDH+AESGCM:EECDH:EDH:ECDH+AESGCM:aRSA+AESGCM:ECDH:DH:aRSA:HIGH:!MEDIUM:!aNULL:!NULL:!LOW:!3DES:!DSS:!EXP:!PSK:!SRP
654+ SSLHonorCipherOrder on
655+ SSLProtocol ALL -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
656+
657+ DocumentRoot /srv/ubuntu-ports.mirrors.example.net/www
658+ Alias /cdimage "/srv/ubuntu-ports.mirrors.example.net/www/"
659+
660+ FileETag MTime Size
661+ <Directory "/srv/ubuntu-ports.mirrors.example.net/">
662+ Require all granted
663+ IndexOptions NameWidth=* +SuppressDescription
664+ Options +Indexes +FollowSymLinks
665+ IndexIgnore favicon.ico
666+ </Directory>
667+</VirtualHost>
668+
669diff --git a/tests/unit/testdata/releases/releases.txt b/tests/unit/testdata/releases/releases.txt
670new file mode 100644
671index 0000000..6790689
672--- /dev/null
673+++ b/tests/unit/testdata/releases/releases.txt
674@@ -0,0 +1,54 @@
675+<VirtualHost 91.189.88.247:80 [2001:67c:1360:8001::33]:80>
676+ ServerName releases.ubuntu.com
677+ ServerAlias *.releases.ubuntu.com
678+ ServerAlias releases.ubuntulinux.org
679+ ServerAlias *.releases.ubuntulinux.org
680+
681+ CustomLog /var/log/apache2/releases.ubuntu.com-access.log combined-port
682+ ErrorLog /var/log/apache2/releases.ubuntu.com-error.log
683+ LogFormat "%h %p %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined-port
684+
685+ DocumentRoot /srv/releases.ubuntu.com/www
686+ Alias /releases "/srv/releases.ubuntu.com/www/"
687+
688+ FileETag MTime Size
689+ <Directory "/srv/releases.ubuntu.com/">
690+ Require all granted
691+ IndexOptions NameWidth=* +SuppressDescription
692+ Options +Indexes +FollowSymLinks
693+ IndexIgnore favicon.ico
694+ AllowOverride FileInfo Indexes
695+ </Directory>
696+</VirtualHost>
697+
698+<VirtualHost 91.189.88.247:443 [2001:67c:1360:8001::33]:443>
699+ ServerName releases.ubuntu.com
700+ ServerAlias *.releases.ubuntu.com
701+ ServerAlias releases.ubuntulinux.org
702+ ServerAlias *.releases.ubuntulinux.org
703+
704+ CustomLog /var/log/apache2/releases.ubuntu.com-access.log combined-port
705+ ErrorLog /var/log/apache2/releases.ubuntu.com-error.log
706+ LogFormat "%h %p %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined-port
707+
708+ SSLEngine On
709+ SSLCertificateFile /etc/apache2/ssl/releases.ubuntu.com.crt
710+ SSLCertificateKeyFile /etc/apache2/ssl/releases.ubuntu.com.key
711+ SSLCertificateChainFile /etc/apache2/ssl/releases.ubuntu.com_chain.crt
712+ SSLCipherSuite EECDH+AESGCM+AES128:EDH+AESGCM+AES128:EECDH+AES128:EDH+AES128:ECDH+AESGCM+AES128:aRSA+AESGCM+AES128:ECDH+AES128:DH+AES128:aRSA+AES128:EECDH+AESGCM:EDH+AESGCM:EECDH:EDH:ECDH+AESGCM:aRSA+AESGCM:ECDH:DH:aRSA:HIGH:!MEDIUM:!aNULL:!NULL:!LOW:!3DES:!DSS:!EXP:!PSK:!SRP
713+ SSLHonorCipherOrder on
714+ SSLProtocol ALL -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
715+
716+ DocumentRoot /srv/releases.ubuntu.com/www
717+ Alias /releases "/srv/releases.ubuntu.com/www/"
718+
719+ FileETag MTime Size
720+ <Directory "/srv/releases.ubuntu.com/">
721+ Require all granted
722+ IndexOptions NameWidth=* +SuppressDescription
723+ Options +Indexes +FollowSymLinks
724+ IndexIgnore favicon.ico
725+ AllowOverride FileInfo Indexes
726+ </Directory>
727+</VirtualHost>
728+
729diff --git a/tests/unit/testdata/releases/thirdparty.txt b/tests/unit/testdata/releases/thirdparty.txt
730new file mode 100644
731index 0000000..0043de6
732--- /dev/null
733+++ b/tests/unit/testdata/releases/thirdparty.txt
734@@ -0,0 +1,20 @@
735+<VirtualHost *:80>
736+ ServerName ubuntu-releases.mirrors.example.net
737+
738+ CustomLog /var/log/apache2/ubuntu-releases.mirrors.example.net-access.log combined-port
739+ ErrorLog /var/log/apache2/ubuntu-releases.mirrors.example.net-error.log
740+ LogFormat "%h %p %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined-port
741+
742+ DocumentRoot /srv/ubuntu-releases.mirrors.example.net/www
743+ Alias /releases "/srv/ubuntu-releases.mirrors.example.net/www/"
744+
745+ FileETag MTime Size
746+ <Directory "/srv/ubuntu-releases.mirrors.example.net/">
747+ Require all granted
748+ IndexOptions NameWidth=* +SuppressDescription
749+ Options +Indexes +FollowSymLinks
750+ IndexIgnore favicon.ico
751+ AllowOverride FileInfo Indexes
752+ </Directory>
753+</VirtualHost>
754+
755diff --git a/tests/unit/testdata/simple-streams/simple-streams.txt b/tests/unit/testdata/simple-streams/simple-streams.txt
756new file mode 100644
757index 0000000..c38ddce
758--- /dev/null
759+++ b/tests/unit/testdata/simple-streams/simple-streams.txt
760@@ -0,0 +1,54 @@
761+<VirtualHost 91.189.88.247:80 [2001:67c:1360:8001::33]:80>
762+ ServerName streams.canonical.com
763+
764+ CustomLog /var/log/apache2/streams.canonical.com-access.log combined-port
765+ ErrorLog /var/log/apache2/streams.canonical.com-error.log
766+ LogFormat "%h %p %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined-port
767+
768+ DocumentRoot /srv/streams.canonical.com/www
769+ Alias /simple-streams "/srv/streams.canonical.com/www/"
770+
771+ FileETag MTime Size
772+ <Directory "/srv/streams.canonical.com/">
773+ Require all granted
774+ IndexOptions NameWidth=* +SuppressDescription
775+ Options +Indexes +FollowSymLinks
776+ IndexIgnore favicon.ico
777+ AllowOverride FileInfo Indexes
778+ </Directory>
779+
780+ # cRT#130349
781+ AddOutputFilterByType DEFLATE application/json
782+</VirtualHost>
783+
784+<VirtualHost 91.189.88.247:443 [2001:67c:1360:8001::33]:443>
785+ ServerName streams.canonical.com
786+
787+ CustomLog /var/log/apache2/streams.canonical.com-access.log combined-port
788+ ErrorLog /var/log/apache2/streams.canonical.com-error.log
789+ LogFormat "%h %p %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined-port
790+
791+ SSLEngine On
792+ SSLCertificateFile /etc/apache2/ssl/streams.canonical.com.crt
793+ SSLCertificateKeyFile /etc/apache2/ssl/streams.canonical.com.key
794+ SSLCertificateChainFile /etc/apache2/ssl/streams.canonical.com_chain.crt
795+ SSLCipherSuite EECDH+AESGCM+AES128:EDH+AESGCM+AES128:EECDH+AES128:EDH+AES128:ECDH+AESGCM+AES128:aRSA+AESGCM+AES128:ECDH+AES128:DH+AES128:aRSA+AES128:EECDH+AESGCM:EDH+AESGCM:EECDH:EDH:ECDH+AESGCM:aRSA+AESGCM:ECDH:DH:aRSA:HIGH:!MEDIUM:!aNULL:!NULL:!LOW:!3DES:!DSS:!EXP:!PSK:!SRP
796+ SSLHonorCipherOrder on
797+ SSLProtocol ALL -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
798+
799+ DocumentRoot /srv/streams.canonical.com/www
800+ Alias /simple-streams "/srv/streams.canonical.com/www/"
801+
802+ FileETag MTime Size
803+ <Directory "/srv/streams.canonical.com/">
804+ Require all granted
805+ IndexOptions NameWidth=* +SuppressDescription
806+ Options +Indexes +FollowSymLinks
807+ IndexIgnore favicon.ico
808+ AllowOverride FileInfo Indexes
809+ </Directory>
810+
811+ # cRT#130349
812+ AddOutputFilterByType DEFLATE application/json
813+</VirtualHost>
814+
815diff --git a/tests/unit/testdata/ubuntu-cloud-archive/ubuntu-cloud-archive.txt b/tests/unit/testdata/ubuntu-cloud-archive/ubuntu-cloud-archive.txt
816new file mode 100644
817index 0000000..34e829e
818--- /dev/null
819+++ b/tests/unit/testdata/ubuntu-cloud-archive/ubuntu-cloud-archive.txt
820@@ -0,0 +1,39 @@
821+<VirtualHost *:80>
822+ ServerName ubuntu-cloud.archive.canonical.com
823+
824+ CustomLog /var/log/apache2/ubuntu-cloud.archive.canonical.com-access.log combined-port
825+ ErrorLog /var/log/apache2/ubuntu-cloud.archive.canonical.com-error.log
826+ LogFormat "%h %p %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined-port
827+
828+ DocumentRoot /srv/ubuntu-cloud.archive.canonical.com/www
829+
830+ # Munge the Cache-Control/Expires response headers to try make
831+ # transparent proxy servers DTRT.
832+ <Files ~ "Release(\.gpg)?|InRelease|Packages\.(xz|bz2|gz)|Sources\.(xz|bz2|gz)?|Translation-.*?$">
833+ ExpiresActive On
834+ ExpiresDefault "modification plus 1800 seconds"
835+ Header append Cache-Control "proxy-revalidate"
836+ </Files>
837+ # Allow intermediate caches to cache .deb|.udeb|.ddeb files for a day.
838+ # This could be increased in the future since deb files are the perfect
839+ # case for cacheable resources (invariant, versioned URLs, and external
840+ # integrity verification)
841+ <FilesMatch ".+\.[ud]?deb$">
842+ Header append Cache-Control "max-age=86400"
843+ </FilesMatch>
844+ # Allow intermediate caches to store by-hash files for up to a day.
845+ # Again, these files are by definition invariant so they are perfectly
846+ # cacheable.
847+ <FilesMatch "\/by-hash\/">
848+ Header append Cache-Control "max-age=86400"
849+ </FilesMatch>
850+
851+ FileETag MTime Size
852+ <Directory "/srv/ubuntu-cloud.archive.canonical.com/">
853+ Require all granted
854+ IndexOptions NameWidth=* +SuppressDescription
855+ Options +Indexes +FollowSymLinks
856+ IndexIgnore favicon.ico
857+ </Directory>
858+</VirtualHost>
859+
860diff --git a/tests/unit/testdata/ubuntu-unsafe/ubuntu-unsafe.txt b/tests/unit/testdata/ubuntu-unsafe/ubuntu-unsafe.txt
861new file mode 100644
862index 0000000..2a2b121
863--- /dev/null
864+++ b/tests/unit/testdata/ubuntu-unsafe/ubuntu-unsafe.txt
865@@ -0,0 +1,42 @@
866+<VirtualHost 91.189.88.245:80 [2001:67c:1360:8001::35]:80>
867+ ServerName clouds.archive.ubuntu.com
868+ ServerAlias *.clouds.archive.ubuntu.com
869+
870+ CustomLog /var/log/apache2/clouds.archive.ubuntu.com-access.log combined-port
871+ ErrorLog /var/log/apache2/clouds.archive.ubuntu.com-error.log
872+ LogFormat "%h %p %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined-port
873+
874+ # LP:1868232 (cRT#125271)
875+ HTTPProtocolOptions unsafe
876+
877+ DocumentRoot /srv/clouds.archive.ubuntu.com/www
878+ # Munge the Cache-Control/Expires response headers to try make
879+ # transparent proxy servers DTRT.
880+ <Files ~ "Release(\.gpg)?|InRelease|Packages\.(xz|bz2|gz)|Sources\.(xz|bz2|gz)?|Translation-.*?$">
881+ ExpiresActive On
882+ ExpiresDefault "modification plus 1800 seconds"
883+ Header append Cache-Control "proxy-revalidate"
884+ </Files>
885+ # Allow intermediate caches to cache .deb|.udeb|.ddeb files for a day.
886+ # This could be increased in the future since deb files are the perfect
887+ # case for cacheable resources (invariant, versioned URLs, and external
888+ # integrity verification)
889+ <FilesMatch ".+\.[ud]?deb$">
890+ Header append Cache-Control "max-age=86400"
891+ </FilesMatch>
892+ # Allow intermediate caches to store by-hash files for up to a day.
893+ # Again, these files are by definition invariant so they are perfectly
894+ # cacheable.
895+ <FilesMatch "\/by-hash\/">
896+ Header append Cache-Control "max-age=86400"
897+ </FilesMatch>
898+
899+ FileETag MTime Size
900+ <Directory "/srv/clouds.archive.ubuntu.com/">
901+ Require all granted
902+ IndexOptions NameWidth=* +SuppressDescription
903+ Options +Indexes +FollowSymLinks
904+ IndexIgnore favicon.ico
905+ </Directory>
906+</VirtualHost>
907+
908diff --git a/tests/unit/testdata/ubuntu/thirdparty.txt b/tests/unit/testdata/ubuntu/thirdparty.txt
909new file mode 100644
910index 0000000..54b0912
911--- /dev/null
912+++ b/tests/unit/testdata/ubuntu/thirdparty.txt
913@@ -0,0 +1,84 @@
914+<VirtualHost *:80>
915+ ServerName ubuntu.mirrors.example.net
916+
917+ CustomLog /var/log/apache2/ubuntu.mirrors.example.net-access.log combined-port
918+ ErrorLog /var/log/apache2/ubuntu.mirrors.example.net-error.log
919+ LogFormat "%h %p %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined-port
920+
921+ DocumentRoot /srv/ubuntu.mirrors.example.net/www
922+ # Munge the Cache-Control/Expires response headers to try make
923+ # transparent proxy servers DTRT.
924+ <Files ~ "Release(\.gpg)?|InRelease|Packages\.(xz|bz2|gz)|Sources\.(xz|bz2|gz)?|Translation-.*?$">
925+ ExpiresActive On
926+ ExpiresDefault "modification plus 1800 seconds"
927+ Header append Cache-Control "proxy-revalidate"
928+ </Files>
929+ # Allow intermediate caches to cache .deb|.udeb|.ddeb files for a day.
930+ # This could be increased in the future since deb files are the perfect
931+ # case for cacheable resources (invariant, versioned URLs, and external
932+ # integrity verification)
933+ <FilesMatch ".+\.[ud]?deb$">
934+ Header append Cache-Control "max-age=86400"
935+ </FilesMatch>
936+ # Allow intermediate caches to store by-hash files for up to a day.
937+ # Again, these files are by definition invariant so they are perfectly
938+ # cacheable.
939+ <FilesMatch "\/by-hash\/">
940+ Header append Cache-Control "max-age=86400"
941+ </FilesMatch>
942+
943+ FileETag MTime Size
944+ <Directory "/srv/ubuntu.mirrors.example.net/">
945+ Require all granted
946+ IndexOptions NameWidth=* +SuppressDescription
947+ Options +Indexes +FollowSymLinks
948+ IndexIgnore favicon.ico
949+ </Directory>
950+</VirtualHost>
951+
952+<VirtualHost *:443>
953+ ServerName ubuntu.mirrors.example.net
954+
955+ CustomLog /var/log/apache2/ubuntu.mirrors.example.net-access.log combined-port
956+ ErrorLog /var/log/apache2/ubuntu.mirrors.example.net-error.log
957+ LogFormat "%h %p %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined-port
958+
959+ SSLEngine On
960+ SSLCertificateFile /etc/apache2/ssl/ubuntu.mirrors.example.net.crt
961+ SSLCertificateKeyFile /etc/apache2/ssl/ubuntu.mirrors.example.net.key
962+ SSLCertificateChainFile /etc/apache2/ssl/ubuntu.mirrors.example.net_chain.crt
963+ SSLCipherSuite EECDH+AESGCM+AES128:EDH+AESGCM+AES128:EECDH+AES128:EDH+AES128:ECDH+AESGCM+AES128:aRSA+AESGCM+AES128:ECDH+AES128:DH+AES128:aRSA+AES128:EECDH+AESGCM:EDH+AESGCM:EECDH:EDH:ECDH+AESGCM:aRSA+AESGCM:ECDH:DH:aRSA:HIGH:!MEDIUM:!aNULL:!NULL:!LOW:!3DES:!DSS:!EXP:!PSK:!SRP
964+ SSLHonorCipherOrder on
965+ SSLProtocol ALL -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
966+
967+ DocumentRoot /srv/ubuntu.mirrors.example.net/www
968+ # Munge the Cache-Control/Expires response headers to try make
969+ # transparent proxy servers DTRT.
970+ <Files ~ "Release(\.gpg)?|InRelease|Packages\.(xz|bz2|gz)|Sources\.(xz|bz2|gz)?|Translation-.*?$">
971+ ExpiresActive On
972+ ExpiresDefault "modification plus 1800 seconds"
973+ Header append Cache-Control "proxy-revalidate"
974+ </Files>
975+ # Allow intermediate caches to cache .deb|.udeb|.ddeb files for a day.
976+ # This could be increased in the future since deb files are the perfect
977+ # case for cacheable resources (invariant, versioned URLs, and external
978+ # integrity verification)
979+ <FilesMatch ".+\.[ud]?deb$">
980+ Header append Cache-Control "max-age=86400"
981+ </FilesMatch>
982+ # Allow intermediate caches to store by-hash files for up to a day.
983+ # Again, these files are by definition invariant so they are perfectly
984+ # cacheable.
985+ <FilesMatch "\/by-hash\/">
986+ Header append Cache-Control "max-age=86400"
987+ </FilesMatch>
988+
989+ FileETag MTime Size
990+ <Directory "/srv/ubuntu.mirrors.example.net/">
991+ Require all granted
992+ IndexOptions NameWidth=* +SuppressDescription
993+ Options +Indexes +FollowSymLinks
994+ IndexIgnore favicon.ico
995+ </Directory>
996+</VirtualHost>
997+
998diff --git a/tests/unit/testdata/ubuntu/ubuntu.txt b/tests/unit/testdata/ubuntu/ubuntu.txt
999new file mode 100644
1000index 0000000..2121a4c
1001--- /dev/null
1002+++ b/tests/unit/testdata/ubuntu/ubuntu.txt
1003@@ -0,0 +1,44 @@
1004+<VirtualHost *:80>
1005+ ServerName archive.ubuntu.com
1006+ ServerAlias *.archive.ubuntu.com
1007+ ServerAlias archive.ubuntulinux.org
1008+ ServerAlias *.archive.ubuntulinux.org
1009+ ServerAlias ftp.ubuntu.com
1010+ ServerAlias ftp.ubuntulinux.org
1011+ ServerAlias ftp.no-name-yet.com
1012+
1013+ CustomLog /var/log/apache2/archive.ubuntu.com-access.log combined-port
1014+ ErrorLog /var/log/apache2/archive.ubuntu.com-error.log
1015+ LogFormat "%h %p %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined-port
1016+
1017+ DocumentRoot /srv/archive.ubuntu.com/www
1018+ # Munge the Cache-Control/Expires response headers to try make
1019+ # transparent proxy servers DTRT.
1020+ <Files ~ "Release(\.gpg)?|InRelease|Packages\.(xz|bz2|gz)|Sources\.(xz|bz2|gz)?|Translation-.*?$">
1021+ ExpiresActive On
1022+ ExpiresDefault "modification plus 1800 seconds"
1023+ Header append Cache-Control "proxy-revalidate"
1024+ </Files>
1025+ # Allow intermediate caches to cache .deb|.udeb|.ddeb files for a day.
1026+ # This could be increased in the future since deb files are the perfect
1027+ # case for cacheable resources (invariant, versioned URLs, and external
1028+ # integrity verification)
1029+ <FilesMatch ".+\.[ud]?deb$">
1030+ Header append Cache-Control "max-age=86400"
1031+ </FilesMatch>
1032+ # Allow intermediate caches to store by-hash files for up to a day.
1033+ # Again, these files are by definition invariant so they are perfectly
1034+ # cacheable.
1035+ <FilesMatch "\/by-hash\/">
1036+ Header append Cache-Control "max-age=86400"
1037+ </FilesMatch>
1038+
1039+ FileETag MTime Size
1040+ <Directory "/srv/archive.ubuntu.com/">
1041+ Require all granted
1042+ IndexOptions NameWidth=* +SuppressDescription
1043+ Options +Indexes +FollowSymLinks
1044+ IndexIgnore favicon.ico
1045+ </Directory>
1046+</VirtualHost>
1047+

Subscribers

People subscribed via source and target branches