Test: DNS nsupdate from dns-update-system-records

Get nsupdate data from dns-update-system-records, remove system records
and run nsupdate to verify that all system records were updated

https://fedorahosted.org/freeipa/ticket/6585

Reviewed-By: Tomas Krizek <tkrizek@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
This commit is contained in:
Martin Basti 2017-01-30 21:18:46 +01:00
parent 7eb2ef6190
commit 5bd8217423

View File

@ -104,6 +104,31 @@ class TestDNSLocations(IntegrationTest):
for ip in (self.master.ip, self.replicas[0].ip, self.replicas[1].ip):
self._test_against_server(ip, domain, expected_servers)
def test_nsupdate_without_locations(self):
"""Test nsupdate file generated by dns-update-system-records
Remove all records and the use nsupdate to restore state and test if
all record are there as expected"""
domain = DNSName(self.master.domain.name).make_absolute()
filepath = '/tmp/ipa.nsupdate'
self.master.run_command([
'ipa', 'dns-update-system-records', '--dry-run', '--out', filepath
])
# delete original records first
for rname, _port in IPA_DEFAULT_MASTER_SRV_REC:
self.master.run_command([
'ipa', 'dnsrecord-del', str(domain), str(rname), '--del-all'
])
# allow unauthenticates nsupdate (no need to testing authentication)
self.master.run_command([
'ipa', 'dnszone-mod', str(domain),
'--update-policy=grant * wildcard *;'
])
self.master.run_command(['nsupdate', '-g', filepath])
time.sleep(5) # give time to named to process everything from update
self.test_without_locations()
def test_one_replica_in_location(self):
"""Put one replica to location and test if records changed properly
"""