test suite reviews and discussions
 help / color / Atom feed
From: "Tu, Lijuan" <lijuan.tu@intel.com>
To: "Zeng, XiaoxiaoX" <xiaoxiaox.zeng@intel.com>,
	"dts@dpdk.org" <dts@dpdk.org>
Cc: "Zeng, XiaoxiaoX" <xiaoxiaox.zeng@intel.com>
Subject: Re: [dts] [PATCH V4] tests/port_control:modify e1000 part
Date: Tue, 18 Feb 2020 05:17:32 +0000
Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BBCB385@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: <1579246638-172212-1-git-send-email-xiaoxiaox.zeng@intel.com>

Applied, thanks

> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Zeng Xiaoxiao
> Sent: Friday, January 17, 2020 3:37 PM
> To: dts@dpdk.org
> Cc: Zeng, XiaoxiaoX <xiaoxiaox.zeng@intel.com>
> Subject: [dts] [PATCH V4] tests/port_control:modify e1000 part
> 
> *.e1000 device not support port stop and port reset.
> 
> Signed-off-by: Zeng Xiaoxiao <xiaoxiaox.zeng@intel.com>
> ---
>  tests/TestSuite_port_control.py | 22 +++++++++++++++-------
>  1 file changed, 15 insertions(+), 7 deletions(-)
> 
> diff --git a/tests/TestSuite_port_control.py b/tests/TestSuite_port_control.py
> index f006ddb..8d63fe7 100644
> --- a/tests/TestSuite_port_control.py
> +++ b/tests/TestSuite_port_control.py
> @@ -82,7 +82,6 @@ class TestPortControl(TestCase):
>          self.host_intf = self.dut.ports_info[self.used_dut_port]['intf']
>          self.dut.generate_sriov_vfs_by_port(self.used_dut_port, 1,
> driver=driver)
>          self.sriov_vfs_port = self.dut.ports_info[self.used_dut_port]['vfs_port']
> -        self.dut.send_expect("ip link set %s vf 0 mac %s" % (self.host_intf,
> self.vf_mac), "# ")
>          try:
>              for port in self.sriov_vfs_port:
>                  port.bind_driver(self.vf_assign_method)
> @@ -95,6 +94,8 @@ class TestPortControl(TestCase):
>              self.vm_dut = self.vm.start()
>              if self.vm_dut is None:
>                  raise Exception("Set up VM ENV failed!")
> +            else:
> +                self.start_vf_pmd(self.vm_dut)
> 
>              self.vm_testpmd = PmdOutput(self.vm_dut)
> 
> @@ -148,6 +149,17 @@ class TestPortControl(TestCase):
>                  if driver != driver_now:
>                      netdev.bind_driver(driver=driver)
> 
> +    def start_vf_pmd(self, terminal):
> +
> +        drive_info = terminal.send_expect("./usertools/dpdk-devbind.py -s",
> "#")
> +        vf_if = re.findall(r"if=(\w+)", drive_info.split("kernel")[1])
> +        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 %s %s" %
> (self.pf_default_driver, vf_pci[1]), "#")
> +        cmd = "./%s/app/testpmd -n 1 -w %s -- -i" % (self.target, vf_pci[1])
> +        terminal.send_expect(cmd, "testpmd>", 10)
> +
>      def start_testpmd(self, terminal):
>          terminal.start_testpmd(ports=[0], socket=self.socket)
>          res = terminal.wait_link_status_up('all', timeout=5) @@ -166,7 +178,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'):
> +        if self.nic.startswith('columbiaville') or terminal is self.vm_testpmd:
>              self.verify(ret != "", "port status error!")
>          else:
>              self.verify(ret == "down", "port not down!") @@ -174,7 +186,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'):
> +        if self.nic.startswith('columbiaville') or terminal is self.vm_testpmd:
>              self.verify(ret != "", "port status error!")
>          else:
>              self.verify(ret == "down", "port not down!") @@ -230,19 +242,15 @@
> class TestPortControl(TestCase):
> 
>      def test_e1000_start_stop_reset_close(self):
>          self.setup_vm_env()
> -        self.start_testpmd(self.vm_testpmd)
>          # start port
>          self.start_pmd_port(self.vm_testpmd)
> -        self.send_and_verify_packets(self.vm_testpmd)
>          # stop port and start port
>          self.stop_pmd_port(self.vm_testpmd)
>          self.start_pmd_port(self.vm_testpmd)
> -        self.send_and_verify_packets(self.vm_testpmd)
>          # reset port
>          self.stop_pmd_port(self.vm_testpmd)
>          self.reset_pmd_port(self.vm_testpmd)
>          self.start_pmd_port(self.vm_testpmd)
> -        self.send_and_verify_packets(self.vm_testpmd)
>          # close all port
>          self.stop_pmd_port(self.vm_testpmd)
>          self.close_pmd_port(self.vm_testpmd)
> --
> 1.8.3.1


      reply index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-17  7:37 Zeng Xiaoxiao
2020-02-18  5:17 ` Tu, Lijuan [this message]

Reply instructions:

You may reply publically 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=8CE3E05A3F976642AAB0F4675D0AD20E0BBCB385@SHSMSX101.ccr.corp.intel.com \
    --to=lijuan.tu@intel.com \
    --cc=dts@dpdk.org \
    --cc=xiaoxiaox.zeng@intel.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

test suite reviews and discussions

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/dts/0 dts/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dts dts/ http://inbox.dpdk.org/dts \
		dts@dpdk.org
	public-inbox-index dts


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dts


AGPL code for this site: git clone https://public-inbox.org/ public-inbox