From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0067.outbound.protection.outlook.com [104.47.40.67]) by dpdk.org (Postfix) with ESMTP id CD1DC2C6B for ; Thu, 6 Apr 2017 19:52:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=NQUNZhkAhaxp11aVVXDHjqIBp5hR/IE6brdeFnpLafg=; b=DiuvM3vwljuOxoXtW9WuLJ8aHDjod1Z21RsF1tkpYUjsNmUMiwWf96IqCEvml4KaSKbwL4NgpDrRdL9ziU9WKnEuypZ7RJaYnQwW03UVujyC1KXt1EEebyqxNSAgDfaVYictvcTy3zsf9OtKQQp/Z5G8AmZjqdcjUDjfwKWe4mA= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=caviumnetworks.com; Received: from angela-H81M-S1.semihalf.local (31.172.191.173) by DM2PR0701MB810.namprd07.prod.outlook.com (10.242.127.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1005.10; Thu, 6 Apr 2017 17:52:08 +0000 From: Angela Czubak To: dts@dpdk.org Cc: Angela Czubak Date: Thu, 6 Apr 2017 19:51:28 +0200 Message-Id: <1491501092-14278-23-git-send-email-aczubak@caviumnetworks.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1491501092-14278-1-git-send-email-aczubak@caviumnetworks.com> References: <1491501092-14278-1-git-send-email-aczubak@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [31.172.191.173] X-ClientProxiedBy: AM5PR0701CA0051.eurprd07.prod.outlook.com (10.169.145.141) To DM2PR0701MB810.namprd07.prod.outlook.com (10.242.127.24) X-MS-Office365-Filtering-Correlation-Id: ca9486b5-b10b-4402-5096-08d47d15a543 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:DM2PR0701MB810; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0701MB810; 3:SUiGcpeBkZbtTOZDYevY92qpUY7jdzpW3ZQzhACWiJm3WVFDIgeju/JH/268IGA6OFc25oL53rVigbaFPVpgPh53r3yUYcXHMIo0iQ6tZPRNBw9cj1SKxWhVCWKfcgAZ0KYJ1Ee77V8u9NxDyytwHevgiqrz4+lbWTSueN7Cjrjt/oJtgYmhsGV4pZ8quPVk8+Vqz9/v4tHHnuZBvFlpQd1B4zlDm6qog3ky+jSdwUip+yzAAntRSsqgoKag5tWiZZsb4Y8kESCBgAhQ3xDiwz7GGnqOFX/269fTKUsNyY6ON4+LoeRzMwFvEtPEX5dJiMrv1RfDnKyYxEjzKMWABQ==; 25:RmEWZ9rLCwj81GU6lZUVJBnRd6DDWyUOadDfmo/xwlmhieCP3Q90nzzmiVqsTmPt3izDSm1pxatuBuS7TtdgmElPXp4JeaI4A6gWNqqTYoS4FCh6Jgr/yI2W0/1BZBrLGZAtLr46C868syNhAcPcAwRrsuHMk5Kxe1Lj73fn76NW40OJCw7F0nag6tfHzolwxXc7LyBTq0l4a9+wEd9S6y13gNDXg3cZffFfmN/i9uOj/eVxOaaTdxh+Wb7iCAqYu8ZwwY2bsOGw5flXEgp8Utz6yAN0d9DgWqIIX7DVLQ/caWDoSITOpVnJvz1aFgUl0ROfA7qzEmUTEXMYiKr4OuKpNWmIbOvmKoADgdQMheLE0A0bmFDRfdbO7PAuG7nFttefOxUIKM8j4A8qMMzgpONDGfPA0eGzCpxRWArvZAmqgF7ffpvFV/VkoioDsGQ8jedD+Hxf/2xxn1KM5nvHGQ== X-Microsoft-Exchange-Diagnostics: 1; DM2PR0701MB810; 31:Tm+rvaRLt8zLLjqOqTc2nrmeOfCxHTWufMo9Qas0hdqQj7JRGP1VlbtbahS2BqammAbJwYrcAEQwI8OFt7Wpwya7qBs0qkPngnzcJSIGBiUP/ZdYubdlnSaxsPdO7E24YeKp85BgWIIZLhU1K0iBYS7XR4iZ+DWRCoQS6uowz2XWILZqV5qtuEKnYEzw84MRtjAtJbupmGCdTYLRyQOm9xIoGpJTgaE859g8KEEX8T4MQ8wn6cGwQWw4KZj5tXso6xA9as8Hu8FjL1ZmpkIuYA==; 20:4YQCucHXd5lKXd2RhxMl0EdfbXWan6pIpI5rmR7CDGw2fAt6OP0/3/TEnRlcD+MLQ6txp3iRqyf0yRyyvWkmTxqZVjSPXwINwexSLP4ScN0BcIs1DqoK1VmaaNyueBaigR00kuaTGpKYhSai80CErPteQjX3GPFyjB30ePEcU+3MCxM/6FdRnz0eRzErMjfzGKsO/mZcGhDRIyzOvS20gWcWiRn6E4HWimHg5bNN1hgxcwF7TtbUGQrITxbE18sYiVwj+fR+8EPW4ExWU0HnrHBni5AdZI4oGN1843DksKQcZOCu2S4OPx94QF7pchosSD1EkIwXzLBdt1zYVfpU9+T7cd/GsPYCuZwPD55iytuspmnZdMyGiV8KAP/nhr4EVcAWn4MzAlY0gB+PtInjtcbVMwcfpiMjL03F1R7WyWADn7pJcYLGjZsb0hjmKecgfg9qvJ/xkD+OUU6U7LjsqUZIkFMeFOBTX431xCgAduJWitlZfZkjyyKkC8Ad9k/BgTKdw8XuvFLf0KE2UY5pAD5PJMSsbq67hTWBRL7b0aXNs3F59I1rsKemOGiqyim/QNo+k+2OIeBKqVoXlT5F+A/qeawThOKBG3IGyRyyahY= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(10201501046)(3002001)(6041248)(20161123555025)(20161123560025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(20161123562025)(6072148); SRVR:DM2PR0701MB810; BCL:0; PCL:0; RULEID:; SRVR:DM2PR0701MB810; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0701MB810; 4:7tCCLJBuT7wxUe0Ffq/YFhxNrAwjyIi9bmbFqn9ChXJ/LKPaX3UK2hJWsz3mLKC86XEoaQBkcrxvm9odrcAOk6VmQyoJUVA3fzmJS+l0KKnMl/Rdx1ElotlzVcvDYL6xP9p1QJeXuhCjI+GDAq/l5d8Qzp+L/IjhZlXwUry8TVHOmk7dtoV81YdyB7ML4iQ0guZbzDc0tOfGU+06jmzr5TA7Smwfb29q/KLge+WEDsr/nBn+gSmeAAZN0+90u97o7otcHUSItKHnAMTdfXpORb5w/CKQT0kdQcqq28PPD3r6yzkzwnJRkvb6njYIBU6640WQHP7SHNHZaK21Zb7LkXzdEzy+OGn+bz7joOlejWEwKFF1iwaFMhPWh/ex9xtymh+Hu2icSApdbChLGPGbHoEccoHQr+hTBV4qGSEGvDnFWL8tiGwIBxh59+eItRWxahCqZAco+jddiETBb0F3+hbdHurV5JRVe6PJSMJThdQGTu7e3tAqdAx9Ivr+Q+ypJdg7CZkyTcnciquIChuk65ggyVbWF3X0cwVLT7O9k7jAKZlgQsd0Sgk/O+eXSkcqgTm282WSxvCXprAMgWLfwHJH4q1pw8yiPPCkQu4Yooyfb9ckoe8s1FBEM/32NbqcSwjjUJfQZY+q3hNnQkgCPzCAf+c/LIAJEdexmerHxJQrleLv0vYRV5paWqRmUGMH X-Forefront-PRVS: 02698DF457 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39830400002)(39450400003)(39400400002)(39410400002)(3846002)(50226002)(6116002)(47776003)(33646002)(6506006)(189998001)(6486002)(48376002)(50466002)(36756003)(66066001)(8676002)(5003940100001)(2361001)(42882006)(110136004)(107886003)(38730400002)(76176999)(25786009)(2351001)(6666003)(81166006)(42186005)(15650500001)(50986999)(6916009)(6512007)(7736002)(53936002)(4326008)(5660300001)(305945005)(2950100002)(2906002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR0701MB810; H:angela-H81M-S1.semihalf.local; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR0701MB810; 23:mmiVFSAr7/zZpgmO8vTDQwAKUAfJAjb6Du560b61?= =?us-ascii?Q?4UDVkQtpZNfYTuQrl+UQ0ZNrrWmbzvKs1z0xBhCZ28GduyyceSNDMYu4l+eZ?= =?us-ascii?Q?3i+hkOqtWt0Ou1b5ap0gV4joS1sx7/WcsQgdvm//45JvqpX95/zDDg2arsU5?= =?us-ascii?Q?Ik38icm2mWKRu8j79Bf2zw1bZW51qzwmUmg+c655mV5Yppfr1K86fP0Z3WUS?= =?us-ascii?Q?rlP2Aq7e8K13sQS4db84xVbHnIDS4KOneQScaIFymY6rp/dubLjCL5TF+RkQ?= =?us-ascii?Q?nkGc5SwinSHX3RLH/DfM0dHXsA+dPC7UD3Bd5ovAA3D6c9uKvIfqIKp18uz0?= =?us-ascii?Q?9mS56gT89Cd2Yae3UAGLBnl7/33hnzxFzEqNa4cQ7RPXC5naeas8PJefABaS?= =?us-ascii?Q?fv9x8kllTMVAHrr1NsZ+rBpimC1KI1oB+Lx/hUFNTrPJg8D7XEidgduAlVFQ?= =?us-ascii?Q?w5BAmglbpKkd7eLo9au25zPEL40+QE8cSCSv54aOMC34O6P6q2iQP9MQFmam?= =?us-ascii?Q?hcFoLBhwgo9bvWhV15xkBT5VOU/U8kmJPcbTbNYLkkg1KvKwXVclAUuCIYdA?= =?us-ascii?Q?1Q+R7IHfF+ftXg5JEZxib+CgK8nZ/aB8esMZG6CFmc9uKaB9mifpni9SUXO3?= =?us-ascii?Q?FYu6YxB+rtasEMLrpyzCO9sgn4UW0JTklB+3TY3Z1+yjYiYQnaZoaqfy/fjH?= =?us-ascii?Q?Okdn7+KeM8+VJ4KN7WTbRHG8gbZql8iYdFTgwRFDFy436aOxqpMR8hWrhth8?= =?us-ascii?Q?n2Rp4U//Q0YbaXb9RhLnfuN1GvSeXV8K4MLJwB55SKDBXkVKeIwml3UGxVU8?= =?us-ascii?Q?TVvBYP5qPxbnNzuzi4zCKEl0vbYPba6PvzF1Nio5qTXpdBZv2pYM6HQKThQi?= =?us-ascii?Q?ahoMHQVaZASAXVTerDDQrOh9nGXIT0sCrD7CrLqeDry62bBBIRwqNjWzO/5I?= =?us-ascii?Q?KIx1SXfaANfNIDTN932/rPf1YmqClJAf4UAMeZ8jWwJdWuvG4cOgglbKoeY0?= =?us-ascii?Q?Rn9IIeImp7UWiL/9wZmtB6tJcY3gnXM30PFK0jMXX3BOATKNB+jYzxf4C2+T?= =?us-ascii?Q?j3p25Pk=3D?= X-Microsoft-Exchange-Diagnostics: 1; DM2PR0701MB810; 6:dA80zHKprqIbgmwqOU0xxAtoPscIcWDJ2x3Yb7iURAUzNfvAkq03KniwpjvEBiAdzlxIjdK7y78jZ9tH20SHZyWB5h/n2yVLNMWoLoU9NlXmmIesWYJys/sEjm42rfB2z05YStcFvEtkvTnyYRL0n2DYlquNmqUGaKLuEMEFIAEX5xDFePWaRtki0VPQ9Y5u+c/5C/kWzX+Qj7L+cmK7Q3QLibUVjrsYcHCoxS38T2+t9CGV+VNCOrqHo7h8QnbjRrN2vLLmlluRpwx99Qp9ssGX0Iu43h0q6ogKCVjmIs1jmnFRCf9GVrPHPwJuR3XmM2J07P1O1ntuME6hZagCVgyIaYqu+Ed2UMMAdynO+CAspjUW4v9GCFOq8qflDYDxp8k0DCHp1P4N91UIOahniQ==; 5:URLluJADBOO1cuC/Pr/paviLrH99e+xzt66otQ7M47ChiVvWv1rvVhXW8FFkE3c6bArUoDVjuK2keoMl6J4hUjhFljK0Yb2GkGWNKJ79lX46ZQJcgthmajxzk/psCkBcYfdYg6zNqS6ArxGsXEC2BQ==; 24:9mSbdg3c0r0vOq8z+v6Ko5Q5NIZoq7lP5iJZKBzvd+4tB/DD78Pwwf2qE00pclFha1ABSetald2gwUr5/5jJDoWd7xoPo5BBGPeSwtwyNG0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM2PR0701MB810; 7:6d8EG1uuWaWYQqHp6i0pekoTsQvvuYwr8mtcvE6MCVg6Nzk6FkwM6GZSukZZjh8M9RWFWbOdQSY7BSpPQlxTDZ3fxq9DCyrfhMsigLsMmRbjOsfAFU3eGEKHJGcp9Ef/FhCu+MYKsGzbQmc8PyO8avaKdoKTv9jjIuvWGTyhFo2eeAqGddIU5WOyIGFpOV8w/yXCzQcZ2XtA/qRZNjKaSZOc6Bg5lrxA66MdvyT5owUN42WNNP2O6C3N0aEK46dgbCmwtdLE+rIwt7N26BPfvppxPlOh73JFTbAgQBbZWnJjqx0+qDbHC07mwKTEqYk32xef1jyvTBc4xYFU+H3oaw== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Apr 2017 17:52:08.0705 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR0701MB810 Subject: [dts] [PATCH 22/26] tests: short_live - taking into account cavium NICs + fixes 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: , X-List-Received-Date: Thu, 06 Apr 2017 17:52:10 -0000 Testpmd must be run with hardware VLAN filter disabled as thunder driver does not support this feature - --disable-hw-vlan-filter is appended if NIC is Cavium device. Additional fixes done: waiting for DPDK application to be finished by calling `ps` in a loop and checking whether the process is still alive; sniffing in background scapy process fails at times, using tcpdump instead; if start_up_time fails it is checked if the problem was that time command seem not to be found (informing user about it). Signed-off-by: Angela Czubak --- tests/TestSuite_short_live.py | 42 ++++++++++++++++++++++++++++++++++-------- 1 file changed, 34 insertions(+), 8 deletions(-) diff --git a/tests/TestSuite_short_live.py b/tests/TestSuite_short_live.py index 72745a9..45727a1 100644 --- a/tests/TestSuite_short_live.py +++ b/tests/TestSuite_short_live.py @@ -45,6 +45,7 @@ from test_case import TestCase from pmd_output import PmdOutput from settings import FOLDERS +from packet import Packet, sniff_packets, load_sniff_packets, strip_pktload # # # Test class. @@ -95,17 +96,14 @@ class TestShortLiveApp(TestCase): dmac = self.dut.get_mac_address(txPort) Dut_tx_mac = self.dut.get_mac_address(rxPort) - self.tester.scapy_background() count = 1 # if only one port rx/tx, we should check count 2 so that both # rx and tx packet are list if (txPort == rxPort): count = 2 - self.tester.scapy_append('p=sniff(iface="%s",count=%d,timeout=5)' % (rxitf, count)) - self.tester.scapy_append('RESULT=str(p)') - self.tester.scapy_foreground() + inst = sniff_packets(intf=rxitf, count=count) pktlen = pktSize - 14 padding = pktlen - 20 @@ -114,7 +112,11 @@ class TestShortLiveApp(TestCase): self.tester.scapy_execute() time.sleep(3) - out = self.tester.scapy_get_result() + p = load_sniff_packets(inst) + nr_packets=len(p) + reslist = [p[i].pktgen.pkt for i in range(nr_packets)] + out = str(reslist) + if received: self.verify(('PPP' in out) and 'src=%s'% Dut_tx_mac in out, "Receive test failed") else: @@ -125,7 +127,10 @@ class TestShortLiveApp(TestCase): Basic rx/tx forwarding test """ #dpdk start - self.dut.send_expect("./%s/app/testpmd -c 0xf -n 4 -- -i --portmask=0x3" % self.target, "testpmd>", 120) + cmd = "./%s/app/testpmd -c 0xf -n 4 -- -i --portmask=0x3" + if "cavium" in self.dut.nic_type: + cmd += " --disable-hw-vlan-filter" + self.dut.send_expect(cmd % self.target, "testpmd>", 120) self.dut.send_expect("set fwd mac", "testpmd>") self.dut.send_expect("set promisc all off", "testpmd>") self.dut.send_expect("start", "testpmd>") @@ -144,23 +149,33 @@ class TestShortLiveApp(TestCase): print "start time: %s s"%time[0] else: self.verify(0, "start_up_time failed") + if "time: command not found" in out: + print "Command time is not installed or is a shell keyword" def test_clean_up_with_signal_testpmd(self): repeat_time = 5 + cmd = "./%s/app/testpmd -c 0xf -n 4 -- -i --portmask=0x3" + if "cavium" in self.dut.nic_type: + cmd += " --disable-hw-vlan-filter" for i in range(repeat_time): #dpdk start print "clean_up_with_signal_testpmd round %d" % (i + 1) - self.dut.send_expect("./%s/app/testpmd -c 0xf -n 4 -- -i --portmask=0x3" % self.target, "testpmd>", 120) + self.dut.send_expect(cmd % self.target, "testpmd>", 120) self.dut.send_expect("set fwd mac", "testpmd>") self.dut.send_expect("set promisc all off", "testpmd>") self.dut.send_expect("start", "testpmd>") self.check_forwarding([0, 1], self.nic) + pid = self.dut.send_expect("ps -o pid -C testpmd | tail -n +2", "#", 60, True) # kill with differen Signal if i%2 == 0: self.dut.send_expect("pkill -2 testpmd", "#", 60, True) else: self.dut.send_expect("pkill -15 testpmd", "#", 60, True) + # waiting for the process to truly finish + while True: + no_lines = int(self.dut.send_expect("ps -p %d | wc -l" % int(pid), "#", 60, True)) + if 1 == no_lines: break # only header is printed out def test_clean_up_with_signal_l2fwd(self): repeat_time = 5 @@ -172,10 +187,16 @@ class TestShortLiveApp(TestCase): self.check_forwarding([0, 1], self.nic) # kill with differen Signal + pid = self.dut.send_expect("ps -o pid -C l2fwd | tail -n +2", "#", 60, True) if i%2 == 0: self.dut.send_expect("pkill -2 l2fwd", "#", 60, True) else: self.dut.send_expect("pkill -15 l2fwd", "#", 60, True) + + while True: + no_lines = int(self.dut.send_expect("ps -p %d | wc -l" % int(pid), "#", 60, True)) + if 1 == no_lines: break + def test_clean_up_with_signal_l3fwd(self): repeat_time = 5 @@ -186,12 +207,17 @@ class TestShortLiveApp(TestCase): self.dut.send_expect("./examples/l3fwd/build/app/l3fwd -n 4 -c 0xf -- -p 0x3 --config='(0,0,1),(1,0,2)' &", "L3FWD:", 120) self.check_forwarding([0, 0], self.nic) + pid = self.dut.send_expect("ps -o pid -C l3fwd | tail -n +2", "#", 60, True) # kill with differen Signal if i%2 == 0: self.dut.send_expect("pkill -2 l3fwd", "#", 60, True) else: self.dut.send_expect("pkill -15 l3fwd", "#", 60, True) - + + while True: + no_lines = int(self.dut.send_expect("ps -p %d | wc -l" % int(pid), "#", 60, True)) + if 1 == no_lines: break + def tear_down(self): """ Run after each test case. -- 2.7.4