test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH V2] framework/tester.py for next branch: add TREX support in DTS framework
@ 2017-12-20 11:35 wang fei
  2018-01-09  5:53 ` Liu, Yong
  0 siblings, 1 reply; 2+ messages in thread
From: wang fei @ 2017-12-20 11:35 UTC (permalink / raw)
  To: dts; +Cc: wang fei

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

diff --git a/framework/tester.py b/framework/tester.py
index 1c854d7..d09305c 100644
--- a/framework/tester.py
+++ b/framework/tester.py
@@ -45,8 +45,9 @@ import random
 from utils import GREEN, convert_int2ip, convert_ip2int
 from exception import ParameterInvalidException
 from multiprocessing import Process
+from uuid import uuid4
 
-
+from pktgen import getPacketGenerator
 class Tester(Crb):
 
     """
@@ -79,6 +80,21 @@ class Tester(Crb):
             self.ixia_packet_gen = IxiaPacketGenerator(self)
         self.packet_gen = SoftwarePacketGenerator(self)
 
     def set_re_run(self, re_run_time):
         """
         set failed case re-run time
@@ -139,6 +155,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 +396,14 @@ class Tester(Crb):
                                     'mac': macaddr,
                                     'ipv6': ipv6})
 
+    def pktgen_init(self):
+        # should load pktgen type from configuration, now just try
+        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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dts] [PATCH V2] framework/tester.py for next branch: add TREX support in DTS framework
  2017-12-20 11:35 [dts] [PATCH V2] framework/tester.py for next branch: add TREX support in DTS framework wang fei
@ 2018-01-09  5:53 ` Liu, Yong
  0 siblings, 0 replies; 2+ messages in thread
From: Liu, Yong @ 2018-01-09  5:53 UTC (permalink / raw)
  To: Wang, FeiX Y, dts; +Cc: Wang, FeiX Y

Fei,
One comment below.

> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of wang fei
> Sent: Wednesday, December 20, 2017 7:35 PM
> To: dts@dpdk.org
> Cc: Wang, FeiX Y <feix.y.wang@intel.com>
> Subject: [dts] [PATCH V2] framework/tester.py for next branch: add TREX
> support in DTS framework
> 
> Signed-off-by: wang fei <feix.y.wang@intel.com>
> ---
>  framework/tester.py | 27 ++++++++++++++++++++++++++-
>  1 file changed, 26 insertions(+), 1 deletion(-)
> 
> diff --git a/framework/tester.py b/framework/tester.py
> index 1c854d7..d09305c 100644
> --- a/framework/tester.py
> +++ b/framework/tester.py
> @@ -45,8 +45,9 @@ import random
>  from utils import GREEN, convert_int2ip, convert_ip2int
>  from exception import ParameterInvalidException
>  from multiprocessing import Process
> +from uuid import uuid4
> 
> -
> +from pktgen import getPacketGenerator
>  class Tester(Crb):
> 
>      """
> @@ -79,6 +80,21 @@ class Tester(Crb):
>              self.ixia_packet_gen = IxiaPacketGenerator(self)
>          self.packet_gen = SoftwarePacketGenerator(self)
> 
>      def set_re_run(self, re_run_time):
>          """
>          set failed case re-run time
> @@ -139,6 +155,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 +396,14 @@ class Tester(Crb):
>                                      'mac': macaddr,
>                                      'ipv6': ipv6})
> 
> +    def pktgen_init(self):
> +        # should load pktgen type from configuration, now just try
> +        pktgen_type = "TREX"

Packet generator type should loaded from configuration file, not hardcoded here.

> +        # 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-01-09  5:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-20 11:35 [dts] [PATCH V2] framework/tester.py for next branch: add TREX support in DTS framework wang fei
2018-01-09  5:53 ` Liu, Yong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).