Fix in trunk dynamic workloads

This patch introduces the following changes.
1. self.keypair assignment has been shifted from trunk.py to dynamic_workload.py.
This is because errors will occur if other trunk dynamic workloads are run
before pod_fip_simulation in an iteration if self.keypair assignment is left in
trunk.py.
2. self.ext_net_name assignment has been shifted from trunk.py to dynamic_workload.py
for the same reason as above.

Change-Id: If0a67276eb973b6c0abaef5781a3c0bba3bee434
This commit is contained in:
Sanjay Chari 2021-09-13 17:01:28 +05:30
parent c55511e40a
commit 999b7d2a06
2 changed files with 5 additions and 7 deletions

View File

@ -75,6 +75,11 @@ class DynamicWorkload(vm.VMDynamicScenario, trunk.TrunkDynamicScenario,
self.router = self._create_router(router_create_args)
self.log_info("router {} created for this iteration".format(self.router))
self.keypair = self.context["user"]["keypair"]
self.ext_net_name = self.clients("neutron").show_network(ext_net_id)["network"][
"name"]
if workloads == "all" or "create_delete_servers" in workloads_list:
self.boot_servers(smallest_image, smallest_flavor, num_create_vms,
subnet_create_args=subnet_create_args)

View File

@ -197,19 +197,12 @@ class TrunkDynamicScenario(
:param subport_count: int, number of subports to create per trunk
:param num_vms: int, number of servers to create
"""
self.ext_net_name = None
if ext_net_id:
self.ext_net_name = self.clients("neutron").show_network(ext_net_id)["network"][
"name"
]
network = self._create_network({})
subnet = self._create_subnet(network, {})
self._add_interface_router(subnet["subnet"], self.router["router"])
kwargs = {}
kwargs["nics"] = [{"net-id": network["network"]["id"]}]
self.keypair = self.context["user"]["keypair"]
jump_host = self._boot_server_with_fip_and_tag(jumphost_image, jumphost_flavor,
"jumphost_trunk", True,
self.ext_net_name,