def resource_setup(cls): super(RBACSharedNetworksTest, cls).resource_setup() if not test.is_extension_enabled('rbac_policies', 'network'): msg = "rbac extension not enabled." raise cls.skipException(msg) creds = cls.isolated_creds.get_alt_creds() cls.client2 = clients.Manager(credentials=creds).network_client
def get_client_manager(cls, credential_type=None, roles=None, force_new=None): manager = test.BaseTestCase.get_client_manager( credential_type=credential_type, roles=roles, force_new=force_new) # Neutron uses a different clients manager than the one in the Tempest return clients.Manager(manager.credentials)
def resource_setup(cls): super(AddressScopeTestBase, cls).resource_setup() try: creds = cls.isolated_creds.get_admin_creds() cls.os_adm = clients.Manager(credentials=creds) except NotImplementedError: msg = ("Missing Administrative Network API credentials " "in configuration.") raise cls.skipException(msg) cls.admin_client = cls.os_adm.network_client
def resource_setup(cls): super(FloatingIPAdminTestJSON, cls).resource_setup() cls.ext_net_id = CONF.network.public_network_id cls.floating_ip = cls.create_floatingip(cls.ext_net_id) cls.alt_manager = clients.Manager(cls.isolated_creds.get_alt_creds()) cls.alt_client = cls.alt_manager.network_client cls.network = cls.create_network() cls.subnet = cls.create_subnet(cls.network) cls.router = cls.create_router(data_utils.rand_name('router-'), external_network_id=cls.ext_net_id) cls.create_router_interface(cls.router['id'], cls.subnet['id']) cls.port = cls.create_port(cls.network)
def resource_setup(cls): super(SubnetPoolsTest, cls).resource_setup() prefixes = [u'10.11.12.0/24'] cls._subnetpool_data = {'subnetpool': {'min_prefixlen': '29', 'prefixes': prefixes}} try: creds = cls.isolated_creds.get_admin_creds() cls.os_adm = clients.Manager(credentials=creds) except NotImplementedError: msg = ("Missing Administrative Network API credentials " "in configuration.") raise cls.skipException(msg) cls.admin_client = cls.os_adm.network_client
def resource_setup(cls): super(AddressScopeTestBase, cls).resource_setup() if not test.is_extension_enabled('address-scope', 'network'): msg = "address-scope extension not enabled." raise cls.skipException(msg) try: creds = cls.isolated_creds.get_admin_creds() cls.os_adm = clients.Manager(credentials=creds) except NotImplementedError: msg = ("Missing Administrative Network API credentials " "in configuration.") raise cls.skipException(msg) cls.admin_client = cls.os_adm.network_client
def resource_setup(cls): super(SubnetPoolsNegativeTestJSON, cls).resource_setup() min_prefixlen = '29' prefixes = [u'10.11.12.0/24'] name = data_utils.rand_name(SUBNETPOOL_NAME) cls._subnetpool_data = {'subnetpool': {'name': name, 'prefixes': prefixes, 'min_prefixlen': min_prefixlen}} try: creds = cls.isolated_creds.get_admin_creds() cls.os_adm = clients.Manager(credentials=creds) except NotImplementedError: msg = ("Missing Administrative Network API credentials " "in configuration.") raise cls.skipException(msg) cls.admin_client = cls.os_adm.network_client
def get_client_manager(cls): """ Returns an OpenStack client manager """ force_tenant_isolation = getattr(cls, 'force_tenant_isolation', None) if (not hasattr(cls, 'isolated_creds') or not cls.isolated_creds.name == cls.__name__): cls.isolated_creds = credentials.get_isolated_credentials( name=cls.__name__, network_resources=cls.network_resources, force_tenant_isolation=force_tenant_isolation, ) creds = cls.isolated_creds.get_primary_creds() os = clients.Manager(credentials=creds, service=cls._service) return os
def resource_setup(cls): super(RBACSharedNetworksTest, cls).resource_setup() extensions = cls.admin_client.list_extensions() if not test.is_extension_enabled('rbac_policies', 'network'): msg = "rbac extension not enabled." raise cls.skipException(msg) # NOTE(kevinbenton): the following test seems to be necessary # since the default is 'all' for the above check and these tests # need to get into the gate and be disabled until the service plugin # is enabled in devstack. Is there a better way to do this? if 'rbac-policies' not in [ x['alias'] for x in extensions['extensions'] ]: msg = "rbac extension is not in extension listing." raise cls.skipException(msg) creds = cls.isolated_creds.get_alt_creds() cls.client2 = clients.Manager(credentials=creds).network_client