From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A5FCCA0A0C; Sun, 27 Jun 2021 09:18:07 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6B1124068A; Sun, 27 Jun 2021 09:18:07 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 49B934014E for ; Sun, 27 Jun 2021 09:18:05 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 15R7FP0Q030245 for ; Sun, 27 Jun 2021 00:18:04 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=pfpt0220; bh=hdkaAVMS2WFrY82WLO8BGwUZy6ps5AeDUNapdy8/CoY=; b=BVfpJqb7PmiNXeXaI3DQA5yaTmwxKNhzLzGRh+tW6zo/Ebxqzxs3D6ZxSZ7IZPWJRBaW FvtJjyP2MA6flK56AhVGwKGL0jPdYyFktMBGjIzqjggobG3eUbTenHqU8hxpVrrOkge5 NjKgyqiJC3M9DAuORBTZBVLcUN32g7joE7ENfe57KYNw8sYx9yTP0IAjOsd5f6UXyT+R c1nUcG+b6F9khDcBKrPpDMIWPGm+HXjFBBmS/GuZNdcBb/UfOZUNXhi4C4dQNswC76ip EY+Tj+o31ggHi7DiP+6iVfOr7moQs7xOtRNBNcOVZiXeBxBdLDqhzk5coa3Vqed1w8OL 4Q== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com with ESMTP id 39e3rra5xc-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Sun, 27 Jun 2021 00:18:04 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Sun, 27 Jun 2021 00:18:02 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Sun, 27 Jun 2021 00:18:02 -0700 Received: from phanendra-system.marvell.com (phanendra-system.marvell.com [10.28.8.78]) by maili.marvell.com (Postfix) with ESMTP id C65303F7048; Sun, 27 Jun 2021 00:18:01 -0700 (PDT) From: To: CC: Phanendra Vukkisala Date: Sun, 27 Jun 2021 12:47:45 +0530 Message-ID: <1624778265-2134-1-git-send-email-pvukkisala@marvell.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-GUID: xdpHm3CG-fscVJPBpSUQSlrVOyoqVJhy X-Proofpoint-ORIG-GUID: xdpHm3CG-fscVJPBpSUQSlrVOyoqVJhy X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-06-26_15:2021-06-25, 2021-06-26 signatures=0 Subject: [dts] [PATCH] hotplug.py: Change expected output to testpmd prompt. X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 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" From: Phanendra Vukkisala Due to not having testpmd as expected prompt, show port stats gets old output causing test failure Signed-off-by: Phanendra Vukkisala --- tests/TestSuite_hotplug.py | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/tests/TestSuite_hotplug.py b/tests/TestSuite_hotplug.py index f40c291..bb31a9d 100644 --- a/tests/TestSuite_hotplug.py +++ b/tests/TestSuite_hotplug.py @@ -75,8 +75,10 @@ class TestPortHotPlug(TestCase): attach port """ # dpdk hotplug discern NIC by pci bus and include domid - self.dut.send_expect("port attach %s" % self.dut.ports_info[port]['pci'], "is attached", 60) - self.dut.send_expect("port start %s" % port, "Configuring Port", 120) + out = self.dut.send_expect("port attach %s" % self.dut.ports_info[port]['pci'], "testpmd>", 60) + self.verify("is attached" in out, "Failed to attach") + out = self.dut.send_expect("port start %s" % port, "testpmd>", 120) + self.verify("Configuring Port" in out, "Failed to start port") # sleep 10 seconds for fortville update link stats time.sleep(10) self.dut.send_expect("show port info %s" % port, "testpmd>", 60) @@ -85,10 +87,12 @@ class TestPortHotPlug(TestCase): """ detach port """ - self.dut.send_expect("port stop %s" % port, "Stopping ports", 60) + out = self.dut.send_expect("port stop %s" % port, "testpmd>", 60) + self.verify("Stopping ports" in out, "Failed to stop port") # sleep 10 seconds for fortville update link stats time.sleep(10) - self.dut.send_expect("port detach %s" % port, "is detached", 60) + out = self.dut.send_expect("port detach %s" % port, "testpmd>", 60) + self.verify("is detached" in out, "Failed to detach port") def test_after_attach(self): """ @@ -103,13 +107,15 @@ class TestPortHotPlug(TestCase): self.dut.close_session(session_secondary) self.attach(self.port) self.dut.send_expect("start", "testpmd>", 60) - self.dut.send_expect("port detach %s" % self.port, "Port not stopped", 60) + out = self.dut.send_expect("port detach %s" % self.port, "testpmd>", 60) + self.verify("Port not stopped" in out, "able to detach port without stopping") self.dut.send_expect("stop", "testpmd>", 60) self.detach(self.port) self.attach(self.port) self.dut.send_expect("start", "testpmd>", 60) - self.dut.send_expect("port detach %s" % self.port, "Port not stopped", 60) + out = self.dut.send_expect("port detach %s" % self.port, "testpmd>", 60) + self.verify("Port not stopped" in out, "able to detach port without stopping") self.dut.send_expect("clear port stats %s" % self.port, "testpmd>", 60) self.send_packet(self.port) out = self.dut.send_expect("show port stats %s" % self.port, "testpmd>", 60) @@ -144,7 +150,8 @@ class TestPortHotPlug(TestCase): self.attach(self.port) self.dut.send_expect("start", "testpmd>", 60) - self.dut.send_expect("port detach %s" % self.port, "Port not stopped", 60) + out = self.dut.send_expect("port detach %s" % self.port, "testpmd>", 60) + self.verify("Port not stopped" in out, "able to detach port without stopping") self.dut.send_expect("clear port stats %s" % self.port, "testpmd>", 60) self.send_packet(self.port) out = self.dut.send_expect("show port stats %s" % self.port, "testpmd>", 60) @@ -165,12 +172,14 @@ class TestPortHotPlug(TestCase): testpmd_cmd = "%s " % self.path + eal_param + ' -- -i' self.dut.send_expect(testpmd_cmd, "testpmd>", timeout=60) self.dut.send_expect("port stop 0", "testpmd>") - self.dut.send_expect("port detach 0", "Device is detached") + out = self.dut.send_expect("port detach 0", "testpmd>") + self.verify("Device is detached" in out, "Failed to detach") stats = self.dut.send_expect("ls %s" % path, "#", timeout=3, alt_session=True, verify=True) self.verify(stats == 2, 'port detach failed') time.sleep(1) - self.dut.send_expect("port attach eth_vhost1,iface=%s,queues=1" % iface, "Port 0 is attached.") + out = self.dut.send_expect("port attach eth_vhost1,iface=%s,queues=1" % iface, "testpmd>") + self.verify("Port 0 is attached." in out, "Failed to attach") self.dut.send_expect("port start 0", "testpmd>") out = self.dut.send_expect("ls %s" % path, "#", timeout=3, alt_session=True, verify=True) -- 1.7.9.5