From 5bd82174233095a3cccfbbf8524622440c31b10c Mon Sep 17 00:00:00 2001 From: Martin Basti Date: Mon, 30 Jan 2017 21:18:46 +0100 Subject: 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 Reviewed-By: Jan Cholasta --- ipatests/test_integration/test_dns_locations.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/ipatests/test_integration/test_dns_locations.py b/ipatests/test_integration/test_dns_locations.py index e37e1dde3..9bd075cfa 100644 --- a/ipatests/test_integration/test_dns_locations.py +++ b/ipatests/test_integration/test_dns_locations.py @@ -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 """ -- cgit