aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/benchmark/scenarios/networking/vnf_generic.py
diff options
context:
space:
mode:
authorMaciej Skrocki <maciej.skrocki@intel.com>2017-08-18 15:43:21 -0700
committerRoss Brattain <ross.b.brattain@intel.com>2017-08-24 12:42:53 -0700
commit42e59b19264a8a31650d2a111b79d932accd8e4e (patch)
tree86b26608fefd5467bab75e9520a5037a768c03eb /yardstick/benchmark/scenarios/networking/vnf_generic.py
parent2a5189826106cee5bbbcc35df53abc4002c9d47f (diff)
Standardized TRex client library path
- path should be defined via TREX_CLIENT_LIB environmental variable e.g. TREX_CLIENT_LIB=/opt/trex_client/stl - refactored unit tests Change-Id: I18767e48daf774432c010f1b88d18a4f0ee4e156 Signed-off-by: Maciej Skrocki <maciej.skrocki@intel.com> Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
Diffstat (limited to 'yardstick/benchmark/scenarios/networking/vnf_generic.py')
-rw-r--r--yardstick/benchmark/scenarios/networking/vnf_generic.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/yardstick/benchmark/scenarios/networking/vnf_generic.py b/yardstick/benchmark/scenarios/networking/vnf_generic.py
index 18a75d070..aecc228bc 100644
--- a/yardstick/benchmark/scenarios/networking/vnf_generic.py
+++ b/yardstick/benchmark/scenarios/networking/vnf_generic.py
@@ -14,13 +14,13 @@
""" NSPerf specific scenario definition """
from __future__ import absolute_import
-import logging
+import logging
import errno
import ipaddress
import os
-
+import sys
import re
from itertools import chain
@@ -35,8 +35,10 @@ from yardstick.network_services.collector.subscriber import Collector
from yardstick.network_services.vnf_generic import vnfdgen
from yardstick.network_services.vnf_generic.vnf.base import GenericVNF
from yardstick.network_services.traffic_profile.base import TrafficProfile
+from yardstick.network_services.utils import get_nsb_option
from yardstick import ssh
+
LOG = logging.getLogger(__name__)
@@ -439,6 +441,9 @@ printf "%s/driver:" $1 ; basename $(readlink -s $1/device/driver); } \
:param context_cfg:
:return:
"""
+ trex_lib_path = get_nsb_option('trex_client_lib')
+ sys.path[:] = list(chain([trex_lib_path], (x for x in sys.path if x != trex_lib_path)))
+
if scenario_cfg is None:
scenario_cfg = self.scenario_cfg