From 33918409da9a5d4b60d57cd05f3277c6ff1918cd Mon Sep 17 00:00:00 2001 From: opensource-tnbt Date: Mon, 23 Nov 2020 12:32:36 +0530 Subject: [PATCH] Tools: User Latest Version of T-Rex. This patch upgrades the version of T-Rex to the latest one. V2.86. This patch is tested on Node-4 and Node-5, Intel Pod12. Scapy all.py modification is not required for new version. Signed-off-by: Sridhar K. N. Rao Change-Id: I928cd3a92e59a90797ae8510a57f96487811f618 --- conf/03_traffic.conf | 2 +- src/package-list.mk | 2 +- src/trex/Makefile | 4 ++-- tools/pkt_gen/trex/{trex.py => trex_client.py} | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) rename tools/pkt_gen/trex/{trex.py => trex_client.py} (99%) diff --git a/conf/03_traffic.conf b/conf/03_traffic.conf index d79b0b19..01747a38 100644 --- a/conf/03_traffic.conf +++ b/conf/03_traffic.conf @@ -579,7 +579,7 @@ PATHS['trafficgen'] = { 'Trex': { 'type' : 'src', 'src': { - 'path': os.path.join(ROOT_DIR, 'src/trex/trex/scripts/automation/trex_control_plane/stl') + 'path': os.path.join(ROOT_DIR, 'src/trex/trex/scripts/automation/trex_control_plane/interactive') } } } diff --git a/src/package-list.mk b/src/package-list.mk index 11f876da..1e40a60d 100644 --- a/src/package-list.mk +++ b/src/package-list.mk @@ -29,4 +29,4 @@ QEMU_TAG ?= v3.1.1 # TREX section TREX_URL ?= https://github.com/cisco-system-traffic-generator/trex-core.git -TREX_TAG ?= v2.38 +TREX_TAG ?= v2.86 diff --git a/src/trex/Makefile b/src/trex/Makefile index 9a0704af..fd5c47bb 100644 --- a/src/trex/Makefile +++ b/src/trex/Makefile @@ -29,8 +29,8 @@ all: force_pull force_pull: $(TAG_DONE_FLAG) $(AT)cd $(WORK_DIR) && git pull $(TREX_URL) $(TREX_TAG) @echo "git pull done" - $(AT)wget https://raw.githubusercontent.com/phaethon/scapy/v0.18/scapy/layers/all.py -O $(WORK_DIR)/scripts/external_libs/scapy-2.3.1/python3/scapy/layers/all.py - @echo "orignal SCAPY 2.3.1 layers/all.py was restored" +# $(AT)wget https://raw.githubusercontent.com/phaethon/scapy/v0.18/scapy/layers/all.py -O $(WORK_DIR)/scripts/external_libs/scapy-2.3.1/python3/scapy/layers/all.py +# @echo "orignal SCAPY 2.3.1 layers/all.py was restored" $(WORK_DIR): $(AT)git clone $(TREX_URL) $(WORK_DIR) diff --git a/tools/pkt_gen/trex/trex.py b/tools/pkt_gen/trex/trex_client.py similarity index 99% rename from tools/pkt_gen/trex/trex.py rename to tools/pkt_gen/trex/trex_client.py index e2bc1e9a..3d6836d8 100644 --- a/tools/pkt_gen/trex/trex.py +++ b/tools/pkt_gen/trex/trex_client.py @@ -26,7 +26,7 @@ import re from collections import OrderedDict # pylint: disable=unused-import import netaddr -import zmq +#import zmq from conf import settings from conf import merge_spec from core.results.results_constants import ResultsConstants @@ -35,7 +35,7 @@ try: # pylint: disable=wrong-import-position, import-error sys.path.append(settings.getValue('PATHS')['trafficgen']['Trex']['src']['path']) from trex_stl_lib.api import * - from trex_stl_lib import trex_stl_exceptions + # from trex_stl_lib import trex_stl_exceptions except ImportError: # VSPERF performs detection of T-Rex api during testcase initialization. So if # T-Rex is requsted and API is not available it will fail before this code @@ -160,7 +160,7 @@ class Trex(ITrafficGenerator): try: self._stlclient = STLClient(username=self._trex_user, server=self._trex_host_ip_addr, - verbose_level=0) + verbose_level='info') self._stlclient.connect() except STLError: raise RuntimeError('T-Rex: Cannot connect to T-Rex server. Please check if it is ' -- 2.16.6