Пример #1
0
    def create_networks_and_servers(self, **kwargs):
        with LOCK:
            keypairs = []
            for x in range(MAX_RESOURCES):
                if self.tenant_ids:
                    router, network, subnet, cidr = vpn_utils.create_network(
                        self.neutron_client, self.neutron_admin_client,
                        self.suffixes[x], self.tenant_ids[x])
                else:
                    router, network, subnet, cidr = vpn_utils.create_network(
                        self.neutron_client, self.neutron_admin_client,
                        self.suffixes[x])
                self.rally_cidrs.append(cidr)
                self.rally_subnets.append(subnet)
                self.rally_networks.append(network)
                self.rally_routers.append(router)
                self.router_ids.append(router["router"]['id'])
                self.rally_router_gw_ips.append(
                    router["router"]["external_gateway_info"]
                    ["external_fixed_ips"][0]["ip_address"])
                self.snat_namespaces.append(
                    vpn_utils.wait_for_namespace_creation(
                        "snat-", router, **kwargs))
                self.qrouter_namespaces.append(
                    vpn_utils.wait_for_namespace_creation(
                        "qrouter-", router, **kwargs))
                keypairs.append(vpn_utils.create_keypair(
                    self.nova_client, self.key_names[x],
                    self.key_file_paths[x]))

                kwargs.update({
                    "nics":
                        [{"net-id": self.rally_networks[x]["network"]["id"]}],
                        "sec_group_suffix": self.suffixes[x],
                        "server_suffix": self.suffixes[x]
                })
                server = vpn_utils.create_nova_vm(
                    self.nova_client, keypairs[x], **kwargs)
                self.server_private_ips.append(vpn_utils.get_server_ip(
                        self.nova_client, server.id, self.suffixes[x]))
                self.servers.append(server)
Пример #2
0
    def create_networks(self, **kwargs):
        """Create networks to test vpn connectivity"""

        for x in range(MAX_RESOURCES):
            if self.tenant_ids:
                router, network, subnet, cidr = vpn_utils.create_network(
                    self.neutron_client,
                    self.neutron_admin_client,
                    self.suffixes[x],
                    tenant_id=self.tenant_ids[x],
                    DVR_flag=kwargs["DVR_flag"],
                    ext_net_name=kwargs["ext-net"])
            else:
                router, network, subnet, cidr = vpn_utils.create_network(
                    self.neutron_client,
                    self.neutron_admin_client,
                    self.suffixes[x],
                    DVR_flag=kwargs["DVR_flag"],
                    ext_net_name=kwargs["ext-net"])
            with LOCK:
                self.rally_cidrs.append(cidr)
                self.rally_subnets.append(subnet)
                self.rally_networks.append(network)
                self.rally_routers.append(router)
                self.router_ids.append(router["router"]['id'])
                self.rally_router_gw_ips.append(
                    router["router"]["external_gateway_info"]
                    ["external_fixed_ips"][0]["ip_address"])

            if (kwargs["DVR_flag"]):
                ns, controller = vpn_utils.wait_for_namespace_creation(
                    "snat-", router["router"]['id'],
                    kwargs['controller_creds'], self.private_key_file,
                    kwargs['namespace_creation_timeout'])
            else:
                ns, controller = vpn_utils.wait_for_namespace_creation(
                    "qrouter-", router["router"]['id'],
                    kwargs['controller_creds'], self.private_key_file,
                    kwargs['namespace_creation_timeout'])
            with LOCK:
                self.ns_controller_tuples.append((ns, controller))
Пример #3
0
    def create_networks(self, **kwargs):
        """Create networks to test vpn connectivity"""

        for x in range(MAX_RESOURCES):
            if self.tenant_ids:
                router, network, subnet, cidr = vpn_utils.create_network(
                    self.neutron_client, self.neutron_admin_client,
                    self.suffixes[x], tenant_id=self.tenant_ids[x],
                    DVR_flag=kwargs["DVR_flag"],
                    ext_net_name=kwargs["ext-net"])
            else:
                router, network, subnet, cidr = vpn_utils.create_network(
                    self.neutron_client, self.neutron_admin_client,
                    self.suffixes[x], DVR_flag=kwargs["DVR_flag"],
                    ext_net_name=kwargs["ext-net"])
            with LOCK:
                self.rally_cidrs.append(cidr)
                self.rally_subnets.append(subnet)
                self.rally_networks.append(network)
                self.rally_routers.append(router)
                self.router_ids.append(router["router"]['id'])
                self.rally_router_gw_ips.append(
                    router["router"]["external_gateway_info"]
                    ["external_fixed_ips"][0]["ip_address"])

            if(kwargs["DVR_flag"]):
                ns, controller = vpn_utils.wait_for_namespace_creation(
                    "snat-", router["router"]['id'],
                    kwargs['controller_creds'],
                    self.private_key_file,
                    kwargs['namespace_creation_timeout'])
            else:
                ns, controller = vpn_utils.wait_for_namespace_creation(
                    "qrouter-", router["router"]['id'],
                    kwargs['controller_creds'],
                    self.private_key_file,
                    kwargs['namespace_creation_timeout'])
            with LOCK:
                self.ns_controller_tuples.append((ns, controller))