Пример #1
0
 def test_delete_ns_record(self):
     """Delete an NS record; return True."""
     type = 'NS'
     ns0 = 'nsdelete.aethernet.local'
     ns = SpokeDNSNS(self.org_name, self.dns_zone_name)
     ns.create(type, ns0)
     self.assertTrue(ns.delete(type, ns0))
Пример #2
0
 def test_delete_ns_record(self):
     """Delete an NS record; return True."""
     type = 'NS'
     ns0 = 'nsdelete.aethernet.local'
     ns = SpokeDNSNS(self.org_name, self.dns_zone_name)
     ns.create(type, ns0)
     self.assertTrue(ns.delete(type, ns0))
Пример #3
0
 def test_create_two_ns_records(self):
     """Create two NS records; return results object."""
     type = 'NS'
     ns0 = 'ns0.aethernet.local'
     ns1 = 'ns1.aethernet.local'
     ns = SpokeDNSNS(self.org_name, self.dns_zone_name)
     ns.create(type, ns0)
     result = ns.create(type, ns1)['data']
     dn = '%s=%s,%s' % (self.dns_zone_name_attr, self.dns_zone_name,
                        self.dns_base)
     dn_info = {self.dns_ns_attr: [ns0 + '.', ns1 + '.']}
     expected_result = [(dn, dn_info)]
     self.assertEqual(result, expected_result)
Пример #4
0
 def test_create_two_ns_records(self):
     """Create two NS records; return results object."""
     type = 'NS'
     ns0 = 'ns0.aethernet.local'
     ns1 = 'ns1.aethernet.local'
     ns = SpokeDNSNS(self.org_name, self.dns_zone_name)
     ns.create(type, ns0)
     result = ns.create(type, ns1)['data']
     dn = '%s=%s,%s' % (self.dns_zone_name_attr, self.dns_zone_name,
                        self.dns_base)
     dn_info = {self.dns_ns_attr: [ns0 + '.', ns1 +'.']}                   
     expected_result = [(dn, dn_info)]
     self.assertEqual(result, expected_result)
Пример #5
0
 def test_get_ns_records(self):
     """Retrieve all NS records; return NS record objects."""
     type = 'NS'
     ns0 = 'ns0.aethernet.local'
     ns1 = 'ns1.aethernet.local'
     ns = SpokeDNSNS(self.org_name, self.dns_zone_name)
     ns.create(type, ns0)
     ns.create(type, ns1)
     result = ns.get(type)['data']
     dn = '%s=%s,%s' % (self.dns_zone_name_attr, self.dns_zone_name,
                        self.dns_base)
     dn_info = {'objectClass': ['top', self.dns_zone_name_class],
                'relativeDomainName': ['@'],
                'zoneName': [self.dns_zone_name],
                self.dns_ns_attr: [ns0 + '.', ns1 + '.']}                   
     expected_result = [(dn, dn_info)]
     self.assertEqual(result, expected_result)
Пример #6
0
 def test_delete_specific_ns_record(self):
     """Delete specific NS record; return remaining NS record object."""
     type = 'NS'
     ns0 = 'ns0.aethernet.local'
     ns1 = 'ns1.aethernet.local'
     ns = SpokeDNSNS(self.org_name, self.dns_zone_name)
     ns.create(type, ns0)
     ns.create(type, ns1)
     ns.delete(type, ns0)
     result = ns.get(type)['data']
     dn = '%s=%s,%s' % (self.dns_zone_name_attr, self.dns_zone_name,
                        self.dns_base)
     dn_info = {'objectClass': ['top', self.dns_zone_name_class],
                'relativeDomainName': ['@'],
                'zoneName': [self.dns_zone_name],
                self.dns_ns_attr: [ns1 +'.']}                   
     expected_result = [(dn, dn_info)]
     self.assertEqual(result, expected_result)
Пример #7
0
 def test_get_ns_records(self):
     """Retrieve all NS records; return NS record objects."""
     type = 'NS'
     ns0 = 'ns0.aethernet.local'
     ns1 = 'ns1.aethernet.local'
     ns = SpokeDNSNS(self.org_name, self.dns_zone_name)
     ns.create(type, ns0)
     ns.create(type, ns1)
     result = ns.get(type)['data']
     dn = '%s=%s,%s' % (self.dns_zone_name_attr, self.dns_zone_name,
                        self.dns_base)
     dn_info = {
         'objectClass': ['top', self.dns_zone_name_class],
         'relativeDomainName': ['@'],
         'zoneName': [self.dns_zone_name],
         self.dns_ns_attr: [ns0 + '.', ns1 + '.']
     }
     expected_result = [(dn, dn_info)]
     self.assertEqual(result, expected_result)
Пример #8
0
 def test_delete_specific_ns_record(self):
     """Delete specific NS record; return remaining NS record object."""
     type = 'NS'
     ns0 = 'ns0.aethernet.local'
     ns1 = 'ns1.aethernet.local'
     ns = SpokeDNSNS(self.org_name, self.dns_zone_name)
     ns.create(type, ns0)
     ns.create(type, ns1)
     ns.delete(type, ns0)
     result = ns.get(type)['data']
     dn = '%s=%s,%s' % (self.dns_zone_name_attr, self.dns_zone_name,
                        self.dns_base)
     dn_info = {
         'objectClass': ['top', self.dns_zone_name_class],
         'relativeDomainName': ['@'],
         'zoneName': [self.dns_zone_name],
         self.dns_ns_attr: [ns1 + '.']
     }
     expected_result = [(dn, dn_info)]
     self.assertEqual(result, expected_result)