aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/orchestrator/heat.py
diff options
context:
space:
mode:
authorJingLu5 <lvjing5@huawei.com>2017-07-03 10:34:53 +0000
committerJing Lu <lvjing5@huawei.com>2017-07-04 09:39:24 +0000
commitffe83c920736716f0caea36dceeff7b7e910db7c (patch)
tree5270c2488280199d9a527106e511f097cd8d0f9a /yardstick/orchestrator/heat.py
parent8e2da9dd467f0e0a28bb92097d80d707d579bd4f (diff)
support segmentation_id for vlan provider network
If a network specified in the test case is a vlan provider network, new attribute "segmentation_id" can be used to specify the desired vlan tag in the test case network section: networks: test-net: cidr: '192.168.1.0/24' provider: "vlan" physical_network: 'physnet1' segmentation_id: "1000" If the "segmentation_id" attribute is absent, a random vlan tag will be allocated to the network. Change-Id: Ic53852447a3c1bd8feb9ebd42d35f1ade3684be1 Signed-off-by: JingLu5 <lvjing5@huawei.com>
Diffstat (limited to 'yardstick/orchestrator/heat.py')
-rw-r--r--yardstick/orchestrator/heat.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/yardstick/orchestrator/heat.py b/yardstick/orchestrator/heat.py
index a99d4631d..fd6c4f6ff 100644
--- a/yardstick/orchestrator/heat.py
+++ b/yardstick/orchestrator/heat.py
@@ -1,4 +1,4 @@
-##############################################################################
+#############################################################################
# Copyright (c) 2015-2017 Ericsson AB and others.
#
# All rights reserved. This program and the accompanying materials
@@ -230,7 +230,8 @@ name (i.e. %s).\
'value': {'get_resource': name}
}
- def add_network(self, name, physical_network='physnet1', provider=None):
+ def add_network(self, name, physical_network='physnet1', provider=None,
+ segmentation_id=None):
"""add to the template a Neutron Net"""
log.debug("adding Neutron::Net '%s'", name)
if provider is None:
@@ -247,6 +248,9 @@ name (i.e. %s).\
'physical_network': physical_network
}
}
+ if segmentation_id:
+ seg_id_dit = {'segmentation_id': segmentation_id}
+ self.resources[name]["properties"].update(seg_id_dit)
def add_server_group(self, name, policies): # pragma: no cover
"""add to the template a ServerGroup"""