test suite reviews and discussions
 help / color / Atom feed
* [dts] [PATCH V1] tests/runtime_vf_queue_number:use default core list
@ 2019-07-15 10:59 Jianwei Mei
  2019-08-06  9:26 ` Tu, Lijuan
  0 siblings, 1 reply; 2+ messages in thread
From: Jianwei Mei @ 2019-07-15 10:59 UTC (permalink / raw)
  To: dts; +Cc: Jianwei Mei

use default core list to instead of VM_CORES_MASK = 'all' and update code defect of test case test_reserve_valid_vf_qn. 


Signed-off-by: Jianwei Mei <jianweix.mei@intel.com>
---
 tests/TestSuite_runtime_vf_queue_number.py | 31 +++++++++++++++---------------
 1 file changed, 16 insertions(+), 15 deletions(-)

diff --git a/tests/TestSuite_runtime_vf_queue_number.py b/tests/TestSuite_runtime_vf_queue_number.py
index e825556..69d22fd 100644
--- a/tests/TestSuite_runtime_vf_queue_number.py
+++ b/tests/TestSuite_runtime_vf_queue_number.py
@@ -40,8 +40,6 @@ from qemu_kvm import QEMUKvm
 from test_case import TestCase
 from pmd_output import PmdOutput
 
-VM_CORES_MASK = 'all'
-
 class TestRuntimeVfQn(TestCase):
     supported_vf_driver = ['pci-stub', 'vfio-pci']
     def set_up_all(self):
@@ -54,6 +52,7 @@ class TestRuntimeVfQn(TestCase):
         self.pf_pci = self.dut.ports_info[self.dut_ports[0]]['pci']
         self.used_dut_port = self.dut_ports[0]
         self.vf_mac = "00:11:22:33:44:55"
+        self.pmdout = PmdOutput(self.dut)
 
     def set_up(self):
         self.dut.kill_all()
@@ -222,14 +221,15 @@ class TestRuntimeVfQn(TestCase):
         valid_qn = (2, 4, 8,)
         for qn in valid_qn:
             host_eal_param = '-w %s,queue-num-per-vf=%d --file-prefix=test1 --socket-mem 1024,1024' % (self.pf_pci, qn)
-            self.host_testpmd.start_testpmd(VM_CORES_MASK, param='', eal_param=host_eal_param)
+            self.host_testpmd.start_testpmd(self.pmdout.default_cores, param='', eal_param=host_eal_param)
 
             gest_eal_param = '-w %s --file-prefix=test2' % self.vm_dut_0.ports_info[0]['pci']
             self.vm0_testpmd = PmdOutput(self.vm_dut_0)
-            self.vm0_testpmd.start_testpmd(VM_CORES_MASK, eal_param=gest_eal_param, param='')
+            self.vm0_testpmd.start_testpmd(self.pmdout.default_cores, eal_param=gest_eal_param, param='')
             guest_cmds = self.testpmd_config_cmd_list(qn)
             self.execute_testpmd_cmd(guest_cmds)
             outstring = self.vm0_testpmd.execute_cmd("start", "testpmd> ")
+            self.logger.info(outstring)
             self.verify("port 0: RX queue number: %d Tx queue number: %d" % (qn, qn) in outstring, "The RX/TX queue number error.")
             self.vm0_dut_ports = self.vm_dut_0.get_ports('any')
             self.vf_mac = self.vm0_testpmd.get_port_mac(self.vm0_dut_ports[0])
@@ -239,13 +239,14 @@ class TestRuntimeVfQn(TestCase):
             guest_cmds1 = self.testpmd_config_cmd_list(qn + 1)
             self.execute_testpmd_cmd(guest_cmds1)
             outstring2 = self.vm0_testpmd.execute_cmd("start", "testpmd> ")
-            time.sleep(2)
+            self.logger.info(outstring2)
             self.verify("port 0: RX queue number: %d Tx queue number: %d" % ((qn + 1), (qn + 1)) in outstring2, "The RX/TX queue number error.")
             self.send_packet(self.vf_mac, self.src_intf, 254)
             outstring3 = self.vm0_testpmd.execute_cmd("stop", "testpmd> ")
-            time.sleep(2)
+            self.logger.info(outstring3)
             self.verify_queue_number(outstring3, qn + 1, 254)
             self.vm0_testpmd.execute_cmd('quit', '# ')
+            self.dut.send_expect("quit", "# ")
 
     def test_reserve_invalid_vf_qn(self):
         """
@@ -254,7 +255,7 @@ class TestRuntimeVfQn(TestCase):
         """
         for invalid_qn in (0, 3, 5, 6, 7, 9, 11, 15, 17, 25,):
             eal_param = '-w %s,queue-num-per-vf=%d --file-prefix=test1 --socket-mem 1024,1024' % (self.pf_pci, invalid_qn)
-            testpmd_out = self.host_testpmd.start_testpmd(VM_CORES_MASK, param='', eal_param=eal_param)
+            testpmd_out = self.host_testpmd.start_testpmd(self.pmdout.default_cores, param='', eal_param=eal_param)
             self.verify("it must be power of 2 and equal or less than 16" in testpmd_out, "there is no 'Wrong VF queue number = 0' logs.")
             self.dut.send_expect("quit", "# ")
 
@@ -264,20 +265,20 @@ class TestRuntimeVfQn(TestCase):
         :return:
         """
         host_eal_param = '-w %s --file-prefix=test1 --socket-mem 1024,1024' % self.pf_pci
-        self.host_testpmd.start_testpmd(VM_CORES_MASK, param='', eal_param=host_eal_param)
+        self.host_testpmd.start_testpmd(self.pmdout.default_cores, param='', eal_param=host_eal_param)
 
         gest_eal_param = '-w %s --file-prefix=test2' % self.vm_dut_0.ports_info[0]['pci']
         self.vm0_testpmd = PmdOutput(self.vm_dut_0)
         for valid_qn in range(1, 17):
             if valid_qn == 1:
-                self.vm0_testpmd.start_testpmd(VM_CORES_MASK, eal_param=gest_eal_param, param=' --rxq=1 --txq=1')
+                self.vm0_testpmd.start_testpmd(self.pmdout.default_cores, eal_param=gest_eal_param, param=' --rxq=1 --txq=1')
                 self.vm0_testpmd.execute_cmd('set verbose 1')
                 self.vm0_testpmd.execute_cmd("set promisc all off", "testpmd> ")
                 self.vm0_testpmd.execute_cmd("set fwd mac", "testpmd> ")
                 self.verify_result(valid_qn, 500)
                 self.vm0_testpmd.execute_cmd('quit', '# ')
             else:
-                self.vm0_testpmd.start_testpmd(VM_CORES_MASK, eal_param=gest_eal_param,
+                self.vm0_testpmd.start_testpmd(self.pmdout.default_cores, eal_param=gest_eal_param,
                                                param=' --rxq=%d --txq=%d' % (valid_qn, valid_qn))
                 self.vm0_testpmd.execute_cmd("set promisc all off", "testpmd> ")
                 self.vm0_testpmd.execute_cmd("set fwd mac", "testpmd> ")
@@ -290,7 +291,7 @@ class TestRuntimeVfQn(TestCase):
         :return:
         """
         host_eal_param = '-w %s --file-prefix=test1 --socket-mem 1024,1024' % self.pf_pci
-        self.host_testpmd.start_testpmd(VM_CORES_MASK, param='', eal_param=host_eal_param)
+        self.host_testpmd.start_testpmd(self.pmdout.default_cores, param='', eal_param=host_eal_param)
         gest_eal_param = '-w %s --file-prefix=test2' % self.vm_dut_0.ports_info[0]['pci']
         self.vm0_testpmd = PmdOutput(self.vm_dut_0)
 
@@ -311,11 +312,11 @@ class TestRuntimeVfQn(TestCase):
         :return:
         """
         host_eal_param = '-w %s --file-prefix=test1 --socket-mem 1024,1024' % self.pf_pci
-        self.host_testpmd.start_testpmd(VM_CORES_MASK, param='', eal_param=host_eal_param)
+        self.host_testpmd.start_testpmd(self.pmdout.default_cores, param='', eal_param=host_eal_param)
 
         gest_eal_param = '-w %s --file-prefix=test2' % self.vm_dut_0.ports_info[0]['pci']
         self.vm0_testpmd = PmdOutput(self.vm_dut_0)
-        self.vm0_testpmd.start_testpmd(VM_CORES_MASK, eal_param=gest_eal_param, param='')
+        self.vm0_testpmd.start_testpmd(self.pmdout.default_cores, eal_param=gest_eal_param, param='')
         for valid_qn in range(1, 17):
             if valid_qn == 1:
                 guest_cmds = self.testpmd_config_cmd_list(1)
@@ -346,7 +347,7 @@ class TestRuntimeVfQn(TestCase):
         :return:
         """
         host_eal_param = '-w %s,queue-num-per-vf=2 --file-prefix=test1 --socket-mem 1024,1024' % self.pf_pci
-        self.host_testpmd.start_testpmd(VM_CORES_MASK, param='', eal_param=host_eal_param)
+        self.host_testpmd.start_testpmd(self.pmdout.default_cores, param='', eal_param=host_eal_param)
         self.vm0_testpmd = PmdOutput(self.vm_dut_0)
         self.vm0_testpmd.execute_cmd("./usertools/dpdk-devbind.py -b i40evf %s" % self.vm_dut_0.ports_info[0]['pci'], expected='# ')
         # wait few seconds for link ready
@@ -372,4 +373,4 @@ class TestRuntimeVfQn(TestCase):
     def tear_down_all(self):
         self.destroy_vm_env()
         for port_id in self.dut_ports:
-            self.dut.destroy_sriov_vfs_by_port(port_id)
\ No newline at end of file
+            self.dut.destroy_sriov_vfs_by_port(port_id)
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dts] [PATCH V1] tests/runtime_vf_queue_number:use default core list
  2019-07-15 10:59 [dts] [PATCH V1] tests/runtime_vf_queue_number:use default core list Jianwei Mei
@ 2019-08-06  9:26 ` Tu, Lijuan
  0 siblings, 0 replies; 2+ messages in thread
From: Tu, Lijuan @ 2019-08-06  9:26 UTC (permalink / raw)
  To: Mei, JianweiX, dts; +Cc: Mei, JianweiX

Applied, thanks

> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Jianwei Mei
> Sent: Monday, July 15, 2019 6:59 PM
> To: dts@dpdk.org
> Cc: Mei, JianweiX <jianweix.mei@intel.com>
> Subject: [dts] [PATCH V1] tests/runtime_vf_queue_number:use default core
> list
> 
> use default core list to instead of VM_CORES_MASK = 'all' and update code
> defect of test case test_reserve_valid_vf_qn.
> 
> 
> Signed-off-by: Jianwei Mei <jianweix.mei@intel.com>
> ---
>  tests/TestSuite_runtime_vf_queue_number.py | 31 +++++++++++++++---------
> ------
>  1 file changed, 16 insertions(+), 15 deletions(-)
> 
> diff --git a/tests/TestSuite_runtime_vf_queue_number.py
> b/tests/TestSuite_runtime_vf_queue_number.py
> index e825556..69d22fd 100644
> --- a/tests/TestSuite_runtime_vf_queue_number.py
> +++ b/tests/TestSuite_runtime_vf_queue_number.py
> @@ -40,8 +40,6 @@ from qemu_kvm import QEMUKvm  from test_case
> import TestCase  from pmd_output import PmdOutput
> 
> -VM_CORES_MASK = 'all'
> -
>  class TestRuntimeVfQn(TestCase):
>      supported_vf_driver = ['pci-stub', 'vfio-pci']
>      def set_up_all(self):
> @@ -54,6 +52,7 @@ class TestRuntimeVfQn(TestCase):
>          self.pf_pci = self.dut.ports_info[self.dut_ports[0]]['pci']
>          self.used_dut_port = self.dut_ports[0]
>          self.vf_mac = "00:11:22:33:44:55"
> +        self.pmdout = PmdOutput(self.dut)
> 
>      def set_up(self):
>          self.dut.kill_all()
> @@ -222,14 +221,15 @@ class TestRuntimeVfQn(TestCase):
>          valid_qn = (2, 4, 8,)
>          for qn in valid_qn:
>              host_eal_param = '-w %s,queue-num-per-vf=%d --file-prefix=test1 --
> socket-mem 1024,1024' % (self.pf_pci, qn)
> -            self.host_testpmd.start_testpmd(VM_CORES_MASK, param='',
> eal_param=host_eal_param)
> +            self.host_testpmd.start_testpmd(self.pmdout.default_cores,
> + param='', eal_param=host_eal_param)
> 
>              gest_eal_param = '-w %s --file-prefix=test2' %
> self.vm_dut_0.ports_info[0]['pci']
>              self.vm0_testpmd = PmdOutput(self.vm_dut_0)
> -            self.vm0_testpmd.start_testpmd(VM_CORES_MASK,
> eal_param=gest_eal_param, param='')
> +            self.vm0_testpmd.start_testpmd(self.pmdout.default_cores,
> + eal_param=gest_eal_param, param='')
>              guest_cmds = self.testpmd_config_cmd_list(qn)
>              self.execute_testpmd_cmd(guest_cmds)
>              outstring = self.vm0_testpmd.execute_cmd("start", "testpmd> ")
> +            self.logger.info(outstring)
>              self.verify("port 0: RX queue number: %d Tx queue number: %d" %
> (qn, qn) in outstring, "The RX/TX queue number error.")
>              self.vm0_dut_ports = self.vm_dut_0.get_ports('any')
>              self.vf_mac = self.vm0_testpmd.get_port_mac(self.vm0_dut_ports[0])
> @@ -239,13 +239,14 @@ class TestRuntimeVfQn(TestCase):
>              guest_cmds1 = self.testpmd_config_cmd_list(qn + 1)
>              self.execute_testpmd_cmd(guest_cmds1)
>              outstring2 = self.vm0_testpmd.execute_cmd("start", "testpmd> ")
> -            time.sleep(2)
> +            self.logger.info(outstring2)
>              self.verify("port 0: RX queue number: %d Tx queue number: %d" %
> ((qn + 1), (qn + 1)) in outstring2, "The RX/TX queue number error.")
>              self.send_packet(self.vf_mac, self.src_intf, 254)
>              outstring3 = self.vm0_testpmd.execute_cmd("stop", "testpmd> ")
> -            time.sleep(2)
> +            self.logger.info(outstring3)
>              self.verify_queue_number(outstring3, qn + 1, 254)
>              self.vm0_testpmd.execute_cmd('quit', '# ')
> +            self.dut.send_expect("quit", "# ")
> 
>      def test_reserve_invalid_vf_qn(self):
>          """
> @@ -254,7 +255,7 @@ class TestRuntimeVfQn(TestCase):
>          """
>          for invalid_qn in (0, 3, 5, 6, 7, 9, 11, 15, 17, 25,):
>              eal_param = '-w %s,queue-num-per-vf=%d --file-prefix=test1 --socket-
> mem 1024,1024' % (self.pf_pci, invalid_qn)
> -            testpmd_out = self.host_testpmd.start_testpmd(VM_CORES_MASK,
> param='', eal_param=eal_param)
> +            testpmd_out =
> + self.host_testpmd.start_testpmd(self.pmdout.default_cores, param='',
> + eal_param=eal_param)
>              self.verify("it must be power of 2 and equal or less than 16" in
> testpmd_out, "there is no 'Wrong VF queue number = 0' logs.")
>              self.dut.send_expect("quit", "# ")
> 
> @@ -264,20 +265,20 @@ class TestRuntimeVfQn(TestCase):
>          :return:
>          """
>          host_eal_param = '-w %s --file-prefix=test1 --socket-mem 1024,1024' %
> self.pf_pci
> -        self.host_testpmd.start_testpmd(VM_CORES_MASK, param='',
> eal_param=host_eal_param)
> +        self.host_testpmd.start_testpmd(self.pmdout.default_cores,
> + param='', eal_param=host_eal_param)
> 
>          gest_eal_param = '-w %s --file-prefix=test2' %
> self.vm_dut_0.ports_info[0]['pci']
>          self.vm0_testpmd = PmdOutput(self.vm_dut_0)
>          for valid_qn in range(1, 17):
>              if valid_qn == 1:
> -                self.vm0_testpmd.start_testpmd(VM_CORES_MASK,
> eal_param=gest_eal_param, param=' --rxq=1 --txq=1')
> +
> + self.vm0_testpmd.start_testpmd(self.pmdout.default_cores,
> + eal_param=gest_eal_param, param=' --rxq=1 --txq=1')
>                  self.vm0_testpmd.execute_cmd('set verbose 1')
>                  self.vm0_testpmd.execute_cmd("set promisc all off", "testpmd> ")
>                  self.vm0_testpmd.execute_cmd("set fwd mac", "testpmd> ")
>                  self.verify_result(valid_qn, 500)
>                  self.vm0_testpmd.execute_cmd('quit', '# ')
>              else:
> -                self.vm0_testpmd.start_testpmd(VM_CORES_MASK,
> eal_param=gest_eal_param,
> +
> + self.vm0_testpmd.start_testpmd(self.pmdout.default_cores,
> + eal_param=gest_eal_param,
>                                                 param=' --rxq=%d --txq=%d' % (valid_qn,
> valid_qn))
>                  self.vm0_testpmd.execute_cmd("set promisc all off", "testpmd> ")
>                  self.vm0_testpmd.execute_cmd("set fwd mac", "testpmd> ") @@ -
> 290,7 +291,7 @@ class TestRuntimeVfQn(TestCase):
>          :return:
>          """
>          host_eal_param = '-w %s --file-prefix=test1 --socket-mem 1024,1024' %
> self.pf_pci
> -        self.host_testpmd.start_testpmd(VM_CORES_MASK, param='',
> eal_param=host_eal_param)
> +        self.host_testpmd.start_testpmd(self.pmdout.default_cores,
> + param='', eal_param=host_eal_param)
>          gest_eal_param = '-w %s --file-prefix=test2' %
> self.vm_dut_0.ports_info[0]['pci']
>          self.vm0_testpmd = PmdOutput(self.vm_dut_0)
> 
> @@ -311,11 +312,11 @@ class TestRuntimeVfQn(TestCase):
>          :return:
>          """
>          host_eal_param = '-w %s --file-prefix=test1 --socket-mem 1024,1024' %
> self.pf_pci
> -        self.host_testpmd.start_testpmd(VM_CORES_MASK, param='',
> eal_param=host_eal_param)
> +        self.host_testpmd.start_testpmd(self.pmdout.default_cores,
> + param='', eal_param=host_eal_param)
> 
>          gest_eal_param = '-w %s --file-prefix=test2' %
> self.vm_dut_0.ports_info[0]['pci']
>          self.vm0_testpmd = PmdOutput(self.vm_dut_0)
> -        self.vm0_testpmd.start_testpmd(VM_CORES_MASK,
> eal_param=gest_eal_param, param='')
> +        self.vm0_testpmd.start_testpmd(self.pmdout.default_cores,
> + eal_param=gest_eal_param, param='')
>          for valid_qn in range(1, 17):
>              if valid_qn == 1:
>                  guest_cmds = self.testpmd_config_cmd_list(1) @@ -346,7 +347,7
> @@ class TestRuntimeVfQn(TestCase):
>          :return:
>          """
>          host_eal_param = '-w %s,queue-num-per-vf=2 --file-prefix=test1 --
> socket-mem 1024,1024' % self.pf_pci
> -        self.host_testpmd.start_testpmd(VM_CORES_MASK, param='',
> eal_param=host_eal_param)
> +        self.host_testpmd.start_testpmd(self.pmdout.default_cores,
> + param='', eal_param=host_eal_param)
>          self.vm0_testpmd = PmdOutput(self.vm_dut_0)
>          self.vm0_testpmd.execute_cmd("./usertools/dpdk-devbind.py -b
> i40evf %s" % self.vm_dut_0.ports_info[0]['pci'], expected='# ')
>          # wait few seconds for link ready @@ -372,4 +373,4 @@ class
> TestRuntimeVfQn(TestCase):
>      def tear_down_all(self):
>          self.destroy_vm_env()
>          for port_id in self.dut_ports:
> -            self.dut.destroy_sriov_vfs_by_port(port_id)
> \ No newline at end of file
> +            self.dut.destroy_sriov_vfs_by_port(port_id)
> --
> 1.8.3.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-15 10:59 [dts] [PATCH V1] tests/runtime_vf_queue_number:use default core list Jianwei Mei
2019-08-06  9:26 ` Tu, Lijuan

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