[dts] [PATCH V3] add TREX support in DTS framework

wang fei feix.y.wang at intel.com
Wed Jan 10 05:53:26 CET 2018


For next branch framework/tester.py: enabling trex for DTS and 
implement througput function for performace test.

Signed-off-by: wang fei <feix.y.wang at intel.com>
---
 framework/tester.py | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/framework/tester.py b/framework/tester.py
index 1c854d7..1c382b2 100644
--- a/framework/tester.py
+++ b/framework/tester.py
@@ -46,7 +46,7 @@ from utils import GREEN, convert_int2ip, convert_ip2int
 from exception import ParameterInvalidException
 from multiprocessing import Process
 
-
+from pktgen import getPacketGenerator, PktgenConf
 class Tester(Crb):
 
     """
@@ -139,6 +139,7 @@ class Tester(Crb):
         self.pci_devices_information()
         self.restore_interfaces()
         self.scan_ports()
+        self.pktgen_init()
 
     def get_local_port(self, remotePort):
         """
@@ -379,6 +380,16 @@ class Tester(Crb):
                                     'mac': macaddr,
                                     'ipv6': ipv6})
 
+    def pktgen_init(self):
+        pktgen = PktgenConf()
+        pktgen_inst_type = pktgen.pktgen_conf.get_sections()
+        if len(pktgen_inst_type) == 1 and pktgen_inst_type[0] == "TREX":
+            pktgen_type = "TREX"
+            # init packet generator instance
+            self.pktgen = getPacketGenerator(self, pktgen_type)
+            # prepare running environment
+            self.pktgen.prepare_generator()
+
     def send_ping(self, localPort, ipv4, mac):
         """
         Send ping6 packet from local port with destination ipv4 address.
-- 
2.7.4



More information about the dts mailing list