diff options
author | Martin Banszel <martinx.banszel@intel.com> | 2017-07-19 19:35:02 +0000 |
---|---|---|
committer | Ross Brattain <ross.b.brattain@intel.com> | 2017-09-18 01:28:28 -0700 |
commit | 86083c8023f40d368f6339d2ab68d49c9ac8b8ee (patch) | |
tree | 0ca209f5bf0f00e36e856ffecd21184921265077 /yardstick/benchmark/contexts/heat.py | |
parent | 38eb33a092e903b9854267d3e36496c919517103 (diff) |
NSB: fix port topology
Add a new PortPair class to resolve the
topology into list of public and private ports.
Before we were calculating public/private in multiple
locations and using different conventions.
In addition for all the DPDK test we need to use the DPDK
port number and no rely on interface ordering or interface naming
conventions.
We used to use xe0 -> 0, xe1 -> 1, etc. This is not the DPDK port
number.
Use the new dpdknicbind_helper class to parse the output of
dpdk-devbind.py to find the actual DPDK port number at runtime.
We then use this DPDK port number to correctly calculate the
port_mask_hex.
The port mask maps the DPDK port num (PMD ID) to the LINK ID
used in the pipeline config
We also need to make sure we only use the interfaces matched to the
topology and not use all the interfaces, because in some cases we will
have unused interfaces. In particular TRex always requires an even
number of interfaces, so for single port TRex tests we have to create
the second port and not use it.
Thus we had to modify the traffic generator stats code to only dump
stats for used ports and no unused ports.
Ixia was using interface ordering to map to Ixia ports, instead we use
the dpdk_port_num which must be hardcoded for Ixia.
Renamed traffic_profile.execute to traffic_profile.execute_traffic so
we can trace the code easier.
We pass the port used by the traffic profile to generate_samples so we
don't get stats for unused ports.
Fixed up vPE config creation and bring up issues.
Fixed up CGNAPT and UDP_Replay to work correctly.
Tested with 4-port scale-out
Change-Id: I2e4f328bff2904108081e92a4bf712333fa73869
Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Edward MacGillivray <edward.s.macgillivray@intel.com>
Diffstat (limited to 'yardstick/benchmark/contexts/heat.py')
-rw-r--r-- | yardstick/benchmark/contexts/heat.py | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/yardstick/benchmark/contexts/heat.py b/yardstick/benchmark/contexts/heat.py index d2309cc10..c7586abf4 100644 --- a/yardstick/benchmark/contexts/heat.py +++ b/yardstick/benchmark/contexts/heat.py @@ -83,9 +83,14 @@ class HeatContext(Context): external_network = os.environ.get("EXTERNAL_NETWORK", "net04_ext") have_external_network = any(net.get("external_network") for net in networks.values()) - if sorted_networks and not have_external_network: - # no external net defined, assign it to first network using os.environ - sorted_networks[0][1]["external_network"] = external_network + if not have_external_network: + # try looking for mgmt network first + try: + networks['mgmt']["external_network"] = external_network + except KeyError: + if sorted_networks: + # otherwise assign it to first network using os.environ + sorted_networks[0][1]["external_network"] = external_network return sorted_networks @@ -328,16 +333,21 @@ class HeatContext(Context): LOG.info("Deploying context '%s' DONE", self.name) def add_server_port(self, server): - # TODO(hafe) can only handle one internal network for now - # use private ip from first port - private_port = next(iter(server.ports.values())) + # use private ip from first port in first network + try: + private_port = next(iter(server.ports.values()))[0] + except IndexError: + LOG.exception("Unable to find first private port in %s", server.ports) + raise server.private_ip = self.stack.outputs[private_port["stack_name"]] server.interfaces = {} - for network_name, port in server.ports.items(): - # port['port'] is either port name from mapping or default network_name - server.interfaces[port['port']] = self.make_interface_dict(network_name, port['port'], - port['stack_name'], - self.stack.outputs) + for network_name, ports in server.ports.items(): + for port in ports: + # port['port'] is either port name from mapping or default network_name + server.interfaces[port['port']] = self.make_interface_dict(network_name, + port['port'], + port['stack_name'], + self.stack.outputs) def make_interface_dict(self, network_name, port, stack_name, outputs): private_ip = outputs[stack_name] |