pvl/hosts/tests.py
changeset 493 c9725dd0d48c
parent 492 ddd13dadf6a8
child 494 6d258338b363
--- a/pvl/hosts/tests.py	Thu Feb 26 15:54:32 2015 +0200
+++ b/pvl/hosts/tests.py	Thu Feb 26 15:57:52 2015 +0200
@@ -165,6 +165,15 @@
         with self.assertRaises(zone.HostZoneError):
             self.assertZoneEquals(zone.host_forward(h, 'domain'), { })
 
+    def testHostFQDN(self):
+        h = Host.build('host.example.net', None,
+                ip          = '192.0.2.3',
+        )
+
+        self.assertZoneEquals(zone.host_forward(h, 'example.com'), {
+
+        })
+
     def testHostDelegate(self):
         h = Host.build('host', 'example.com',
                 forward = 'host.example.net',
@@ -357,6 +366,21 @@
 
         })
 
+    def testHostFQDN(self):
+        h = Host.build('host.example.net', None,
+                ip          = '192.0.2.3',
+                ip6         = '2001:db8::192.0.2.3',
+        )
+
+        self.assertZoneEquals((rr for ip, rr in zone.host_reverse(h, ipaddr.IPNetwork('192.0.2.1/24'))), {
+            ('3', 'PTR'): ['host.example.net.'],
+
+        })
+        
+        self.assertZoneEquals((rr for ip, rr in zone.host_reverse(h, ipaddr.IPNetwork('2001:db8::/64'))), {
+            ('3.0.2.0.0.0.0.c.0.0.0.0.0.0.0.0', 'PTR'): ['host.example.net.'],
+        })
+
     def testHostDelegate(self):
         h = Host.build('host', 'example.com',
                 ip      = '192.0.2.1',