Esempio n. 1
0
    def test_maas_subnet(self):
        client_config = config.DrydockConfig.node_driver['maasdriver']

        maas_client = client.MaasRequestFactory(client_config['api_url'], client_config['api_key'])

        subnet_list = maas_subnet.Subnets(maas_client)
        subnet_list.refresh()

        for s in subnet_list:
            print(s.to_dict())
        assert False
Esempio n. 2
0
    def test_client_authenticate(self):
        client_config = config.DrydockConfig.node_driver['maasdriver']

        maas_client = client.MaasRequestFactory(client_config['api_url'],
                                                client_config['api_key'])

        resp = maas_client.get('account/',
                               params={'op': 'list_authorisation_tokens'})

        parsed = resp.json()

        assert len(parsed) > 0
Esempio n. 3
0
    def test_maas_fabric(self):
         client_config = config.DrydockConfig.node_driver['maasdriver']

         maas_client = client.MaasRequestFactory(client_config['api_url'], client_config['api_key'])

         fabric_name = str(uuid.uuid4())

         fabric_list = maas_fabric.Fabrics(maas_client)
         fabric_list.refresh()

         test_fabric = maas_fabric.Fabric(maas_client, name=fabric_name, description='Test Fabric')
         test_fabric = fabric_list.add(test_fabric)

         assert test_fabric.name == fabric_name
         assert test_fabric.resource_id is not None

         query_fabric = maas_fabric.Fabric(maas_client, resource_id=test_fabric.resource_id)
         query_fabric.refresh()

         assert query_fabric.name == test_fabric.name