Exemplo n.º 1
0
 def test_create_entry_ends_with_dot(self):
     instance_id = '11111111-2222-3333-4444-555555555555'
     driver.DNS_DOMAIN_ID = '00000000-0000-0000-0000-000000000000'
     driver.DNS_DOMAIN_NAME = 'trove.com.'
     driver.DNS_TTL = 3600
     hashed_id = base64.b32encode(hashlib.md5(instance_id).digest())
     hashed_id_concat = hashed_id[:11].lower()
     exp_hostname = ("%s.%s" %
                     (hashed_id_concat, driver.DNS_DOMAIN_NAME))[:-1]
     factory = driver.DesignateInstanceEntryFactory()
     entry = factory.create_entry(instance_id)
     self.assertEqual(exp_hostname, entry.name)
Exemplo n.º 2
0
 def test_create_entry(self):
     instance_id = '11111111-2222-3333-4444-555555555555'
     driver.DNS_DOMAIN_ID = '00000000-0000-0000-0000-000000000000'
     driver.DNS_DOMAIN_NAME = 'trove.com'
     driver.DNS_TTL = 3600
     hashed_id = base64.b32encode(hashlib.md5(instance_id).digest())
     hashed_id_concat = hashed_id[:11].lower()
     exp_hostname = ("%s.%s" % (hashed_id_concat, driver.DNS_DOMAIN_NAME))
     factory = driver.DesignateInstanceEntryFactory()
     entry = factory.create_entry(instance_id)
     self.assertEqual(exp_hostname, entry.name)
     self.assertEqual('A', entry.type)
     self.assertEqual(3600, entry.ttl)
     zone = entry.dns_zone
     self.assertEqual(driver.DNS_DOMAIN_NAME, zone.name)
     self.assertEqual(driver.DNS_DOMAIN_ID, zone.id)