0a0ca77f3b
Switch the DNS testing names to "99" which helps disambiguate testing from production, and makes you think harder about ensuring references are abstracted properly. The LE zone gets installed on the hidden primary, so it should just use the inventory_hostname rather than hard-coding. Instead of hard-coding the secondaries, we grab them from the secondary DNS group. This should allow us to start up replacement DNS servers which will be inactive until they are enabled for the domain. This requires an update to the LE job, as it currently doesn't have a secondary nameserver as part of the nodes. This means the "adns-secondary" group is blank there. Even though this node isn't doing anything, I think it's worth adding to cover this path (I did consider some sort of dummy host add type thing, but that just makes things hard to follow). We also use the 99 suffix in that job just for consistency. Change-Id: I1a4be41b70180deab51a3cc8a2b3e83ffd0ff1dc
44 lines
1.5 KiB
Python
44 lines
1.5 KiB
Python
# Copyright 2018 Red Hat, Inc.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
# not use this file except in compliance with the License. You may obtain
|
|
# a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
# License for the specific language governing permissions and limitations
|
|
# under the License.
|
|
|
|
|
|
testinfra_hosts = ['adns99.opendev.org']
|
|
|
|
|
|
def test_bind(host):
|
|
named = host.service('bind9')
|
|
assert named.is_running
|
|
|
|
def test_zone_files(host):
|
|
opendev_zone = host.file('/var/lib/bind/zones/opendev.org')
|
|
assert opendev_zone.exists
|
|
|
|
acme_opendev_zone = host.file('/var/lib/bind/zones/acme.opendev.org')
|
|
assert acme_opendev_zone.exists
|
|
|
|
zuul_ci_zone = host.file('/var/lib/bind/zones/zuul-ci.org')
|
|
assert zuul_ci_zone.exists
|
|
|
|
zuulci_zone = host.file('/var/lib/bind/zones/zuulci.org')
|
|
assert zuulci_zone.exists
|
|
|
|
gating_dev_zone = host.file('/var/lib/bind/zones/gating.dev')
|
|
assert gating_dev_zone.exists
|
|
|
|
bind_config = host.file('/etc/bind/named.conf')
|
|
assert b'zone opendev.org {' in bind_config.content
|
|
assert b'zone acme.opendev.org {' in bind_config.content
|
|
assert b'zone zuul-ci.org {' in bind_config.content
|
|
assert b'zone zuulci.org {' in bind_config.content
|