Improve NetworkServiceTestCase._get_ip_flow_range() function 59/60059/5
authorRodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
Fri, 20 Jul 2018 15:40:29 +0000 (16:40 +0100)
committerRodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
Mon, 23 Jul 2018 08:03:53 +0000 (09:03 +0100)
commit70eef8dd6ef160d3782984742fbc7958a35c03c7
tree902cd6e88257a24a83e5b174bcf4005a541715cc
parent61d471c367ff61cbac080bd1708decf1b36ad167
Improve NetworkServiceTestCase._get_ip_flow_range() function

Improve the method to calculate the CIDR IP address range (first one,
last one). IPv4Network or IPv6Network hosts() is an iterator throught
the list of valid IPs. If the network is too big, the generation of a
list [1] can be very expensive.

[1]https://github.com/opnfv/yardstick/blob/master/yardstick/benchmark/scenarios/networking/vnf_generic.py#L90

JIRA: YARDSTICK-1339

Change-Id: I9352b2e7ff4925c246df8b40ecf43e8dc96c42d2
Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
yardstick/benchmark/scenarios/networking/vnf_generic.py
yardstick/tests/unit/benchmark/scenarios/networking/test_vnf_generic.py