* [dts] [PATCH V1] tests/port_control: optimize code
@ 2020-04-10 5:13 Haiyang Zhao
2020-04-17 5:24 ` Zhao, XinfengX
2020-04-20 2:18 ` Tu, Lijuan
0 siblings, 2 replies; 3+ messages in thread
From: Haiyang Zhao @ 2020-04-10 5:13 UTC (permalink / raw)
To: dts; +Cc: Haiyang Zhao
*.when interface is active, bind to igb_uio will be failed,
flush ip and bind by force.
*.vm_testpmd is generated in the first case, if it failed will impact the
second case, add judgement for it.
Signed-off-by: Haiyang Zhao <haiyangx.zhao@intel.com>
---
tests/TestSuite_port_control.py | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/tests/TestSuite_port_control.py b/tests/TestSuite_port_control.py
index 385eff6..1a588d3 100644
--- a/tests/TestSuite_port_control.py
+++ b/tests/TestSuite_port_control.py
@@ -156,7 +156,8 @@ class TestPortControl(TestCase):
vf_pci = re.findall(r"(\d+.\d+.\d+.\d+)", drive_info.split("kernel")[1])
terminal.send_expect("ifconfig %s hw ether %s" % (vf_if[1], self.vf_mac), "#")
terminal.send_expect("ifconfig %s up" % vf_if[1], "#")
- terminal.send_expect("./usertools/dpdk-devbind.py -b igb_uio %s" % vf_pci[1], "#")
+ terminal.send_expect("ip addr flush %s " % vf_if[1], "#")
+ terminal.send_expect("./usertools/dpdk-devbind.py -b igb_uio --force %s" % vf_pci[1], "#")
cmd = "./%s/app/testpmd -n 1 -w %s -- -i" % (self.target, vf_pci[1])
terminal.send_expect(cmd, "testpmd>", 10)
@@ -178,7 +179,7 @@ class TestPortControl(TestCase):
terminal.execute_cmd("stop")
terminal.execute_cmd("port stop all")
ret = terminal.get_port_link_status(self.port_id_0)
- if self.nic.startswith('columbiaville') or terminal is self.vm_testpmd:
+ if self.nic.startswith('columbiaville') or (getattr(self, 'vm_testpmd', None) and terminal is self.vm_testpmd):
self.verify(ret != "", "port status error!")
else:
self.verify(ret == "down", "port not down!")
@@ -187,7 +188,7 @@ class TestPortControl(TestCase):
def reset_pmd_port(self, terminal):
terminal.execute_cmd("port reset all")
ret = terminal.get_port_link_status(self.port_id_0)
- if self.nic.startswith('columbiaville') or terminal is self.vm_testpmd:
+ if self.nic.startswith('columbiaville') or (getattr(self, 'vm_testpmd', None) and terminal is self.vm_testpmd):
self.verify(ret != "", "port status error!")
else:
self.verify(ret == "down", "port not down!")
--
2.20.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dts] [PATCH V1] tests/port_control: optimize code
2020-04-10 5:13 [dts] [PATCH V1] tests/port_control: optimize code Haiyang Zhao
@ 2020-04-17 5:24 ` Zhao, XinfengX
2020-04-20 2:18 ` Tu, Lijuan
1 sibling, 0 replies; 3+ messages in thread
From: Zhao, XinfengX @ 2020-04-17 5:24 UTC (permalink / raw)
To: dts; +Cc: Zhao, HaiyangX
[-- Attachment #1: Type: text/plain, Size: 2657 bytes --]
Tested-by: Zhao, Xinfeng<xinfengx.zhao@intel.com>
-----Original Message-----
From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Haiyang Zhao
Sent: Friday, April 10, 2020 1:14 PM
To: dts@dpdk.org
Cc: Zhao, HaiyangX <haiyangx.zhao@intel.com>
Subject: [dts] [PATCH V1] tests/port_control: optimize code
*.when interface is active, bind to igb_uio will be failed,
flush ip and bind by force.
*.vm_testpmd is generated in the first case, if it failed will impact the second case, add judgement for it.
Signed-off-by: Haiyang Zhao <haiyangx.zhao@intel.com>
---
tests/TestSuite_port_control.py | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/tests/TestSuite_port_control.py b/tests/TestSuite_port_control.py index 385eff6..1a588d3 100644
--- a/tests/TestSuite_port_control.py
+++ b/tests/TestSuite_port_control.py
@@ -156,7 +156,8 @@ class TestPortControl(TestCase):
vf_pci = re.findall(r"(\d+.\d+.\d+.\d+)", drive_info.split("kernel")[1])
terminal.send_expect("ifconfig %s hw ether %s" % (vf_if[1], self.vf_mac), "#")
terminal.send_expect("ifconfig %s up" % vf_if[1], "#")
- terminal.send_expect("./usertools/dpdk-devbind.py -b igb_uio %s" % vf_pci[1], "#")
+ terminal.send_expect("ip addr flush %s " % vf_if[1], "#")
+ terminal.send_expect("./usertools/dpdk-devbind.py -b igb_uio
+ --force %s" % vf_pci[1], "#")
cmd = "./%s/app/testpmd -n 1 -w %s -- -i" % (self.target, vf_pci[1])
terminal.send_expect(cmd, "testpmd>", 10)
@@ -178,7 +179,7 @@ class TestPortControl(TestCase):
terminal.execute_cmd("stop")
terminal.execute_cmd("port stop all")
ret = terminal.get_port_link_status(self.port_id_0)
- if self.nic.startswith('columbiaville') or terminal is self.vm_testpmd:
+ if self.nic.startswith('columbiaville') or (getattr(self, 'vm_testpmd', None) and terminal is self.vm_testpmd):
self.verify(ret != "", "port status error!")
else:
self.verify(ret == "down", "port not down!") @@ -187,7 +188,7 @@ class TestPortControl(TestCase):
def reset_pmd_port(self, terminal):
terminal.execute_cmd("port reset all")
ret = terminal.get_port_link_status(self.port_id_0)
- if self.nic.startswith('columbiaville') or terminal is self.vm_testpmd:
+ if self.nic.startswith('columbiaville') or (getattr(self, 'vm_testpmd', None) and terminal is self.vm_testpmd):
self.verify(ret != "", "port status error!")
else:
self.verify(ret == "down", "port not down!")
--
2.20.1
[-- Attachment #2: TestPortControl.log --]
[-- Type: application/octet-stream, Size: 80100 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dts] [PATCH V1] tests/port_control: optimize code
2020-04-10 5:13 [dts] [PATCH V1] tests/port_control: optimize code Haiyang Zhao
2020-04-17 5:24 ` Zhao, XinfengX
@ 2020-04-20 2:18 ` Tu, Lijuan
1 sibling, 0 replies; 3+ messages in thread
From: Tu, Lijuan @ 2020-04-20 2:18 UTC (permalink / raw)
To: Zhao, HaiyangX, dts; +Cc: Zhao, HaiyangX
Applied, thanks
> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Haiyang Zhao
> Sent: Friday, April 10, 2020 1:14 PM
> To: dts@dpdk.org
> Cc: Zhao, HaiyangX <haiyangx.zhao@intel.com>
> Subject: [dts] [PATCH V1] tests/port_control: optimize code
>
> *.when interface is active, bind to igb_uio will be failed,
> flush ip and bind by force.
> *.vm_testpmd is generated in the first case, if it failed will impact the
> second case, add judgement for it.
>
> Signed-off-by: Haiyang Zhao <haiyangx.zhao@intel.com>
> ---
> tests/TestSuite_port_control.py | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/tests/TestSuite_port_control.py b/tests/TestSuite_port_control.py
> index 385eff6..1a588d3 100644
> --- a/tests/TestSuite_port_control.py
> +++ b/tests/TestSuite_port_control.py
> @@ -156,7 +156,8 @@ class TestPortControl(TestCase):
> vf_pci = re.findall(r"(\d+.\d+.\d+.\d+)", drive_info.split("kernel")[1])
> terminal.send_expect("ifconfig %s hw ether %s" % (vf_if[1], self.vf_mac),
> "#")
> terminal.send_expect("ifconfig %s up" % vf_if[1], "#")
> - terminal.send_expect("./usertools/dpdk-devbind.py -b igb_uio %s" %
> vf_pci[1], "#")
> + terminal.send_expect("ip addr flush %s " % vf_if[1], "#")
> + terminal.send_expect("./usertools/dpdk-devbind.py -b igb_uio
> + --force %s" % vf_pci[1], "#")
> cmd = "./%s/app/testpmd -n 1 -w %s -- -i" % (self.target, vf_pci[1])
> terminal.send_expect(cmd, "testpmd>", 10)
>
> @@ -178,7 +179,7 @@ class TestPortControl(TestCase):
> terminal.execute_cmd("stop")
> terminal.execute_cmd("port stop all")
> ret = terminal.get_port_link_status(self.port_id_0)
> - if self.nic.startswith('columbiaville') or terminal is self.vm_testpmd:
> + if self.nic.startswith('columbiaville') or (getattr(self, 'vm_testpmd',
> None) and terminal is self.vm_testpmd):
> self.verify(ret != "", "port status error!")
> else:
> self.verify(ret == "down", "port not down!") @@ -187,7 +188,7 @@
> class TestPortControl(TestCase):
> def reset_pmd_port(self, terminal):
> terminal.execute_cmd("port reset all")
> ret = terminal.get_port_link_status(self.port_id_0)
> - if self.nic.startswith('columbiaville') or terminal is self.vm_testpmd:
> + if self.nic.startswith('columbiaville') or (getattr(self, 'vm_testpmd',
> None) and terminal is self.vm_testpmd):
> self.verify(ret != "", "port status error!")
> else:
> self.verify(ret == "down", "port not down!")
> --
> 2.20.1
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-04-20 2:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-10 5:13 [dts] [PATCH V1] tests/port_control: optimize code Haiyang Zhao
2020-04-17 5:24 ` Zhao, XinfengX
2020-04-20 2:18 ` Tu, Lijuan
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).