Exemplo n.º 1
0
    def __init__(self, config_dict):
        '''
        Constructor
        '''
        self.config_dict = config_dict
        self.controller = Controller(config_dict['controller']['hostname'],
                                     config_dict['controller']['ip'],
                                     config_dict['controller']['username'],
                                     config_dict['controller']['password'],
                                     config_dict['controller']['sys_username'])

        self.computeHosts = []
        for compute in config_dict['computes']:
            self.computeHosts.append(
                Compute(compute['hostname'], compute['ip'],
                        compute['username'], compute['password']))
        '''
        For this test case, instantiate a compute object which is not the same as controller
        '''

        for compute in config_dict['computes']:
            if compute['hostname'] != config_dict['controller']['hostname']:
                self.compute = Compute(compute['hostname'], compute['ip'],
                                       compute['username'],
                                       compute['password'])

        self.new_tenant = config_dict['openstack_tenant_details'][
            'tenant_name']

        if "tenant_username" in config_dict[
                "openstack_tenant_details"] and config_dict[
                    'openstack_tenant_details']['tenant_username'] is not None:
            self.new_user = config_dict['openstack_tenant_details'][
                'tenant_username']
        else:
            self.new_user = "******"
        if "tenant_password" in config_dict[
                "openstack_tenant_details"] and config_dict[
                    'openstack_tenant_details']['tenant_password'] is not None:
            self.new_password = config_dict['openstack_tenant_details'][
                'tenant_password']
        else:
            self.new_password = "******"
        self.new_network1 = self.new_tenant + "nw1"
        self.new_subnw1 = "10.11.12.0/24"
        self.new_inst1 = self.new_tenant + "inst1"
        self.new_inst2 = self.new_tenant + "inst2"
        self.config_dict = config_dict
Exemplo n.º 2
0
    def __init__(self, config_dict):
        '''
        Constructor
        '''

        self.controller = Controller(config_dict['controller']['hostname'],
                                     config_dict['controller']['ip'],
                                     config_dict['controller']['username'],
                                     config_dict['controller']['password'],
                                     config_dict['controller']['sys_username'])

        self.computeHosts = []
        for compute in config_dict['computes']:
            self.computeHosts.append(
                Compute(
                    compute['hostname'],
                    compute['ip'],
                    compute['username'],
                    compute['password']))

        self.new_tenant = config_dict[
            'openstack_tenant_details']['tenant_name']

        if "tenant_username" in config_dict["openstack_tenant_details"] and config_dict[
                'openstack_tenant_details']['tenant_username'] is not None:
            self.new_user = config_dict[
                'openstack_tenant_details']['tenant_username']
        else:
            self.new_user = "******"
        if "tenant_password" in config_dict["openstack_tenant_details"] and config_dict[
                'openstack_tenant_details']['tenant_password'] is not None:
            self.new_password = config_dict[
                'openstack_tenant_details']['tenant_password']
        else:
            self.new_password = "******"

        self.new_network1 = self.new_tenant + "nw1"
        self.new_subnw1 = "10.11.12.0/24"
        self.new_inst1 = self.new_tenant + "inst1"
        self.new_inst2 = self.new_tenant + "inst2"
        self.dcnm_ip = config_dict['testbed']['dcnm']['address']
        self.dcnm_sys_username = config_dict['testbed']['dcnm']['sys_username']
        self.dcnm_sys_password = config_dict['testbed']['dcnm']['sys_password']
        self.ldap_username = config_dict['testbed']['dcnm']['ldap_username']
        self.ldap_password = config_dict['testbed']['dcnm']['ldap_password']
        self.config_dict = config_dict