test suite reviews and discussions
 help / color / mirror / Atom feed
From: "Tu, Lijuan" <lijuan.tu@intel.com>
To: "Ma, LihongX" <lihongx.ma@intel.com>, "dts@dpdk.org" <dts@dpdk.org>
Cc: "Ma, LihongX" <lihongx.ma@intel.com>
Subject: Re: [dts] [PATCH V2] tests/sriov_kvm: restart testpmd if execute	special cmd in cases
Date: Thu, 19 Dec 2019 07:41:55 +0000	[thread overview]
Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BB897D7@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: <1575485245-9041-1-git-send-email-lihongx.ma@intel.com>

Applied, thanks

> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of lihong
> Sent: Thursday, December 5, 2019 2:47 AM
> To: dts@dpdk.org
> Cc: Ma, LihongX <lihongx.ma@intel.com>
> Subject: [dts] [PATCH V2] tests/sriov_kvm: restart testpmd if execute special
> cmd in cases
> 
> if testpmd execute special cmd which maybe effect other cases, restart
> testpmd
> 
> Signed-off-by: lihong <lihongx.ma@intel.com>
> ---
>  tests/TestSuite_sriov_kvm.py | 23 ++++++++++++++++++++---
>  1 file changed, 20 insertions(+), 3 deletions(-)
> 
> diff --git a/tests/TestSuite_sriov_kvm.py b/tests/TestSuite_sriov_kvm.py
> index 546b01c..54148af 100644
> --- a/tests/TestSuite_sriov_kvm.py
> +++ b/tests/TestSuite_sriov_kvm.py
> @@ -51,6 +51,8 @@ class TestSriovKvm(TestCase):
>              self.dut.send_expect('modprobe vfio-pci', '#')
>          self.setup_2vm_2vf_env_flag = 0
>          self.setup_2vm_prerequisite_flag = 0
> +        self.vm0_testpmd = None
> +        self.vm1_testpmd = None
>          self.setup_2vm_2vf_env()
> 
>      def set_up(self):
> @@ -482,6 +484,12 @@ class TestSriovKvm(TestCase):
>              self.vm0_testpmd.execute_cmd('stop')
>              self.vm1_testpmd.execute_cmd('stop')
>          else:
> +            if self.vm0_testpmd:
> +                self.vm0_testpmd.quit()
> +                self.vm0_testpmd = None
> +            if self.vm1_testpmd:
> +                self.vm1_testpmd.quit()
> +                self.vm1_testpmd = None
>              self.vm0_dut_ports = self.vm_dut_0.get_ports('any')
>              self.vm0_testpmd = PmdOutput(self.vm_dut_0)
>              self.vm0_testpmd.start_testpmd(VM_CORES_MASK)
> @@ -532,7 +540,8 @@ class TestSriovKvm(TestCase):
>          self.vm0_testpmd.execute_cmd("set promisc all off")
>          self.vm0_testpmd.execute_cmd('start')
> 
> -        self.setup_2vm_prerequisite_flag = 1
> +        # restart testpmd after this cases, because in this case have set some
> special cmd
> +        self.setup_2vm_prerequisite_flag = 0
>          time.sleep(2)
> 
>          vm1_start_stats = self.vm1_testpmd.get_pmd_stats(port_id_0)
> @@ -715,6 +724,7 @@ class TestSriovKvm(TestCase):
>          self.verify(vm1_ret_stats['RX-packets'] == packet_num * 2, "Vlan mirror
> failed between VM0 and VM1!")
> 
>      def test_two_vms_vlan_and_pool_mirror(self):
> +        self.setup_2vm_prerequisite_flag = 0
>          self.vm0_testpmd.execute_cmd('vlan set strip on 0')
>          self.vm1_testpmd.execute_cmd('vlan set strip on 0')
>          port_id_0 = 0
> @@ -755,11 +765,11 @@ class TestSriovKvm(TestCase):
> 
>          vm0_ret_stats = self.calculate_stats(vm0_start_stats, vm0_end_stats)
> 
> -        self.verify(self.vm0_testpmd.check_tx_bytes(vm0_ret_stats['RX-
> packets'], 10 * packet_num),
> -                    "Vlan mirror failed between VM0 and VM1 when set vlan and
> pool mirror!")
>          self.host_testpmd.execute_cmd(
>              'rx_vlan rm %d port %d vf %s' % (vlan_id, port_id_0, vf_mask))
>          self.reset_port_all_mirror_rule(port_id_0)
> +        self.verify(self.vm0_testpmd.check_tx_bytes(vm0_ret_stats['RX-
> packets'], 10 * packet_num),
> +                    "Vlan mirror failed between VM0 and VM1 when set
> + vlan and pool mirror!")
> 
>      def test_two_vms_uplink_and_downlink_mirror(self):
>          """
> @@ -893,6 +903,7 @@ class TestSriovKvm(TestCase):
>          vf_num = 0
>          packet_num = 10
> 
> +        self.setup_2vm_prerequisite_flag = 0
>          for vf_mac in ["00:11:22:33:44:55", "00:55:44:33:22:11"]:
>              if self.nic.startswith('niantic') or self.nic.startswith('sage'):
>                  set_mac_cmd = "mac_addr add port %d vf %d %s"
> @@ -924,6 +935,7 @@ class TestSriovKvm(TestCase):
>              self.dut.logger.warning("NIC is [%s], skip this case" % self.nic)
>              return
> 
> +        self.setup_2vm_prerequisite_flag = 0
>          port_id_0 = 0
>          vf_mac = "00:11:22:33:44:55"
>          packet_num = 10
> @@ -975,6 +987,7 @@ class TestSriovKvm(TestCase):
>          port_id_0 = 0
>          packet_num = 10
> 
> +        self.setup_2vm_prerequisite_flag = 0
>          for vf_mac in ["00:55:44:33:22:11", "00:55:44:33:22:66"]:
>              self.host_testpmd.execute_cmd("set port %d uta %s on" %
>                                            (port_id_0, vf_mac)) @@ -1002,6 +1015,7 @@ class
> TestSriovKvm(TestCase):
>              self.dut.logger.warning("NIC is [%s], skip this case" % self.nic)
>              return
> 
> +        self.setup_2vm_prerequisite_flag = 0
>          port_id_0 = 0
>          vf_mac = "00:55:44:33:22:11"
>          packet_num = 10
> @@ -1039,6 +1053,7 @@ class TestSriovKvm(TestCase):
>              self.dut.logger.warning("NIC is [%s], skip this case" % self.nic)
>              return
> 
> +        self.setup_2vm_prerequisite_flag = 0
>          port_id_0 = 0
>          packet_num = 10
> 
> @@ -1080,6 +1095,7 @@ class TestSriovKvm(TestCase):
>          port_id_0 = 0
>          packet_num = 10
> 
> +        self.setup_2vm_prerequisite_flag = 0
>          for switch in ['on', 'off', 'on']:
>              self.host_testpmd.execute_cmd("set port %d vf 0 tx %s" %
>                                            (port_id_0, switch)) @@ -1114,6 +1130,7 @@ class
> TestSriovKvm(TestCase):
>          vf_mac = "FF:FF:FF:FF:FF:FF"
>          packet_num = 10
> 
> +        self.setup_2vm_prerequisite_flag = 0
>          for switch in ['on', 'off', 'on']:
>              self.host_testpmd.execute_cmd("set port %d vf 0 rxmode BAM %s" %
>                                            (port_id_0, switch))
> --
> 2.7.4


      parent reply	other threads:[~2019-12-19  7:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-04 18:47 lihong
2019-12-05  2:15 ` Zhang, YanX A
2019-12-05  2:16 ` Zhang, YanX A
2019-12-19  7:41 ` Tu, Lijuan [this message]

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=8CE3E05A3F976642AAB0F4675D0AD20E0BB897D7@SHSMSX101.ccr.corp.intel.com \
    --to=lijuan.tu@intel.com \
    --cc=dts@dpdk.org \
    --cc=lihongx.ma@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
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).