aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/benchmark/scenarios/networking
diff options
context:
space:
mode:
authorRoss Brattain <ross.b.brattain@intel.com>2017-08-23 15:27:01 -0700
committerRoss Brattain <ross.b.brattain@intel.com>2017-08-30 15:54:44 -0700
commit51345464ec0385393569cb68bcaaf9bd6d921e9f (patch)
tree78a94b735c84f43783beb4983cc30c7c3aa80c0e /yardstick/benchmark/scenarios/networking
parente9d991a22270cd78485dcc6c8f3ddbf70a62286b (diff)
_get_ip_flow_range: fix bug with single IP ranges
If we have a /32 or for some reason find a range of IPs to use, we can default to the single IP specified on the interface. Change-Id: Ieaa1d57b04e1d57e8cef344d5a53bbca05e7887f Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
Diffstat (limited to 'yardstick/benchmark/scenarios/networking')
-rw-r--r--yardstick/benchmark/scenarios/networking/vnf_generic.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/yardstick/benchmark/scenarios/networking/vnf_generic.py b/yardstick/benchmark/scenarios/networking/vnf_generic.py
index 4510bcfba..7ae6f08c2 100644
--- a/yardstick/benchmark/scenarios/networking/vnf_generic.py
+++ b/yardstick/benchmark/scenarios/networking/vnf_generic.py
@@ -150,7 +150,13 @@ class NetworkServiceTestCase(base.Scenario):
ipaddr = ipaddress.ip_network(six.text_type('{}/{}'.format(ip, mask)), strict=False)
hosts = list(ipaddr.hosts())
- ip_addr_range = "{}-{}".format(hosts[0], hosts[-1])
+ if len(hosts) > 2:
+ # skip the first host in case of gateway
+ ip_addr_range = "{}-{}".format(hosts[1], hosts[-1])
+ else:
+ 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