Example #1
0
 def test_add_addr_creates_public_records(self):
     self.z.add_addr('vm00', ip.IPAddress('195.62.125.33'), ['vm00.ipv4'])
     self.assertIn(RR.A('vm00', ip.IPAddress('195.62.125.33')),
                   self.z.external_forward.records)
     self.assertIn(RR.A('vm00', ip.IPAddress('195.62.125.33')),
                   self.z.internal_forward.records)
     self.assertIn(RR.CNAME('vm00.ipv4', 'vm00'),
                   self.z.external_forward.records)
     self.assertIn(RR.CNAME('vm00.ipv4', 'vm00'),
                   self.z.internal_forward.records)
Example #2
0
 def test_first_cname_wins(self):
     z = ForwardZone('gocept.net')
     z.add_cname('vm00', 'first')
     z.add_cname('vm00', 'second')
     self.assertEqual([RR.CNAME('vm00', 'first')], z.records)
Example #3
0
 def test_add_addr_creates_no_public_records(self):
     self.z.add_addr('vm00', ip.IPAddress('172.22.48.20'), ['vm00.ipv4'])
     self.assertNotIn(RR.A('vm00', ip.IPAddress('172.22.48.20')),
                      self.z.external_forward.records)
     self.assertNotIn(RR.CNAME('vm00.ipv4', 'vm00'),
                      self.z.external_forward.records)