aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/network_services/vnf_generic/vnf/tg_trex.py
diff options
context:
space:
mode:
authorMartin Banszel <martinx.banszel@intel.com>2017-07-19 19:35:02 +0000
committerRoss Brattain <ross.b.brattain@intel.com>2017-09-05 17:48:02 -0700
commitd3ee35dc0015e073b7138f3b02508b40fc6288b1 (patch)
treed5350f427a7ba6dcea8d36b00ae217d0074f0511 /yardstick/network_services/vnf_generic/vnf/tg_trex.py
parent79e811f096f8640189fc75862535f1f0cc4773c5 (diff)
Add fixes for heat deployed UDP_Replay and TRex
- Added a PROTOCOL_MAP to map the protocol names to codes -- the scapy requires the code, it fails if the proto is set e.g. to 'udp' - ip addresses must be str, not unicode -- explicit conversion to str added - removed unittest for setup_vnf_environment in test_tg_trex.py as it is the same function as already tested in test_sample_vnf.py - traffic_profile refactored -- code repetition decreased, unittest adapted Known issues: - there is a an attempt to stop already stopped trex. It fires an exception that stop command is issued on the disconnected client. Change-Id: I87e9029630f48b30e8f5b4f9d88ab3b25fd65f03 Signed-off-by: Martin Banszel <martinx.banszel@intel.com>
Diffstat (limited to 'yardstick/network_services/vnf_generic/vnf/tg_trex.py')
-rw-r--r--yardstick/network_services/vnf_generic/vnf/tg_trex.py19
1 files changed, 15 insertions, 4 deletions
diff --git a/yardstick/network_services/vnf_generic/vnf/tg_trex.py b/yardstick/network_services/vnf_generic/vnf/tg_trex.py
index 616b331ba..1fe790f08 100644
--- a/yardstick/network_services/vnf_generic/vnf/tg_trex.py
+++ b/yardstick/network_services/vnf_generic/vnf/tg_trex.py
@@ -25,10 +25,19 @@ from yardstick.common.utils import mac_address_to_hex_list
from yardstick.network_services.utils import get_nsb_option
from yardstick.network_services.vnf_generic.vnf.sample_vnf import SampleVNFTrafficGen
from yardstick.network_services.vnf_generic.vnf.sample_vnf import ClientResourceHelper
+from yardstick.network_services.vnf_generic.vnf.sample_vnf import DpdkVnfSetupEnvHelper
LOG = logging.getLogger(__name__)
+class TrexDpdkVnfSetupEnvHelper(DpdkVnfSetupEnvHelper):
+ APP_NAME = "t-rex-64"
+ CFG_CONFIG = ""
+ CFG_SCRIPT = ""
+ PIPELINE_COMMAND = ""
+ VNF_TYPE = "TG"
+
+
class TrexResourceHelper(ClientResourceHelper):
CONF_FILE = '/tmp/trex_cfg.yaml'
@@ -36,16 +45,14 @@ class TrexResourceHelper(ClientResourceHelper):
RESOURCE_WORD = 'trex'
RUN_DURATION = 0
- SYNC_PORT = 4500
- ASYNC_PORT = 4501
+ ASYNC_PORT = 4500
+ SYNC_PORT = 4501
def generate_cfg(self):
ext_intf = self.vnfd_helper.interfaces
vpci_list = []
port_list = []
trex_cfg = {
- 'port_limit': 0,
- 'version': '2',
'interfaces': vpci_list,
'port_info': port_list,
"port_limit": len(ext_intf),
@@ -79,6 +86,7 @@ class TrexResourceHelper(ClientResourceHelper):
DISABLE_DEPLOY = True
def setup(self):
+ super(TrexResourceHelper, self).setup()
if self.DISABLE_DEPLOY:
return
@@ -130,6 +138,9 @@ class TrexTrafficGen(SampleVNFTrafficGen):
if resource_helper_type is None:
resource_helper_type = TrexResourceHelper
+ if setup_env_helper_type is None:
+ setup_env_helper_type = TrexDpdkVnfSetupEnvHelper
+
super(TrexTrafficGen, self).__init__(name, vnfd, setup_env_helper_type,
resource_helper_type)