test suite reviews and discussions
 help / color / mirror / Atom feed
From: <pvukkisala@marvell.com>
To: <dts@dpdk.org>
Cc: <sshankarnara@marvell.com>, Phanendra Vukkisala <pvukkisala@marvell.com>
Subject: [dts] [PATCH] hotplug.py: Change expected output to testpmd prompt.
Date: Sat, 26 Jun 2021 00:20:32 +0530	[thread overview]
Message-ID: <1624647032-22230-1-git-send-email-pvukkisala@marvell.com> (raw)

From: Phanendra Vukkisala <pvukkisala@marvell.com>

Due to not having testpmd as expected prompt, show port stats gets old output
causing test failure

Signed-off-by: Phanendra Vukkisala <pvukkisala@marvell.com>
---
 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


             reply	other threads:[~2021-06-25 18:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-25 18:50 pvukkisala [this message]
2021-06-27  7:17 pvukkisala
2021-07-01  8:45 ` Tu, Lijuan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1624647032-22230-1-git-send-email-pvukkisala@marvell.com \
    --to=pvukkisala@marvell.com \
    --cc=dts@dpdk.org \
    --cc=sshankarnara@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).