From patchwork Fri Jun 25 18:50:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Phanendra Vukkisala X-Patchwork-Id: 94874 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id CA7D7A0547; Fri, 25 Jun 2021 20:51:05 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7CBA740698; Fri, 25 Jun 2021 20:51:05 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 29FD84068A for ; Fri, 25 Jun 2021 20:51:03 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 15PIl94E022514 for ; Fri, 25 Jun 2021 11:51:03 -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=dYCU/pl+Ju7x/POqeQSkCyxamQf8WjRkEDqH9bCmLBM=; b=VQSG2KVUQUkbLGHszMkSS/AF0cCr7IIf0Ory+qYhVNEiwQixIipenEgtImupQ7sjFaVK FfEBAG2EhVih2u34Ilxrry3snJyecUaVeCdbW8NbOVxC/yUfZK0vohLNi4Z27/ZamHjA HOJA9OqPvJ+Lty6cY46tW3ClwjdIjBhY3m+uzVgQ+RMKJa5lhb0r39gHZ0jqKy5caG8t eqn9ZGZE6ZgLBRbihqo3BQgr4v9hsvIX3KL+OR3YksXwX0EaFiKVetK9c17qiSotcIvo usZmjN7gu67K5VSxXb+Fd5pilFhhq5j/S8bob2CMTYlot8e2vjBeYTgxZp6tjO2ixvqm 9A== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com with ESMTP id 39d24dm1uk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Fri, 25 Jun 2021 11:51:03 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Fri, 25 Jun 2021 11:51:01 -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; Fri, 25 Jun 2021 11:51:01 -0700 Received: from phanendra-system.marvell.com (phanendra-system.marvell.com [10.28.8.78]) by maili.marvell.com (Postfix) with ESMTP id 830D63F7060; Fri, 25 Jun 2021 11:51:00 -0700 (PDT) From: To: CC: , Phanendra Vukkisala Date: Sat, 26 Jun 2021 00:20:32 +0530 Message-ID: <1624647032-22230-1-git-send-email-pvukkisala@marvell.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 X-Proofpoint-GUID: RNy2BFQTCPmcGAVxkUDNvJam5Hsx6PNw X-Proofpoint-ORIG-GUID: RNy2BFQTCPmcGAVxkUDNvJam5Hsx6PNw X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-06-25_07:2021-06-25, 2021-06-25 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)