From 02fac361b705f18be0cbaf1b281e8007f4331daa Mon Sep 17 00:00:00 2001 From: Serhiy Pshyk Date: Fri, 19 Oct 2018 09:46:05 +0100 Subject: Fix default IPv4 mask for IxNetwork traffic config IP mask is set depending on the IP range provided by the user in the traffic profile. In case of single IP in range, IPV4LENGTH value is used as mask should cover all address bits. JIRA: YARDSTICK-1478 Change-Id: I5ad40d1f3def52ebcda4400b708b71faf11e12ab Signed-off-by: Serhiy Pshyk --- yardstick/network_services/libs/ixia_libs/ixnet/ixnet_api.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/yardstick/network_services/libs/ixia_libs/ixnet/ixnet_api.py b/yardstick/network_services/libs/ixia_libs/ixnet/ixnet_api.py index cf625d483..4fbbf706d 100644 --- a/yardstick/network_services/libs/ixia_libs/ixnet/ixnet_api.py +++ b/yardstick/network_services/libs/ixia_libs/ixnet/ixnet_api.py @@ -41,9 +41,6 @@ C_VLAN = 1 ETHER_TYPE_802_1ad = '0x88a8' -IP_VERSION_4_MASK = 24 -IP_VERSION_6_MASK = 64 - TRAFFIC_STATUS_STARTED = 'started' TRAFFIC_STATUS_STOPPED = 'stopped' @@ -519,8 +516,10 @@ class IxNextgen(object): # pragma: no cover dstip = str(traffic_param['outer_l3']['dstip']) srcseed = traffic_param['outer_l3']['srcseed'] dstseed = traffic_param['outer_l3']['dstseed'] - srcmask = traffic_param['outer_l3']['srcmask'] or IP_VERSION_4_MASK - dstmask = traffic_param['outer_l3']['dstmask'] or IP_VERSION_4_MASK + srcmask = traffic_param['outer_l3']['srcmask'] \ + or ipaddress.IPV4LENGTH + dstmask = traffic_param['outer_l3']['dstmask'] \ + or ipaddress.IPV4LENGTH self._update_ipv4_address( self._get_stack_item(fg_id, PROTO_IPV4)[0], -- cgit 1.2.3-korg