From f752b4d463764d23d68aaa192df1019ac7c5c19e Mon Sep 17 00:00:00 2001 From: venkata anil Date: Thu, 19 Sep 2019 00:23:43 +0530 Subject: [PATCH] use floatingip for ping netcreate_nova_boot_fip_ping was never using floatingip to ping as we always call boot_server_with_fip(use_floating_ip=None) Neutron policy doenst allow users to create router with external_gateway_info. So we use admin client but still create router using user tenant id. Change-Id: I03895c835f5e05daed95bc15f1d6e05acd1c0110 --- .../netcreate-boot/netcreate_nova_boot_fip_ping.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/rally/rally-plugins/netcreate-boot/netcreate_nova_boot_fip_ping.py b/rally/rally-plugins/netcreate-boot/netcreate_nova_boot_fip_ping.py index 58edfb73e..8cf6b1a00 100644 --- a/rally/rally-plugins/netcreate-boot/netcreate_nova_boot_fip_ping.py +++ b/rally/rally-plugins/netcreate-boot/netcreate_nova_boot_fip_ping.py @@ -31,7 +31,12 @@ class CreateNetworkNovaBootPing(vm_utils.VMScenario, def run(self, image, flavor, ext_net_id, router_create_args=None, network_create_args=None, subnet_create_args=None, **kwargs): + ext_net_name = None + if ext_net_id: + ext_net_name = self.clients("neutron").show_network( + ext_net_id)["network"]["name"] router_create_args["name"] = self.generate_random_name() + router_create_args["tenant_id"] = self.context["tenant"]["id"] router_create_args.setdefault("external_gateway_info", {"network_id": ext_net_id, "enable_snat": True}) router = self._create_router(router_create_args) @@ -40,8 +45,8 @@ class CreateNetworkNovaBootPing(vm_utils.VMScenario, subnet = self._create_subnet(network, subnet_create_args or {}) self._add_interface_router(subnet['subnet'], router['router']) kwargs["nics"] = [{'net-id': network['network']['id']}] - guest = self._boot_server_with_fip(image, flavor, True, None, **kwargs) - + guest = self._boot_server_with_fip(image, flavor, True, + ext_net_name, **kwargs) self._wait_for_ping(guest[1]['ip']) @atomic.action_timer("neutron.create_router") @@ -51,4 +56,4 @@ class CreateNetworkNovaBootPing(vm_utils.VMScenario, :param router_create_args: POST /v2.0/routers request options :returns: neutron router dict """ - return self.clients("neutron").create_router({"router": router_create_args}) + return self.admin_clients("neutron").create_router({"router": router_create_args})