aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/network_services/libs/ixia_libs
diff options
context:
space:
mode:
authorRodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>2018-03-29 15:39:49 +0100
committerRodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>2018-05-04 06:59:08 +0000
commitf9961e6c12b9b50c490a7d70ae1474ca1bd09f5e (patch)
tree1ab29a5e6314b6d02e2ef4c0727677134e8f9bff /yardstick/network_services/libs/ixia_libs
parente985b356b75c9f4169ab8f1cd761cc3cfd13f6d1 (diff)
Add IxNetwork API Python Binding package
Add IxNetwork python package to the requirements list. This module is needed for the "NSPerf" scenarios using IXIA as traffic generator, when IxNetwork is the program used to handle the IXIA generator. The latest version of this module is 8.40.1124.9 [1]. The license type is MIT. [1] https://pypi.python.org/pypi/ixnetwork JIRA: YARDSTICK-1106 Change-Id: I279933c95994f5120930256a104c4192a0b9900d Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
Diffstat (limited to 'yardstick/network_services/libs/ixia_libs')
-rw-r--r--yardstick/network_services/libs/ixia_libs/IxNet/IxNet.py22
1 files changed, 6 insertions, 16 deletions
diff --git a/yardstick/network_services/libs/ixia_libs/IxNet/IxNet.py b/yardstick/network_services/libs/ixia_libs/IxNet/IxNet.py
index 70ce4ff03..c538ceeba 100644
--- a/yardstick/network_services/libs/ixia_libs/IxNet/IxNet.py
+++ b/yardstick/network_services/libs/ixia_libs/IxNet/IxNet.py
@@ -12,13 +12,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from __future__ import absolute_import
-from __future__ import print_function
-import sys
import logging
import re
from itertools import product
+import IxNetwork
+
log = logging.getLogger(__name__)
@@ -135,7 +134,6 @@ class IxNextgen(object):
port.append(port0)
cfg = {
- 'py_lib_path': tg_cfg["mgmt-interface"]["tg-config"]["py_lib_path"],
'machine': tg_cfg["mgmt-interface"]["ip"],
'port': tg_cfg["mgmt-interface"]["tg-config"]["tcl_port"],
'chassis': tg_cfg["mgmt-interface"]["tg-config"]["ixchassis"],
@@ -186,7 +184,7 @@ class IxNextgen(object):
self.set_random_ip_multi_attribute(ip, seeds[1], fixed_bits, random_mask, l3_count)
def add_ip_header(self, params, version):
- for it, ep, i in self.iter_over_get_lists('/traffic', 'trafficItem', "configElement", 1):
+ for _, ep, i in self.iter_over_get_lists('/traffic', 'trafficItem', "configElement", 1):
iter1 = (v['outer_l3'] for v in params.values() if str(v['id']) == str(i))
try:
l3 = next(iter1, {})
@@ -194,21 +192,13 @@ class IxNextgen(object):
except (KeyError, IndexError):
continue
- for ip, ip_bits, _ in self.iter_over_get_lists(ep, 'stack', 'field'):
+ for _, ip_bits, _ in self.iter_over_get_lists(ep, 'stack', 'field'):
self.set_random_ip_multi_attributes(ip_bits, version, seeds, l3)
self.ixnet.commit()
def _connect(self, tg_cfg):
self._cfg = self.get_config(tg_cfg)
-
- sys.path.append(self._cfg["py_lib_path"])
- # Import IxNetwork after getting ixia lib path
- try:
- import IxNetwork
- except ImportError:
- raise
-
self.ixnet = IxNetwork.IxNet()
machine = self._cfg['machine']
@@ -292,7 +282,7 @@ class IxNextgen(object):
self.update_ether_multi_attribute(ether, str(l2.get('srcmac', "00:00:00:00:00:01")))
def ix_update_ether(self, params):
- for ti, ep, index in self.iter_over_get_lists('/traffic', 'trafficItem',
+ for _, ep, index in self.iter_over_get_lists('/traffic', 'trafficItem',
"configElement", 1):
iter1 = (v['outer_l2'] for v in params.values() if str(v['id']) == str(index))
try:
@@ -300,7 +290,7 @@ class IxNextgen(object):
except KeyError:
continue
- for ip, ether, _ in self.iter_over_get_lists(ep, 'stack', 'field'):
+ for _, ether, _ in self.iter_over_get_lists(ep, 'stack', 'field'):
self.update_ether_multi_attributes(ether, l2)
self.ixnet.commit()