--- a/pvl/hosts/tests.py Thu Feb 26 15:57:52 2015 +0200
+++ b/pvl/hosts/tests.py Thu Feb 26 16:01:10 2015 +0200
@@ -401,6 +401,27 @@
})
+ def testHosts(self):
+ hosts = [
+ Host.build('foo', 'domain',
+ ip = '192.0.2.1',
+ ),
+ Host.build('bar', 'domain',
+ ip = '192.0.2.2',
+ )
+ ]
+
+ self.assertZoneEquals(zone.apply_hosts_reverse(hosts, ipaddr.IPNetwork('192.0.2.1/24')), {
+ ('1', 'PTR'): ['foo.domain.'],
+ ('2', 'PTR'): ['bar.domain.'],
+ })
+
+ # in ip order
+ self.assertZoneEquals(zone.apply_hosts_reverse(reversed(hosts), ipaddr.IPNetwork('192.0.2.1/24')), {
+ ('1', 'PTR'): ['foo.domain.'],
+ ('2', 'PTR'): ['bar.domain.'],
+ })
+
def testHostsConflict(self):
hosts = [
Host.build('foo', 'domain',