aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/benchmark/scenarios/networking/vnf_generic.py
diff options
context:
space:
mode:
Diffstat (limited to 'yardstick/benchmark/scenarios/networking/vnf_generic.py')
-rw-r--r--yardstick/benchmark/scenarios/networking/vnf_generic.py18
1 files changed, 13 insertions, 5 deletions
diff --git a/yardstick/benchmark/scenarios/networking/vnf_generic.py b/yardstick/benchmark/scenarios/networking/vnf_generic.py
index 450f83f6a..3f61116bc 100644
--- a/yardstick/benchmark/scenarios/networking/vnf_generic.py
+++ b/yardstick/benchmark/scenarios/networking/vnf_generic.py
@@ -140,8 +140,15 @@ class NetworkServiceTestCase(base.Scenario):
def _get_ip_flow_range(self, ip_start_range):
+ # IP range is specified as 'x.x.x.x-y.y.y.y'
+ if isinstance(ip_start_range, six.string_types):
+ return ip_start_range
+
node_name, range_or_interface = next(iter(ip_start_range.items()), (None, '0.0.0.0'))
- if node_name is not None:
+ if node_name is None:
+ # we are manually specifying the range
+ ip_addr_range = range_or_interface
+ else:
node = self.context_cfg["nodes"].get(node_name, {})
try:
# the ip_range is the interface name
@@ -163,9 +170,6 @@ class NetworkServiceTestCase(base.Scenario):
LOG.warning("Only single IP in range %s", ipaddr)
# fall back to single IP range
ip_addr_range = ip
- else:
- # we are manually specifying the range
- ip_addr_range = range_or_interface
return ip_addr_range
def _get_traffic_flow(self):
@@ -542,7 +546,11 @@ printf "%s/driver:" $1 ; basename $(readlink -s $1/device/driver); } \
# we assume OrderedDict for consistenct in instantiation
for node_name, node in context_cfg["nodes"].items():
LOG.debug(node)
- file_name = node["VNF model"]
+ try:
+ file_name = node["VNF model"]
+ except KeyError:
+ LOG.debug("no model for %s, skipping", node_name)
+ continue
file_path = scenario_cfg['task_path']
with open_relative_file(file_name, file_path) as stream:
vnf_model = stream.read()