Esempio n. 1
0
    def setUp(self):
        super(TestRecordset, self).setUp()
        self.ensure_tld_exists('com')
        self.zone = self.useFixture(
            ZoneFixture(
                name=random_zone_name(),
                email='*****@*****.**',
            )).zone

        name = random_a_recordset_name(self.zone.name)
        self.recordset = self.useFixture(
            RecordsetFixture(
                zone_id=self.zone.id,
                name=name,
                records='1.2.3.4',
                description='An a recordset',
                type='A',
                ttl=1234,
            )).recordset

        self.assertEqual(self.recordset.name, name)
        self.assertEqual(self.recordset.records, '1.2.3.4')
        self.assertEqual(self.recordset.description, 'An a recordset')
        self.assertEqual(self.recordset.type, 'A')
        self.assertEqual(self.recordset.ttl, '1234')
 def setUp(self):
     super(TestZoneTransferRequest, self).setUp()
     self.ensure_tld_exists('com')
     fixture = self.useFixture(ZoneFixture(
         name=random_zone_name(),
         email='*****@*****.**',
     ))
     self.zone = fixture.zone
Esempio n. 3
0
    def test_zone_set_secondary_masters(self):
        fixture = self.useFixture(
            ZoneFixture(
                name=random_zone_name(),
                description='A secondary zone',
                type='SECONDARY',
                masters='127.0.0.1',
            ))
        zone = fixture.zone
        self.assertEqual('127.0.0.1', zone.masters)

        zone = self.clients.zone_set(zone.id, masters='127.0.0.2')
        self.assertEqual('127.0.0.2', zone.masters)
Esempio n. 4
0
 def test_zone_create_secondary_with_all_args(self):
     zone_name = random_zone_name()
     fixture = self.useFixture(
         ZoneFixture(
             name=zone_name,
             description='A secondary zone',
             type='SECONDARY',
             masters='127.0.0.1',
         ))
     zone = fixture.zone
     self.assertEqual(zone_name, zone.name)
     self.assertEqual('A secondary zone', zone.description)
     self.assertEqual('SECONDARY', zone.type)
     self.assertEqual('127.0.0.1', zone.masters)
Esempio n. 5
0
 def test_zone_create_primary_with_all_args(self):
     zone_name = random_zone_name()
     fixture = self.useFixture(
         ZoneFixture(
             name=zone_name,
             email='*****@*****.**',
             description='A primary zone',
             ttl=2345,
             type='PRIMARY',
         ))
     zone = fixture.zone
     self.assertEqual(zone_name, zone.name)
     self.assertEqual('*****@*****.**', zone.email)
     self.assertEqual('A primary zone', zone.description)
     self.assertEqual('2345', zone.ttl)
     self.assertEqual('PRIMARY', zone.type)
    def setUp(self):
        super(TestZoneTransferAccept, self).setUp()
        self.ensure_tld_exists('com')
        fixture = self.useFixture(ZoneFixture(
            name=random_zone_name(),
            email='*****@*****.**',
        ))
        self.zone = fixture.zone

        self.target_client = DesignateCLI.as_user('alt')
        fixture = self.useFixture(TransferRequestFixture(
            zone=self.zone,
            user='******',
            target_user='******',
            target_project_id=self.target_client.project_id,
        ))
        self.transfer_request = fixture.transfer_request
Esempio n. 7
0
    def setUp(self):
        super(TestTSIGKey, self).setUp()
        self.ensure_tsigkey_exists('com')
        self.zone = self.useFixture(
            ZoneFixture(
                name=random_zone_name(),
                email='*****@*****.**',
            )).zone
        tsig_name = random_tsigkey_name()
        tsig_algorithm = "hmac-sha256"
        tsig_secret = random_tsigkey_secret()
        tsig_scope = 'ZONE'
        self.tsig = self.useFixture(
            TSIGKeyFixture(name=tsig_name,
                           algorithm=tsig_algorithm,
                           secret=tsig_secret,
                           scope=tsig_scope,
                           resource_id=self.zone.id)).tsig

        self.assertEqual(self.tsig.name, tsig_name)
        self.assertEqual(self.tsig.algorithm, tsig_algorithm)
        self.assertEqual(self.tsig.secret, tsig_secret)
        self.assertEqual(self.tsig.scope, tsig_scope)
        self.assertEqual(self.tsig.resource_id, self.zone.id)