def resource_setup(cls): super(OVSVAPPTestadminJSON, cls).resource_setup() cls.auth_provider = auth_manager.get_auth_provider( cls.isolated_creds.get_admin_creds()) cls.ext_net_id = CONF.network.public_network_id cls.network = cls.create_shared_network() cls.subnet = cls.create_subnet(cls.network, client=cls.admin_client)
def _fetch_cluster_in_use_from_server(self, server_id): region = CONF.compute.region auth_provider = manager.get_auth_provider( self.isolated_creds.get_admin_creds()) rs_client = rest_client.RestClient(auth_provider, "compute", region) resp, body = rs_client.get("servers/%s" % str(server_id)) body = jsonutils.loads(body) cst_name = body['server']['OS-EXT-SRV-ATTR:hypervisor_hostname'] return cst_name[cst_name.index("(") + 1:cst_name.rindex(")")]
def get_server_ip(self, server_id, net_name): region = CONF.compute.region auth_provider = manager.get_auth_provider( self.isolated_creds.get_admin_creds()) endpoint_type = CONF.compute.endpoint_type build_interval = CONF.compute.build_interval build_timeout = CONF.compute.build_timeout disable_ssl_cert = CONF.identity.disable_ssl_certificate_validation ca_certs = CONF.identity.ca_certificates_file rs_client = rest_client.RestClient(auth_provider, "compute", region, endpoint_type, build_interval, build_timeout, disable_ssl_cert, ca_certs) resp, body = rs_client.get("servers/%s" % str(server_id)) body = jsonutils.loads(body) ipaddress = body['server']['addresses'][net_name][0]['addr'] return ipaddress
def _fetch_cluster_in_use_from_server(self, server_id): region = CONF.compute.region auth_provider = manager.get_auth_provider( self.isolated_creds.get_admin_creds()) endpoint_type = CONF.compute.endpoint_type build_interval = CONF.compute.build_interval build_timeout = CONF.compute.build_timeout disable_ssl_cert = CONF.identity.disable_ssl_certificate_validation ca_certs = CONF.identity.ca_certificates_file rs_client = rest_client.RestClient(auth_provider, "compute", region, endpoint_type, build_interval, build_timeout, disable_ssl_cert, ca_certs) resp, body = rs_client.get("servers/%s" % str(server_id)) body = jsonutils.loads(body) cst_name = body['server']['OS-EXT-SRV-ATTR:hypervisor_hostname'] return cst_name[cst_name.index("(") + 1:cst_name.rindex(")")]
def resource_setup(cls): super(ESXNetworksTestJSON, cls).resource_setup() admin_manager = clients.AdminManager() cls.identity_admin_client = admin_manager.identity_client cls.auth_provider = manager.get_auth_provider( cls.isolated_creds.get_primary_creds()) if not test.is_extension_enabled('router', 'network'): msg = "router extension not enabled." raise cls.skipException(msg) cls.ext_net_id = CONF.network.public_network_id # Create network, subnet, router and add interface cls.network = cls.create_network() cls.subnet = cls.create_subnet(cls.network) cls.tenant_cidr = (CONF.network.tenant_network_cidr if cls._ip_version == 4 else CONF.network.tenant_network_v6_cidr) cls.router = cls.create_router(data_utils.rand_name('router-'), external_network_id=cls.ext_net_id, admin_state_up="true") cls.create_router_interface(cls.router['id'], cls.subnet['id']) cls.port = list() cls.floating_ip = cls.create_floatingip(cls.ext_net_id) tempest_config.register_options()
def resource_setup(cls): super(TestL2GatewayBasic, cls).resource_setup() nova_creds = cls.isolated_creds.get_admin_creds() cls.auth_provider = manager.get_auth_provider(nova_creds)