test suite reviews and discussions
 help / color / mirror / Atom feed
From: Lijuan Tu <lijuanx.a.tu@intel.com>
To: dts@dpdk.org
Cc: Lijuan Tu <lijuanx.a.tu@intel.com>
Subject: [dts] [PATCH V2]tests: stop port when configure tx_vlan
Date: Thu, 25 Jan 2018 19:27:04 +0800	[thread overview]
Message-ID: <1516879624-29246-1-git-send-email-lijuanx.a.tu@intel.com> (raw)

dpdk commit 597f9fafe13b ("app/testpmd: convert to new Tx offloads
API").
This patch requires us to stop port when configure the TX offloads.

Signed-off-by: Lijuan Tu <lijuanx.a.tu@intel.com>
---
 tests/TestSuite_dual_vlan.py | 22 ++++++++++++++++++++++
 tests/TestSuite_vf_vlan.py   |  3 +++
 tests/TestSuite_vlan.py      |  3 +++
 3 files changed, 28 insertions(+)

diff --git a/tests/TestSuite_dual_vlan.py b/tests/TestSuite_dual_vlan.py
index d2eb79b..db9d5f5 100644
--- a/tests/TestSuite_dual_vlan.py
+++ b/tests/TestSuite_dual_vlan.py
@@ -195,7 +195,11 @@ class TestDualVlan(TestCase):
         self.mode_config(strip=temp[0], filter=temp[1], qinq=temp[2])
 
         if (caseDef & txCase) != 0:
+            self.dut.send_expect('stop', "testpmd> ")
+            self.dut.send_expect('port stop all', "testpmd> ")
             self.dut.send_expect('tx_vlan set %s %s' % (dutTxPortId, txvlan), "testpmd> ")
+            self.dut.send_expect('port start all', "testpmd> ")
+            self.dut.send_expect('start', "testpmd> ")
 
         configMode = "Strip %s, filter %s 0x1, extend %s, insert %s" % (temp[0], temp[1], temp[2], "on" if (caseDef & txCase) != 0 else "off")
 
@@ -209,14 +213,23 @@ class TestDualVlan(TestCase):
             self.check_result(vlanCase[caseIndex][1], configMode + " result Error")
             self.dut.send_expect('rx_vlan rm %s %s' % (invlan, dutRxPortId), "testpmd> ")
             if (caseDef & txCase) != 0:
+                self.dut.send_expect('stop', "testpmd> ")
+                self.dut.send_expect('port stop all', "testpmd> ")
                 self.dut.send_expect('tx_vlan reset %s' % dutTxPortId, "testpmd> ")
+                self.dut.send_expect('port start all', "testpmd> ")
+                self.dut.send_expect('start', "testpmd> ")
+
         else:
             self.dut.send_expect('rx_vlan add %s %s' % (invlan, dutRxPortId), "testpmd> ")
             self.dut.send_expect('rx_vlan add %s %s' % (outvlan, dutRxPortId), "testpmd> ")
             self.vlan_send_packet(outvlan, invlan)
             self.check_result(vlanCase[caseIndex], configMode + " result Error")
             if (caseDef & txCase) != 0:
+                self.dut.send_expect('stop', "testpmd> ")
+                self.dut.send_expect('port stop all', "testpmd> ")
                 self.dut.send_expect('tx_vlan reset %s' % dutTxPortId, "testpmd> ")
+                self.dut.send_expect('port start all', "testpmd> ")
+                self.dut.send_expect('start', "testpmd> ")
             self.dut.send_expect('rx_vlan rm %s %s' % (invlan, dutRxPortId), "testpmd> ")
             self.dut.send_expect('rx_vlan rm %s %s' % (outvlan, dutRxPortId), "testpmd> ")
 
@@ -346,13 +359,22 @@ class TestDualVlan(TestCase):
         if(self.nic == "hartwell"):
             self.dut.send_expect("vlan set strip on %s" % dutTxPortId, "testpmd> ")
 
+        self.dut.send_expect("stop", "testpmd> ")
+        self.dut.send_expect("port stop all", "testpmd> ")
         self.dut.send_expect("tx_vlan set %s %s" % (dutTxPortId, txvlan), "testpmd> ")
+        self.dut.send_expect("port start all", "testpmd> ")
+        self.dut.send_expect("start", "testpmd> ")
 
         self.vlan_send_packet()
         out = self.get_tcpdump_package()
         self.verify("vlan %s" % txvlan in out, "vlan inset enalber error: " + out)
 
+        self.dut.send_expect("stop", "testpmd> ")
+        self.dut.send_expect("port stop all", "testpmd> ")
         self.dut.send_expect("tx_vlan reset %s" % dutTxPortId, "testpmd> ")
+        self.dut.send_expect("port start all", "testpmd> ")
+        self.dut.send_expect("start", "testpmd> ")
+
         self.vlan_send_packet()
         out = self.get_tcpdump_package()
         self.verify("vlan %s" % txvlan not in out, "vlan inset disable error: " + out)
diff --git a/tests/TestSuite_vf_vlan.py b/tests/TestSuite_vf_vlan.py
index be5512b..c0b26a3 100644
--- a/tests/TestSuite_vf_vlan.py
+++ b/tests/TestSuite_vf_vlan.py
@@ -290,7 +290,10 @@ class TestVfVlan(TestCase):
             # please enable rx_vlan at the same time
             if self.kdriver == "i40e":
                 self.vm0_testpmd.execute_cmd('rx_vlan add %d 0' % tx_vlan)
+            self.vm0_testpmd.execute_cmd('stop')
+            self.vm0_testpmd.execute_cmd('port stop all')
             self.vm0_testpmd.execute_cmd('tx_vlan set 0 %d' % tx_vlan)
+            self.vm0_testpmd.execute_cmd('port start all')
             self.tx_and_check(tx_vlan=tx_vlan)
 
         self.vm0_testpmd.quit()
diff --git a/tests/TestSuite_vlan.py b/tests/TestSuite_vlan.py
index dc68a6e..dad5f7b 100644
--- a/tests/TestSuite_vlan.py
+++ b/tests/TestSuite_vlan.py
@@ -205,7 +205,10 @@ class TestVlan(TestCase):
         intf = self.tester.get_interface(port)
 
         self.dut.send_expect("set nbport 2", "testpmd> ")
+        self.dut.send_expect("stop", "testpmd> ")
+        self.dut.send_expect("port stop all", "testpmd> ")
         self.dut.send_expect("tx_vlan set %s %d" % (dutTxPortId, self.vlan), "testpmd> ")
+        self.dut.send_expect("port start all", "testpmd> ")
 
         self.dut.send_expect("start", "testpmd> ")
         self.vlan_send_packet(-1)
-- 
1.8.3.1

             reply	other threads:[~2018-01-25  2:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-25 11:27 Lijuan Tu [this message]
2018-01-25 13:10 ` Liu, Yong

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=1516879624-29246-1-git-send-email-lijuanx.a.tu@intel.com \
    --to=lijuanx.a.tu@intel.com \
    --cc=dts@dpdk.org \
    /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).