aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/benchmark/contexts/model.py
diff options
context:
space:
mode:
authorRoss Brattain <ross.b.brattain@intel.com>2017-09-08 11:34:48 -0700
committerRoss Brattain <ross.b.brattain@intel.com>2017-09-13 18:36:38 -0700
commit8ba961d5cded6a0993ef00e8f9b5e0a7cd32d216 (patch)
tree628282b15759770782534e5613994cb89b548253 /yardstick/benchmark/contexts/model.py
parent53a55a8e95ad31ef6af0978e871092ddeb2dc597 (diff)
Heat: support non-mesh network toplogy
Previsouly we added all servers to every network in Heat in a full mesh. To more closely replicate test topology and to limit then number of ports we need to all each server to specify which ports should be connected to each network. This should also allow for some kind of multiport setup. Add optional network_ports dict to each server with network to port_list mapping match inteface based on port name or vld_id replace vld_id matching with network name matching, since network_name == vld_id Change-Id: I5de46b8f673949e3c17d8df6fa96f055c43886ce Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
Diffstat (limited to 'yardstick/benchmark/contexts/model.py')
-rw-r--r--yardstick/benchmark/contexts/model.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/yardstick/benchmark/contexts/model.py b/yardstick/benchmark/contexts/model.py
index 0b8197ce9..da2b74e1c 100644
--- a/yardstick/benchmark/contexts/model.py
+++ b/yardstick/benchmark/contexts/model.py
@@ -208,6 +208,7 @@ class Server(Object): # pragma: no cover
self.instances = attrs["instances"]
# dict with key network name, each item is a dict with port name and ip
+ self.network_ports = attrs.get("network_ports", {})
self.ports = {}
self.floating_ip = None
@@ -253,8 +254,18 @@ class Server(Object): # pragma: no cover
"""adds to the template one server and corresponding resources"""
port_name_list = []
for network in networks:
- port_name = server_name + "-" + network.name + "-port"
- self.ports[network.name] = {"stack_name": port_name}
+ # if explicit mapping skip unused networks
+ if self.network_ports:
+ try:
+ port = self.network_ports[network.name]
+ except KeyError:
+ # no port for this network
+ continue
+ # otherwise add a port for every network with port name as network name
+ else:
+ port = network.name
+ port_name = "{0}-{1}-port".format(server_name, port)
+ self.ports[network.name] = {"stack_name": port_name, "port": port}
# we can't use secgroups if port_security_enabled is False
if network.port_security_enabled is False:
sec_group_id = None