From 371685974781964b0d5339f8497c06c89b24ae20 Mon Sep 17 00:00:00 2001 From: George Paraskevopoulos Date: Mon, 20 Feb 2017 12:01:01 +0200 Subject: Add baseline topology Add a topology where everything (endpoints, vnfs) are booted on the same host. This is useful, as we'll have the simplest possible topology to compare against as a baseline Change-Id: I6248fbca0687286da49f6332e01571937b501090 Signed-off-by: George Paraskevopoulos --- sfc/lib/topology_shuffler.py | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'sfc') diff --git a/sfc/lib/topology_shuffler.py b/sfc/lib/topology_shuffler.py index 4524b879..79825fcf 100644 --- a/sfc/lib/topology_shuffler.py +++ b/sfc/lib/topology_shuffler.py @@ -8,6 +8,13 @@ logger = ft_logger.Logger(__name__).getLogger() # The possible topologies we are testing TOPOLOGIES = [ + { + 'id': 'CLIENT_SERVER_VNF_SAME_HOST', + 'description': ''' + All endpoints and VNFs are on a single host. + This is the baseline test. + ''' + }, { 'id': 'CLIENT_VNF_SAME_HOST', 'description': ''' @@ -26,7 +33,7 @@ TOPOLOGIES = [ 'id': 'SERVER_VNF_SAME_HOST', 'description': ''' Server instance and vnfs are are on the same - compute host. Server instance is on a different host + compute host. Client instance is on a different host ''' }, { @@ -110,7 +117,12 @@ def topology(vnf_names, av_zones=None, seed=None): 'id': topo['id'], 'description': topo['description'] } - if topo['id'] == 'CLIENT_VNF_SAME_HOST': + if topo['id'] == 'CLIENT_SERVER_VNF_SAME_HOST': + topology_assigment['client'] = av_zones[0] + topology_assigment['server'] = av_zones[0] + for vnf in vnf_names: + topology_assigment[vnf] = av_zones[0] + elif topo['id'] == 'CLIENT_VNF_SAME_HOST': topology_assigment['client'] = av_zones[0] topology_assigment['server'] = av_zones[1] for vnf in vnf_names: @@ -128,17 +140,13 @@ def topology(vnf_names, av_zones=None, seed=None): elif topo['id'] == 'CLIENT_SERVER_SAME_HOST_SPLIT_VNF': topology_assigment['client'] = av_zones[0] topology_assigment['server'] = av_zones[0] - idx = 0 - for vnf in vnf_names: + for idx, vnf in enumerate(vnf_names): topology_assigment[vnf] = av_zones[idx % 2] - idx += 1 elif topo['id'] == 'CLIENT_SERVER_DIFFERENT_HOST_SPLIT_VNF': topology_assigment['client'] = av_zones[0] topology_assigment['server'] = av_zones[1] - idx = 0 - for vnf in vnf_names: + for idx, vnf in enumerate(vnf_names): topology_assigment[vnf] = av_zones[idx % 2] - idx += 1 logger.info("Creating enpoint and VNF topology on the compute hosts") logger.info(topo['description']) return topology_assigment -- cgit 1.2.3-korg