test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [patch v4] enable ixia send_number_packet function
@ 2017-09-30 11:20 wang fei
  2017-09-30 17:58 ` Liu, Yong
  0 siblings, 1 reply; 2+ messages in thread
From: wang fei @ 2017-09-30 11:20 UTC (permalink / raw)
  To: dts; +Cc: wang fei

framework/etgen.py: add a function to enable ixia to send designatednumber of packets,
                    this function is set for test suite nic_single_core_perf test

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

diff --git a/framework/etgen.py b/framework/etgen.py
index b3a5931..b19ae84 100644
--- a/framework/etgen.py
+++ b/framework/etgen.py
@@ -868,3 +868,46 @@ class IxiaPacketGenerator(SSHConnection):
         retrieved capture buffer. Call packetGroupStats get before.
         """
         return self._packetgroup_cget_value('averageLatency')
+
+    def _transmission_pre_config(self, port_list, rate_percent, latency=False):
+        """
+        Prepare and configure IXIA ports for performance test. And remove the transmission step in this config sequence.
+        This function is set only for function send_number_packets for nic_single_core_perf test case use
+        """
+        rxPortlist, txPortlist = self.prepare_port_list(port_list, rate_percent, latency)
+        self.prepare_ixia_for_transmission(txPortlist, rxPortlist)
+        self.start_transmission()
+        self.clear_tcl_commands()
+        return rxPortlist, txPortlist
+
+    def send_number_packets(self, portList, ratePercent, packetNum):
+        """
+        Configure ixia to send fixed number of packets
+        Note that this function is only set for test_suite nic_single_core_perf,
+        Not for common use
+        """
+        rxPortlist, txPortlist = self._transmission_pre_config(portList, ratePercent)
+
+        self.send_expect("stream config -numFrames %s" % packetNum, "%", 5)
+        self.send_expect("stream config -dma stopStream", "%", 5)
+        for txPort in txPortlist:
+            port = self.pci_to_port(self.tester.get_pci(txPort))
+            self.send_expect("stream set %d %d %d 1" % (self.chasId, port['card'], port['port']), "%", 5)
+
+        self.send_expect("ixWritePortsToHardware portList", "%", 5)
+        self.send_expect("ixClearStats portList", "%", 5)
+        self.send_expect("ixStartTransmit portList", "%", 5)
+        time.sleep(10)
+
+        rxPackets = 0
+        for port in txPortlist:
+            self.stat_get_stat_all_stats(port)
+            txPackets = self.get_frames_sent()
+            while txPackets != packetNum:
+                time.sleep(10)
+                self.stat_get_stat_all_stats(port)
+                txPackets = self.get_frames_sent()
+            rxPackets += self.get_frames_received()
+        self.logger.info("Received packets :%s" % rxPackets)
+
+        return rxPackets
-- 
2.7.4

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

* Re: [dts] [patch v4] enable ixia send_number_packet function
  2017-09-30 11:20 [dts] [patch v4] enable ixia send_number_packet function wang fei
@ 2017-09-30 17:58 ` Liu, Yong
  0 siblings, 0 replies; 2+ messages in thread
From: Liu, Yong @ 2017-09-30 17:58 UTC (permalink / raw)
  To: wang fei, dts

Thanks Fei, applied.

On 09/30/2017 07:20 PM, wang fei wrote:
> framework/etgen.py: add a function to enable ixia to send designatednumber of packets,
>                      this function is set for test suite nic_single_core_perf test
>
> Signed-off-by: wang fei<feix.y.wang@intel.com>

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

end of thread, other threads:[~2017-09-30  9:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-30 11:20 [dts] [patch v4] enable ixia send_number_packet function wang fei
2017-09-30 17:58 ` 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).