From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id DD074A00E6 for ; Tue, 11 Jun 2019 04:37:09 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D45601C224; Tue, 11 Jun 2019 04:37:09 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 77D841C12B for ; Tue, 11 Jun 2019 04:37:07 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Jun 2019 19:37:06 -0700 X-ExtLoop1: 1 Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga002.jf.intel.com with ESMTP; 10 Jun 2019 19:37:06 -0700 Received: from fmsmsx123.amr.corp.intel.com (10.18.125.38) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 10 Jun 2019 19:37:05 -0700 Received: from shsmsx106.ccr.corp.intel.com (10.239.4.159) by fmsmsx123.amr.corp.intel.com (10.18.125.38) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 10 Jun 2019 19:37:05 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.134]) by SHSMSX106.ccr.corp.intel.com ([169.254.10.113]) with mapi id 14.03.0415.000; Tue, 11 Jun 2019 10:37:03 +0800 From: "Yao, BingX Y" To: "Zhu, ShuaiX" , "dts@dpdk.org" CC: "Zhu, ShuaiX" Thread-Topic: [dts] [PATCH V2] tests/tso:Optimize the verification result. Thread-Index: AQHVH/5hmBNU6vEVZUyHlVVS5K/PvaaVvQOA Date: Tue, 11 Jun 2019 02:37:03 +0000 Message-ID: <95BCD24840F32441BEA74E0F8A31839E04F3DACE@shsmsx102.ccr.corp.intel.com> References: <1560220791-154580-1-git-send-email-shuaix.zhu@intel.com> In-Reply-To: <1560220791-154580-1-git-send-email-shuaix.zhu@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dts] [PATCH V2] tests/tso:Optimize the verification result. X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org Sender: "dts" Tested-by: Yao, BingX Y -----Original Message----- From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of zhu,shuai Sent: Tuesday, June 11, 2019 10:40 AM To: dts@dpdk.org Cc: Zhu, ShuaiX Subject: [dts] [PATCH V2] tests/tso:Optimize the verification result. Signed-off-by: zhu,shuai --- tests/TestSuite_tso.py | 209 ++++++++++++++++++++++++++++------------- 1 file changed, 143 insertions(+), 66 deletions(-) diff --git a/tests/TestSuite_tso.py b/tests/TestSuite_tso.py index 5e0dbd5.= .645e24b 100644 --- a/tests/TestSuite_tso.py +++ b/tests/TestSuite_tso.py @@ -36,13 +36,15 @@ DPDK Test suite. Tests for TSO. =20 """ - +import os import utils import time import re from test_case import TestCase from settings import HEADER_SIZE =20 +DEFAULT_MUT =3D 1500 +TSO_MTU =3D 9000 =20 class TestTSO(TestCase): dut_ports =3D [] @@ -62,7 +64,7 @@ class TestTSO(TestCase): self.portMask =3D utils.create_mask([self.dut_ports[0], self.dut_p= orts[1]]) self.ports_socket =3D self.dut.get_numa_id(self.dut_ports[0]) =20 - self.frame_sizes =3D [128, 1458] + self.loading_sizes =3D [128, 800, 801, 1700, 2500] self.rxfreet_values =3D [0, 8, 16, 32, 64, 128] =20 self.test_cycles =3D [{'cores': '1S/1C/2T', 'Mpps': {}, 'pct': {}}= ] @@ -76,6 +78,7 @@ class TestTSO(TestCase): =20 self.headers_size =3D HEADER_SIZE['eth'] + HEADER_SIZE[ 'ip'] + HEADER_SIZE['tcp'] + self.tester.send_expect("ifconfig %s mtu %s" %=20 + (self.tester.get_interface(self.tester.get_local_port(self.dut_ports[0 + ])), TSO_MTU), "# ") =20 def set_up(self): """ @@ -83,6 +86,16 @@ class TestTSO(TestCase): """ pass =20 + def load_module(self): + """ + Load vxlan or nvgre module to scapy. + """ + cwd =3D os.getcwd() + dir_module =3D cwd + r'/' + 'dep' + self.tester.scapy_append('sys.path.append("%s")' % dir_module) + self.tester.scapy_append("from vxlan import Vxlan") + self.tester.scapy_append('from nvgre import NVGRE') + def tcpdump_start_sniffing(self, ifaces=3D[]): """ Starts tcpdump in the background to sniff the tester interface whe= re @@ -93,7 +106,8 @@ class TestTSO(TestCase): =20 for iface in ifaces: command =3D ('tcpdump -w tcpdump_{0}.pcap -i {0} 2>tcpdump_{0}= .out &').format(iface) - self.tester.send_expect('rm -f tcpdump_{0}.pcap', '#').format(= iface) + del_cmd =3D ('rm -f tcpdump_{0}.pcap').format(iface) + self.tester.send_expect(del_cmd, '#') self.tester.send_expect(command, '#') =20 def tcpdump_stop_sniff(self): @@ -125,6 +139,21 @@ class TestTSO(TestCase): 'grep -c "seq"') return self.tcpdump_command(command.format(**locals())) =20 + def tcpdump_scanner(self, scanner): + """ + Execute scanner to return results + """ + scanner_result =3D self.tester.send_expect(scanner, '#') + fially_result =3D re.findall(r'length( \d+)', scanner_result) + return list(fially_result) + + def number_of_bytes(self, iface): + """ + Get the length of loading_sizes + """ + scanner =3D ('tcpdump -vv -r tcpdump_{iface}.pcap 2>/dev/null | g= rep "seq" | grep "length"') + return self.tcpdump_scanner(scanner.format(**locals())) + def test_tso(self): """ TSO IPv4 TCP, IPv6 TCP, VXLan testing @@ -137,12 +166,11 @@ class = TestTSO(TestCase): self.verify(cores is not None, "Insufficient cores for speed testi= ng") self.coreMask =3D utils.create_mask(cores) =20 - padding =3D self.frame_sizes[0] - self.headers_size =20 self.tester.send_expect("ethtool -K %s rx off tx off tso off gso o= ff gro off lro off" % tx_interface, "# ") self.tester.send_expect("ip l set %s up" % tx_interface, "# ") =20 - cmd =3D "./%s/app/testpmd -c %s -n %d %s -- -i --rxd=3D512 --txd= =3D512 --burst=3D32 --rxfreet=3D64 --mbcache=3D128 --portmask=3D%s --txpt= =3D36 --txht=3D0 --txwt=3D0 --txfreet=3D32 --txrst=3D32 " % (self.target, s= elf.coreMask, self.dut.get_memory_channels(), self.blacklist, self.portMask= ) + cmd =3D "./%s/app/testpmd -c %s -n %d %s -- -i --rxd=3D512=20 + --txd=3D512 --burst=3D32 --rxfreet=3D64 --mbcache=3D128 --portmask=3D%s=20 + --max-pkt-len=3D%s --txpt=3D36 --txht=3D0 --txwt=3D0 --txfreet=3D32 --txr= st=3D32 "=20 + % (self.target, self.coreMask, self.dut.get_memory_channels(),=20 + self.blacklist, self.portMask, TSO_MTU) self.dut.send_expect(cmd, "testpmd> ", 120) self.dut.send_expect("set verbose 1", "testpmd> ", 120) self.dut.send_expect("port stop all", "testpmd> ", 120) @@ -163,34= +191,55 @@ class TestTSO(TestCase): self.dut.send_expect("tso set 800 %d" % self.dut_ports[1], "testpm= d> ", 120) self.dut.send_expect("set fwd csum", "testpmd> ", 120) self.dut.send_expect("port start all", "testpmd> ", 120) + self.dut.send_expect("set promisc all off", "testpmd> ", 120) self.dut.send_expect("start", "testpmd> ") =20 self.tester.scapy_foreground() time.sleep(5) =20 - # IPv4 tcp test - - self.tcpdump_start_sniffing([tx_interface, rx_interface]) - self.tester.scapy_append('sendp([Ether(dst=3D"%s",src=3D"52:00:00:= 00:00:00")/IP(src=3D"192.168.1.1",dst=3D"192.168.1.2")/TCP(sport=3D1021,dpo= rt=3D1021)/("X"*%s)], iface=3D"%s")' % (mac, padding, tx_interface)) - out =3D self.tester.scapy_execute() - out =3D self.dut.send_expect("show port stats all", "testpmd> ", 1= 20) - print out - self.tcpdump_stop_sniff() - rx_stats =3D self.number_of_packets(rx_interface) - if (rx_stats =3D=3D 2): - self.verify(1, "Pass") - - # IPv6 tcp test - - self.tcpdump_start_sniffing([tx_interface, rx_interface]) - self.tester.scapy_append('sendp([Ether(dst=3D"%s", src=3D"52:00:00= :00:00:00")/IPv6(src=3D"FE80:0:0:0:200:1FF:FE00:200", dst=3D"3555:5555:6666= :6666:7777:7777:8888:8888")/TCP(sport=3D1021,dport=3D1021)/("X"*%s)], iface= =3D"%s")' % (mac, padding, tx_interface)) - out =3D self.tester.scapy_execute() - out =3D self.dut.send_expect("show port stats all", "testpmd> ", 1= 20) - print out - self.tcpdump_stop_sniff() - rx_stats =3D self.number_of_packets(rx_interface) - if (rx_stats =3D=3D 2): - self.verify(1, "Pass") + for loading_size in self.loading_sizes: + # IPv4 tcp test + self.tcpdump_start_sniffing([tx_interface, rx_interface]) + out =3D self.dut.send_expect("clear port info all", "testpmd> = ", 120) + self.tester.scapy_append('sendp([Ether(dst=3D"%s",src=3D"52:00= :00:00:00:00")/IP(src=3D"192.168.1.1",dst=3D"192.168.1.2")/TCP(sport=3D1021= ,dport=3D1021)/("X"*%s)], iface=3D"%s")' % (mac, loading_size, tx_interface= )) + out =3D self.tester.scapy_execute() + out =3D self.dut.send_expect("show port stats all", "testpmd> = ", 120) + print out + self.tcpdump_stop_sniff() + rx_stats =3D self.number_of_packets(rx_interface) + tx_stats =3D self.number_of_packets(tx_interface) + tx_outlist =3D self.number_of_bytes(rx_interface) + self.logger.info(tx_outlist) + if (loading_size <=3D 800): + self.verify(rx_stats =3D=3D tx_stats and int(tx_outlist[0]= ) =3D=3D loading_size, "IPV6 RX or TX packet number not correct") + else: + num =3D loading_size/800 + for i in range(num): + self.verify(int(tx_outlist[i]) =3D=3D 800, "the packet= segmentation incorrect, %s" % tx_outlist) + if loading_size% 800 !=3D 0: + self.verify(int(tx_outlist[num]) =3D=3D loading_size%= =20 + 800, "the packet segmentation incorrect, %s" % tx_outlist) + + for loading_size in self.loading_sizes: + # IPv6 tcp test + self.tcpdump_start_sniffing([tx_interface, rx_interface]) + out =3D self.dut.send_expect("clear port info all", "testpmd> = ", 120) + self.tester.scapy_append('sendp([Ether(dst=3D"%s", src=3D"52:0= 0:00:00:00:00")/IPv6(src=3D"FE80:0:0:0:200:1FF:FE00:200", dst=3D"3555:5555:= 6666:6666:7777:7777:8888:8888")/TCP(sport=3D1021,dport=3D1021)/("X"*%s)], i= face=3D"%s")' % (mac, loading_size, tx_interface)) + out =3D self.tester.scapy_execute() + out =3D self.dut.send_expect("show port stats all", "testpmd> = ", 120) + print out + self.tcpdump_stop_sniff() + rx_stats =3D self.number_of_packets(rx_interface) + tx_stats =3D self.number_of_packets(tx_interface) + tx_outlist =3D self.number_of_bytes(rx_interface) + self.logger.info(tx_outlist) + if (loading_size <=3D 800): + self.verify(rx_stats =3D=3D tx_stats and int(tx_outlist[0]= ) =3D=3D loading_size, "IPV6 RX or TX packet number not correct") + else: + num =3D loading_size/800 + for i in range(num): + self.verify(int(tx_outlist[i]) =3D=3D 800, "the packet= segmentation incorrect, %s" % tx_outlist) + if loading_size% 800 !=3D 0: + self.verify(int(tx_outlist[num]) =3D=3D loading_size%= =20 + 800, "the packet segmentation incorrect, %s" % tx_outlist) =20 def test_tso_tunneling(self): """ @@ -205,12 +254,10 @@ class TestTSO(TestCase): self.verify(cores is not None, "Insufficient cores for speed testi= ng") self.coreMask =3D utils.create_mask(cores) =20 - padding =3D self.frame_sizes[0] - self.headers_size - self.tester.send_expect("ethtool -K %s rx off tx off tso off gso o= ff gro off lro off" % tx_interface, "# ") self.tester.send_expect("ip l set %s up" % tx_interface, "# ") =20 - cmd =3D "./%s/app/testpmd -c %s -n %d %s -- -i --rxd=3D512 --txd= =3D512 --burst=3D32 --rxfreet=3D64 --mbcache=3D128 --portmask=3D%s --txpt= =3D36 --txht=3D0 --txwt=3D0 --txfreet=3D32 --txrst=3D32 " % (self.target, s= elf.coreMask, self.dut.get_memory_channels(), self.blacklist, self.portMask= ) + cmd =3D "./%s/app/testpmd -c %s -n %d %s -- -i --rxd=3D512=20 + --txd=3D512 --burst=3D32 --rxfreet=3D64 --mbcache=3D128 --portmask=3D%s=20 + --max-pkt-len=3D%s --txpt=3D36 --txht=3D0 --txwt=3D0 --txfreet=3D32 --txr= st=3D32 "=20 + % (self.target, self.coreMask, self.dut.get_memory_channels(),=20 + self.blacklist, self.portMask, TSO_MTU) self.dut.send_expect(cmd, "testpmd> ", 120) self.dut.send_expect("set verbose 1", "testpmd> ", 120) self.dut.send_expect("port stop all", "testpmd> ", 120) @@ -228,35= +275,62 @@ class TestTSO(TestCase): self.dut.send_expect("csum set outer-ip hw %d" % self.dut_ports[1]= , "testpmd> ", 120) self.dut.send_expect("csum parse-tunnel on %d" % self.dut_ports[1]= , "testpmd> ", 120) =20 - self.dut.send_expect("tso set 800 %d" % self.dut_ports[1], "testpm= d> ", 120) + self.dut.send_expect("tunnel_tso set 800 %d" % self.dut_ports[1], = "testpmd> ", 120) + self.dut.send_expect("rx_vxlan_port add 4789 0", "testpmd> ",=20 + 120) self.dut.send_expect("set fwd csum", "testpmd> ", 120) self.dut.send_expect("port start all", "testpmd> ", 120) + self.dut.send_expect("set promisc all off", "testpmd> ", 120) self.dut.send_expect("start", "testpmd> ") =20 self.tester.scapy_foreground() time.sleep(5) =20 - # Vxlan test - self.tcpdump_start_sniffing([tx_interface, rx_interface]) - self.tester.scapy_append('sendp([Ether(dst=3D"%s",src=3D"52:00:00:= 00:00:00")/IP(src=3D"192.168.1.1",dst=3D"192.168.1.2")/UDP(sport=3D"1021",d= port=3D"4789")/VXLAN()/Ether(dst=3D%s,src=3D"52:00:00:00:00:00")/IP(src=3D"= 192.168.1.1",dst=3D"192.168.1.2")/TCP(sport=3D"1021",dport=3D"1021")/("X"*%= s)], iface=3D"%s")' % (mac, mac, padding, tx_interface)) - out =3D self.tester.scapy_execute() - out =3D self.dut.send_expect("show port stats all", "testpmd> ", 1= 20) - print out - self.tcpdump_stop_sniff() - rx_stats =3D self.number_of_packets(rx_interface) - if (rx_stats =3D=3D 2): - self.verify(1, "Pass") - - # Nvgre test - self.tcpdump_start_sniffing([tx_interface, rx_interface]) - self.tester.scapy_append('sendp([Ether(dst=3D"%s",src=3D"52:00:00:= 00:00:00")/IP(src=3D"192.168.1.1",dst=3D"192.168.1.2",proto=3D47)/NVGRE()/E= ther(dst=3D%s,src=3D"52:00:00:00:00:00")/IP(src=3D"192.168.1.1",dst=3D"192.= 168.1.2")/TCP(sport=3D"1021",dport=3D"1021")/("X"*%s)], iface=3D"%s")' % (m= ac, mac, padding, tx_interface)) - out =3D self.tester.scapy_execute() - out =3D self.dut.send_expect("show port stats all", "testpmd> ", 1= 20) - print out - self.tcpdump_stop_sniff() - rx_stats =3D self.number_of_packets(rx_interface) - if (rx_stats =3D=3D 2): - self.verify(1, "Pass") + for loading_size in self.loading_sizes: + # Vxlan test + self.tcpdump_start_sniffing([tx_interface, rx_interface]) + self.load_module() + out =3D self.dut.send_expect("clear port info all", "testpmd> = ", 120) + self.tester.scapy_append('sendp([Ether(dst=3D"%s",src=3D"52:00= :00:00:00:00")/IP(src=3D"192.168.1.1",dst=3D"192.168.1.2")/UDP(sport=3D1021= ,dport=3D4789)/Vxlan()/Ether(dst=3D"%s",src=3D"52:00:00:00:00:00")/IP(src= =3D"192.168.1.1",dst=3D"192.168.1.2")/TCP(sport=3D1021,dport=3D1021)/("X"*%= s)], iface=3D"%s")' % (mac, mac, loading_size, tx_interface)) + out =3D self.tester.scapy_execute() + out =3D self.dut.send_expect("show port stats all", "testpmd> = ", 120) + print out + self.tcpdump_stop_sniff() + rx_stats =3D self.number_of_packets(rx_interface) + tx_stats =3D self.number_of_packets(tx_interface) + tx_outlist =3D self.number_of_bytes(rx_interface) + self.logger.info(tx_outlist) + if (loading_size <=3D 800): + self.verify(rx_stats =3D=3D tx_stats and int(tx_outlist[0]= ) =3D=3D loading_size, "Vxlan RX or TX packet number not correct") + else: + num =3D loading_size/800 + for i in range(num): + self.verify(int(tx_outlist[i]) =3D=3D 800, "the packet= segmentation incorrect, %s" % tx_outlist) + if loading_size% 800 !=3D 0: + self.verify(int(tx_outlist[num]) =3D=3D loading_size%= =20 + 800, "the packet segmentation incorrect, %s" % tx_outlist) + + for loading_size in self.loading_sizes: + # Nvgre test + self.tcpdump_start_sniffing([tx_interface, rx_interface]) + self.load_module() + out =3D self.dut.send_expect("clear port info all", "testpmd> = ", 120) + self.tester.scapy_append('sendp([Ether(dst=3D"%s",src=3D"52:00= :00:00:00:00")/IP(src=3D"192.168.1.1",dst=3D"192.168.1.2",proto=3D47)/NVGRE= ()/Ether(dst=3D"%s",src=3D"52:00:00:00:00:00")/IP(src=3D"192.168.1.1",dst= =3D"192.168.1.2")/TCP(sport=3D1021,dport=3D1021)/("X"*%s)], iface=3D"%s")' = % (mac, mac, loading_size, tx_interface)) + out =3D self.tester.scapy_execute() + out =3D self.dut.send_expect("show port stats all", "testpmd> = ", 120) + print out + self.tcpdump_stop_sniff() + rx_stats =3D self.number_of_packets(rx_interface) + tx_stats =3D self.number_of_packets(tx_interface) + tx_outlist =3D self.number_of_bytes(rx_interface) + self.logger.info(tx_outlist) + if (loading_size <=3D 800): + self.verify(rx_stats =3D=3D tx_stats and int(tx_outlist[0]= ) =3D=3D loading_size, "Nvgre RX or TX packet number not correct") + else: + num =3D loading_size/800 + for i in range(num): + self.verify(int(tx_outlist[i]) =3D=3D 800, "the packet= segmentation incorrect, %s" % tx_outlist) + if loading_size% 800 !=3D 0: + self.verify(int(tx_outlist[num]) =3D=3D loading_size%= =20 + 800, "the packet segmentation incorrect, %s" % tx_outlist) + =20 def test_perf_TSO_2ports(self): """ @@ -276,7 +350,7 @@ class TestTSO(TestCase): else: queues =3D 1 =20 - command_line =3D "./%s/app/testpmd -c %s -n %d %s -- -i --core= mask=3D%s --rxd=3D512 --txd=3D512 --burst=3D32 --rxfreet=3D64 --mbcache=3D1= 28 --portmask=3D%s --txpt=3D36 --txht=3D0 --txwt=3D0 --txfreet=3D32 --txrst= =3D32 " % (self.target, self.all_cores_mask, self.dut.get_memory_channels()= , self.blacklist, self.coreMask, self.portMask) + command_line =3D "./%s/app/testpmd -c %s -n %d %s -- -i=20 + --coremask=3D%s --rxd=3D512 --txd=3D512 --burst=3D32 --rxfreet=3D64=20 + --mbcache=3D128 --portmask=3D%s --max-pkt-len=3D%s --txpt=3D36 --txht=3D0= =20 + --txwt=3D0 --txfreet=3D32 --txrst=3D32 " % (self.target,=20 + self.all_cores_mask, self.dut.get_memory_channels(), self.blacklist,=20 + self.coreMask, self.portMask, TSO_MTU) =20 info =3D "Executing PMD using %s\n" % test_cycle['cores'] self.logger.info(info) @@ -300,18 +374,20 @@ class TestTSO(TestCase): self.dut.send_expect("tso set 800 %d" % self.dut_ports[1], "te= stpmd> ", 120) self.dut.send_expect("set fwd csum", "testpmd> ", 120) self.dut.send_expect("port start all", "testpmd> ", 120) + self.dut.send_expect("set promisc all off", "testpmd> ",=20 + 120) self.dut.send_expect("start", "testpmd> ") - for frame_size in self.frame_sizes: + for loading_size in self.loading_sizes: + frame_size =3D loading_size + self.headers_size wirespeed =3D self.wirespeed(self.nic, frame_size, 2) =20 # create pcap file self.logger.info("Running with frame size %d " % frame_siz= e) payload_size =3D frame_size - self.headers_size for _port in range(2): - mac =3D self.dut.get_mac_address(self.dut_ports[_port]) - self.tester.scapy_append('wrpcap("dst%d.pcap", [Ether(dst= =3D"%s",src=3D"52:00:00:00:00:01")/IP(src=3D"192.168.1.1",dst=3D"192.168.1.= 2")/TCP(sport=3D1021,dport=3D1021)/("X"*%d)])' % (_port, mac, payload_size)= ) - tgen_input.append((self.tester.get_local_port(self.dut_ports[_po= rt]), - self.tester.get_local_port(self.dut_ports[1-_po= rt]), "dst%d.pcap") % _port) + mac =3D self.dut.get_mac_address(self.dut_ports[_port]= ) + self.tester.scapy_append('wrpcap("dst%d.pcap", [Ether(= dst=3D"%s",src=3D"52:00:00:00:00:01")/IP(src=3D"192.168.1.1",dst=3D"192.168= .1.2")/TCP(sport=3D1021,dport=3D1021)/("X"*%d)])' % (_port, mac, loading_si= ze)) + tgen_input.append((self.tester.get_local_port(self.dut= _ports[_port]), + =20 + self.tester.get_local_port(self.dut_ports[1-_port]), "dst%d.pcap") %=20 + _port) self.tester.scapy_execute() =20 # run traffic generator @@ -326,21 +402,22 @@ class TestTS= O(TestCase): time.sleep(5) =20 for n in range(len(self.test_cycles)): - for frame_size in self.frame_sizes: + for loading_size in self.loading_sizes: self.verify(self.test_cycles[n]['Mpps'][ - frame_size] > 0, "No traffic detected") + loading_size] > 0, "No traffic detected") =20 # Print results self.result_table_create(self.table_header) - for frame_size in self.frame_sizes: - table_row =3D [frame_size] + for loading_size in self.loading_sizes: + table_row =3D [loading_size] for test_cycle in self.test_cycles: - table_row.append(test_cycle['Mpps'][frame_size]) - table_row.append(test_cycle['pct'][frame_size]) + table_row.append(test_cycle['Mpps'][loading_size]) + table_row.append(test_cycle['pct'][loading_size]) =20 self.result_table_add(table_row) =20 self.result_table_print() + def tear_down(self): """ Run after each test case. @@ -352,4 +429,4 @@ class TestTSO(TestCase): """ Run after each test suite. """ - pass + self.tester.send_expect("ifconfig %s mtu %s" %=20 + (self.tester.get_interface(self.tester.get_local_port(self.dut_ports[0 + ])), DEFAULT_MUT), "# ") -- 2.17.2