Ejemplo n.º 1
0
    def setUp(self):
        super(TestNodeFacade, self).setUp()

        self.version = 'v1'
        self.res_uri = '/api/{version}/nodes/'.format(version=self.version)

        self.client = fuelclient.get_client('node', self.version)
def generate_rally_mos_nodes_tasks():
    nailgun_nodes_client = fuelclient.get_client('node')
    nailgun_nodes = nailgun_nodes_client.get_all()
    private_key = open("/root/.ssh/id_rsa", "r").read()

    nodes = []
    for nailgun_node in nailgun_nodes:
        node = {
            "address": nailgun_node["ip"],
            "hostname": nailgun_node["fqdn"],
            "username": "******",
            "private_key": private_key,
            "roles": nailgun_node["roles"]
        }
        nodes.append(node)

    nodes.append({
        "address": get_ip_address('eth0'),
        "hostname": socket.gethostname(),
        "username": "******",
        "password": "******",
        "roles": ["master"]
    })

    return nodes
Ejemplo n.º 3
0
    def __init__(self, fuel_address, fuel_username, fuel_password):
        master_ssh = general_client.GeneralActionsClient(
            fuel_address, fuel_username, password=fuel_password)

        self.put_updated_hiera(master_ssh)
        fuel_access = self.get_hiera_value(master_ssh, "FUEL_ACCESS")

        self.api_connection = api_client.Client(
            host=fuel_address,
            port=8000,
            os_username=fuel_access["user"],
            os_password=fuel_access["password"],
            os_tenant_name="admin")

        nailgun_nodes_client = fuelclient.get_client(
            'node', connection=self.api_connection)

        nailgun_nodes = nailgun_nodes_client.get_all()
        private_key = master_ssh.get_file_content("/root/.ssh/id_rsa")

        self.nodes = []
        for nailgun_node in nailgun_nodes:
            node = {
                "address": nailgun_node["ip"],
                "hostname": nailgun_node["fqdn"],
                "username": "******",
                "private_key": private_key,
                "roles": nailgun_node["roles"]
            }
            self.nodes.append(node)
Ejemplo n.º 4
0
    def setUp(self):
        super(TestEnvFacade, self).setUp()

        self.version = 'v1'
        self.res_uri = '/api/{version}/clusters/'.format(version=self.version)

        self.client = fuelclient.get_client('environment', self.version)
Ejemplo n.º 5
0
    def setUp(self):
        super(TestTaskFacade, self).setUp()

        self.version = 'v1'
        self.res_uri = '/api/{version}/tasks/'.format(version=self.version)

        self.client = fuelclient.get_client('task', self.version)
Ejemplo n.º 6
0
def get_envs():
    nodes = fuelclient.get_client(resource="node").get_all()
    result = []
    for node in nodes:
        if node['cluster'] not in result:
            result.append(node['cluster'])
    return result
Ejemplo n.º 7
0
    def setUp(self):
        super(TestOpenstackConfigClient, self).setUp()

        self.version = 'v1'
        self.uri = '/api/{version}/openstack-config/'.format(
            version=self.version)

        self.client = fuelclient.get_client('openstack-config', self.version)
    def setUp(self):
        super(TestOpenstackConfigClient, self).setUp()

        self.version = 'v1'
        self.uri = '/api/{version}/openstack-config/'.format(
            version=self.version)

        self.client = fuelclient.get_client('openstack-config', self.version)
Ejemplo n.º 9
0
    def setUp(self):
        super(TestSnapshotFacade, self).setUp()

        self.version = 'v1'
        self.res_uri = '/api/{version}/logs/package'.format(
            version=self.version)
        self.client = fuelclient.get_client('snapshot', self.version)
        self.fake_task = utils.get_fake_task()
Ejemplo n.º 10
0
    def _test_info_download(self, client_name, yaml_data, uri):
        client = fuelclient.get_client(client_name, self.version)
        expected_body = yaml.load(yaml_data)
        matcher = self.m_request.get("{0}{1}".format(self.res_uri, uri),
                                     json=expected_body)
        result = client.download(self.task_id)

        self.assertTrue(matcher.called)
        self.assertEqual(expected_body, result)
Ejemplo n.º 11
0
    def setUp(self):
        super(TestHealthFacade, self).setUp()

        self.version = 'v1'
        self.res_uri = '/ostf/'
        self.fake_test_sets = utils.get_fake_test_sets(10)
        self.fake_test_sets_items = utils.get_fake_test_set_items(10)

        self.client = fuelclient.get_client('health', self.version)
Ejemplo n.º 12
0
    def setUp(self):
        super(TestRoleFacade, self).setUp()

        self.version = 'v1'
        self.role_name = 'fake_role'
        self.fake_role = utils.get_fake_role(self.role_name)
        self.fake_roles = utils.get_fake_roles(10)

        self.client = fuelclient.get_client('role', self.version)
Ejemplo n.º 13
0
    def setUp(self):
        super(TestFuelVersionFacade, self).setUp()

        self.version = 'v1'
        self.res_uri = '/api/{version}/version/'.format(version=self.version)

        self.fake_version = utils.get_fake_fuel_version()

        self.client = fuelclient.get_client('fuel-version', self.version)
Ejemplo n.º 14
0
    def setUp(self):
        super(TestReleaseFacade, self).setUp()

        self.version = 'v1'
        self.res_uri = '/api/{version}/releases/'.format(version=self.version)
        self.fake_releases = utils.get_fake_releases(10)
        self.fake_release_components = utils.get_fake_release_components(10)
        self.fake_attributes_metadata = utils.get_fake_attributes_metadata()
        self.client = fuelclient.get_client('release', self.version)
Ejemplo n.º 15
0
def get_nodes(env=0):
    nodes = fuelclient.get_client(resource="node").get_all()
    result = {}
    for node in nodes:
        if (env > 0) and (node['cluster'] == env):
            result[node['id']] = node['roles']
        else:
            result[node['id']] = node['roles']
    return result
Ejemplo n.º 16
0
    def setUp(self):
        super(TestPluginsFacade, self).setUp()

        self.version = 'v1'
        self.res_uri = '/api/{version}/plugins/'.format(version=self.version)

        self.fake_plugins = utils.get_fake_plugins(10)

        self.client = fuelclient.get_client('plugins', self.version)
Ejemplo n.º 17
0
    def setUp(self):
        super(TestTagFacade, self).setUp()

        self.version = 'v1'
        self.tag_name = 'fake_tag'
        self.fake_tag = utils.get_fake_tag(self.tag_name)
        self.fake_tags = utils.get_fake_tags(10)

        self.client = fuelclient.get_client('tag', self.version)
Ejemplo n.º 18
0
    def setUp(self):
        super(TestFuelVersionFacade, self).setUp()

        self.version = 'v1'
        self.res_uri = '/api/{version}/version/'.format(version=self.version)

        self.fake_version = utils.get_fake_fuel_version()

        self.client = fuelclient.get_client('fuel-version', self.version)
    def _test_info_download(self, client_name, yaml_data, uri):
        client = fuelclient.get_client(client_name, self.version)
        expected_body = yaml.load(yaml_data)
        matcher = self.m_request.get("{0}{1}".format(self.res_uri, uri),
                                     json=expected_body)
        result = client.download(self.task_id)

        self.assertTrue(matcher.called)
        self.assertEqual(expected_body, result)
Ejemplo n.º 20
0
    def setUp(self):
        super(TestTaskFacade, self).setUp()

        self.version = 'v1'
        self.res_uri = '/api/{version}/tasks/'.format(version=self.version)

        self.fake_task = utils.get_fake_task()
        self.fake_tasks = [utils.get_fake_task() for _ in range(10)]

        self.client = fuelclient.get_client('task', self.version)
Ejemplo n.º 21
0
    def setUp(self):
        super(TestVipFacade, self).setUp()

        self.version = 'v1'
        self.env_id = 42
        self.res_uri = ('/api/{version}/clusters/{env_id}'
                        '/network_configuration/ips/vips/'.format(
                            version=self.version, env_id=self.env_id))

        self.client = fuelclient.get_client('vip', self.version)
Ejemplo n.º 22
0
    def setUp(self):
        super(TestNetworkTemplateFacade, self).setUp()

        self.version = 'v1'
        self.env_id = 42
        self.res_uri = ('/api/{version}/clusters/{env_id}'
                        '/network_configuration/template'.format(
                            version=self.version, env_id=self.env_id))

        self.client = fuelclient.get_client('environment', self.version)
Ejemplo n.º 23
0
    def setUp(self):
        super(TestTaskFacade, self).setUp()

        self.version = 'v1'
        self.res_uri = '/api/{version}/tasks/'.format(version=self.version)

        self.fake_task = utils.get_fake_task()
        self.fake_tasks = [utils.get_fake_task() for _ in range(10)]

        self.client = fuelclient.get_client('task', self.version)
Ejemplo n.º 24
0
    def setUp(self):
        super(TestNodeFacade, self).setUp()

        self.version = 'v1'
        self.res_uri = '/api/{version}/nodes/'.format(version=self.version)

        self.fake_node = utils.get_fake_node()
        self.fake_nodes = [utils.get_fake_node() for _ in range(10)]

        self.client = fuelclient.get_client('node', self.version)
Ejemplo n.º 25
0
    def setUp(self):
        super(TestEnvFacade, self).setUp()

        self.version = 'v1'
        self.res_uri = '/api/{version}/clusters/'.format(version=self.version)

        self.fake_env = utils.get_fake_env()
        self.fake_envs = [utils.get_fake_env() for i in range(10)]

        self.client = fuelclient.get_client('environment', self.version)
Ejemplo n.º 26
0
    def setUp(self):
        super(TestNodeFacade, self).setUp()

        self.version = 'v1'
        self.res_uri = '/api/{version}/nodes/'.format(version=self.version)

        self.fake_node = utils.get_fake_node()
        self.fake_nodes = [utils.get_fake_node() for _ in range(10)]

        self.client = fuelclient.get_client('node', self.version)
    def setUp(self):
        super(TestEnvFacade, self).setUp()

        self.version = 'v1'
        self.res_uri = '/api/{version}/clusters/'.format(version=self.version)

        self.fake_env = utils.get_fake_env()
        self.fake_envs = [utils.get_fake_env() for i in range(10)]

        self.client = fuelclient.get_client('environment', self.version)
    def setUp(self):
        super(TestNetworkTemplateFacade, self).setUp()

        self.version = 'v1'
        self.env_id = 42
        self.res_uri = (
            '/api/{version}/clusters/{env_id}'
            '/network_configuration/template'.format(
                version=self.version, env_id=self.env_id))

        self.client = fuelclient.get_client('environment', self.version)
Ejemplo n.º 29
0
    def setUp(self):
        super(TestNetworkGroupFacade, self).setUp()

        self.version = 'v1'
        self.res_uri = '/api/{version}/networks/'.format(version=self.version)

        self.fake_network_group = utils.get_fake_network_group()
        self.fake_network_groups = [utils.get_fake_network_group()
                                    for i in range(10)]

        self.client = fuelclient.get_client('network-group')
Ejemplo n.º 30
0
    def setUp(self):
        super(TestVipFacade, self).setUp()

        self.version = 'v1'
        self.env_id = 42
        self.res_uri = (
            '/api/{version}/clusters/{env_id}'
            '/network_configuration/ips/vips/'.format(
                version=self.version, env_id=self.env_id))

        self.client = fuelclient.get_client('vip', self.version)
Ejemplo n.º 31
0
    def setUp(self):
        super(TestDeploymentHistoryFacade, self).setUp()

        self.version = 'v1'
        self.transaction_id = '1'
        self.res_uri = '/api/{0}/transactions/{1}'\
                       '/deployment_history/' \
                       ''.format(self.version, self.transaction_id)

        self.fake_history = utils.get_fake_deployment_history()

        self.client = fuelclient.get_client('deployment_history', self.version)
    def setUp(self):
        super(TestDeploymentHistoryFacade, self).setUp()

        self.version = 'v1'
        self.transaction_id = '1'
        self.res_uri = '/api/{0}/transactions/{1}'\
                       '/deployment_history/' \
                       ''.format(self.version, self.transaction_id)

        self.fake_history = utils.get_fake_deployment_history()

        self.client = fuelclient.get_client('deployment_history', self.version)
Ejemplo n.º 33
0
 def setUp(self):
     super(TestDeploymentSequence, self).setUp()
     self.version = 'v1'
     self.client = fuelclient.get_client('sequence', self.version)
     self.env_id = 1
     self.sequence_body = {
         'id': 1,
         'release_id': 1,
         'name': 'test',
         'graphs': [{
             'type': 'graph1'
         }]
     }
Ejemplo n.º 34
0
    def setUp(self):
        super(TestEnvFacade, self).setUp()

        self.version = 'v1'
        self.res_uri = '/api/{version}/clusters/'.format(version=self.version)
        self.net_conf_uri = '/network_configuration/neutron'
        self.settings_uri = '/attributes'
        self.net_verify_uri = '/network_configuration/neutron/verify'

        self.fake_env = utils.get_fake_env()
        self.fake_envs = [utils.get_fake_env() for i in range(10)]

        self.client = fuelclient.get_client('environment', self.version)
Ejemplo n.º 35
0
    def setUp(self):
        super(TestExtensionFacade, self).setUp()

        self.version = 'v1'
        self.res_uri = '/api/{version}/extensions/'.format(
            version=self.version)
        self.res_env_uri = '/api/{version}/clusters/'.format(
            version=self.version)
        self.fake_ext = ['fake_ext1']
        self.fake_extensions = utils.get_fake_extensions(10)
        self.fake_env_extensions = utils.get_fake_env_extensions()

        self.client = fuelclient.get_client('extension', self.version)
Ejemplo n.º 36
0
    def setUp(self):
        super(TestPluginsFacade, self).setUp()

        self.version = 'v1'
        self.client = fuelclient.get_client('plugins', self.version)
Ejemplo n.º 37
0
 def __init__(self, *args, **kwargs):
     super(BaseCommand, self).__init__(*args, **kwargs)
     self.client = fuelclient.get_client(self.entity_name, VERSION)
Ejemplo n.º 38
0
 def __init__(self, *args, **kwargs):
     super(BaseCommand, self).__init__(*args, **kwargs)
     self.client = fuelclient.get_client(self.entity_name, VERSION)
Ejemplo n.º 39
0
 def setUp(self):
     super(TestDeploymentGraphFacade, self).setUp()
     self.version = 'v1'
     self.client = fuelclient.get_client('graph', self.version)
     self.env_id = 1
Ejemplo n.º 40
0
    def setUp(self):
        super(TestPluginsFacade, self).setUp()

        self.version = 'v1'
        self.client = fuelclient.get_client('plugins', self.version)
Ejemplo n.º 41
0
 def lazy_attribute_handler(self, target):
     return fuelclient.get_client(target)
 def setUp(self):
     super(TestDeploymentGraphFacade, self).setUp()
     self.version = 'v1'
     self.client = fuelclient.get_client('graph', self.version)
     self.env_id = 1