test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH] tests/cbdma: add multi app test
@ 2021-01-04  5:31 Kumar Amber
  2021-01-07  3:38 ` Tu, Lijuan
  0 siblings, 1 reply; 2+ messages in thread
From: Kumar Amber @ 2021-01-04  5:31 UTC (permalink / raw)
  To: dts

The test added implemnts test-pmd running
as primary app and iotfwd as secondary app.

Signed-off-by: Kumar Amber <kumar.amber@intel.com>
---
 test_plans/cbdma_test_plan.rst | 15 ++++++++++
 tests/TestSuite_cbdma.py       | 55 ++++++++++++++++++++++++++--------
 2 files changed, 57 insertions(+), 13 deletions(-)
 mode change 100644 => 100755 tests/TestSuite_cbdma.py

diff --git a/test_plans/cbdma_test_plan.rst b/test_plans/cbdma_test_plan.rst
index aee05a61..94167097 100644
--- a/test_plans/cbdma_test_plan.rst
+++ b/test_plans/cbdma_test_plan.rst
@@ -194,3 +194,18 @@ Test Case6: CBDMA performance cmparison between HW copies and SW copies using di
 7. Check performance from ioat app and compare with hw copy test::
 
     Total packets Tx:                   xxx [pps]
+
+Test Case7: CBDMA multi application mode test
+=============================================
+
+1.Bind four cbdma ports to ugb_uio driver.
+
+2.Launch test-pmd app with three cores and proc_type primary:
+
+./build/test-pmd -l 0-2 -n 2 -- -p 0x1 -q 4  --proc-type=primary
+
+3. Launch another ioatfwd app with three cores and proc_type secondary:
+
+./build/ioatfwd -l 0-2 -n 2 -- -p 0x1 -q 4  --proc-type=secondary
+
+4. check both the application should work and no one should report error.
diff --git a/tests/TestSuite_cbdma.py b/tests/TestSuite_cbdma.py
old mode 100644
new mode 100755
index 6a5be6a4..2685fc4f
--- a/tests/TestSuite_cbdma.py
+++ b/tests/TestSuite_cbdma.py
@@ -39,6 +39,7 @@ import time
 from test_case import TestCase
 from packet import Packet
 from pktgen import TRANSMIT_CONT
+from pmd_output import PmdOutput
 
 
 class TestCBDMA(TestCase):
@@ -55,9 +56,10 @@ class TestCBDMA(TestCase):
         self.ports_socket = self.dut.get_numa_id(self.dut_ports[0])
         self.get_cbdma_ports_info_and_bind_to_dpdk()
         out = self.dut.build_dpdk_apps('./examples/ioat')
-        self.app_path=self.dut.apps_name['ioat']
+        self.ioat_path = self.dut.apps_name['ioat']
         self.verify('Error' not in out, 'compilation ioat error')
 
+
     def set_up(self):
         """
         Run before each test case.
@@ -71,7 +73,7 @@ class TestCBDMA(TestCase):
         self.table_header.append("Updating MAC")
         self.table_header.append("% linerate")
         self.result_table_create(self.table_header)
-        self.send_session = self.dut.new_session("new_session")
+        self.send_session = self.dut.new_session("new_session")      
 
     def get_core_list(self):
         """
@@ -124,7 +126,7 @@ class TestCBDMA(TestCase):
             dev_info.append(self.cbdma_dev_infos[i])
         return dev_info
 
-    def launch_ioatfwd_app(self, eal_params):
+    def launch_ioatfwd_app(self, eal_params, session=None):
         """
         launch ioatfwd with different params
         """
@@ -140,17 +142,18 @@ class TestCBDMA(TestCase):
         when the cores num > 2, there will have 2 thread, and the max value of thread
         num is 2
         '''
-        # flush other output
-        target = self.app_path.split("/")
-        self.send_session.send_expect(f"cd  {'/'.join(target[0:-1])} ", '# ')
-        self.send_session.get_session_before(timeout=1)
-        cmd_command = "./"+target[-1] + eal_params + \
-                      '-- -p %s -q %d %s -c %s' % (hex(port_info),
-                      self.cbdma_ioat_dev_num/self.cbdma_nic_dev_num, mac_info,
-                      self.cbdma_copy_mode)
-        self.send_session.send_expect(cmd_command, f'{target[-1].strip()},')
+        if session is None:
+            session = self.send_session
+        expected = self.ioat_path.split('/')[-1].strip()
+        self.logger.info('expected: {}'.format(expected))
+        cmd_command = '%s %s %s %s -- -p %s -q %d %s -c %s' % (self.ioat_path, eal_params,
+                        self.cbdma_proc, self.v_dev, hex(port_info),
+                        self.cbdma_ioat_dev_num/self.cbdma_nic_dev_num, mac_info,
+                        self.cbdma_copy_mode)
+        out = session.send_expect(cmd_command, expected)
         time.sleep(1)
-        out = self.send_session.get_session_before(timeout=1)
+        out = session.get_session_before(timeout=1)
+        self.logger.info('out before: {}'.format(out))
         thread_num = 2 if self.cbdma_cores_num > 2 else 1
         o_thread_info = 'Worker Threads = %d' % thread_num
         o_copy_info = 'Copy Mode = %s' % self.cbdma_copy_mode
@@ -359,6 +362,32 @@ class TestCBDMA(TestCase):
         self.send_and_verify_throughput(check_channel=False)
         self.result_table_print()
 
+    def test_multi_app_mode(self):
+        """
+        CBDMA multi app tests for the simultanous exection of primary
+        and secondary app
+        """
+        self.cbdma_cores_num = 3
+        self.cbdma_nic_dev_num = 1
+        self.cbdma_ioat_dev_num = 4
+        self.cbdma_updating_mac = 'disable'
+        self.cbdma_copy_mode = 'hw'
+        self.v_dev = "--vdev net_null_0"
+        dev_info = self.get_ports_info()
+        dev_info.pop(0)
+        self.get_core_list()
+        self.pmdout = PmdOutput(self.dut)
+        self.pmdout.start_testpmd(cores='', eal_param='--vdev net_null_0 --proc-type=primary',
+                                    ports=dev_info)
+        self.pmdout.execute_cmd('port stop all')
+        self.cbdma_proc = '--proc-type=secondary'
+        eal_params = self.dut.create_eal_parameters(cores=self.core_list,
+                                        ports=dev_info)
+        self.launch_ioatfwd_app(eal_params)
+        self.send_session.send_expect('^C','#')
+        self.pmdout.execute_cmd('^C')
+        self.result_table_print()
+
     def tear_down(self):
         """
         Run after each test case.
-- 
2.25.1


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

* Re: [dts] [PATCH] tests/cbdma: add multi app test
  2021-01-04  5:31 [dts] [PATCH] tests/cbdma: add multi app test Kumar Amber
@ 2021-01-07  3:38 ` Tu, Lijuan
  0 siblings, 0 replies; 2+ messages in thread
From: Tu, Lijuan @ 2021-01-07  3:38 UTC (permalink / raw)
  To: Amber, Kumar, dts

> The test added implemnts test-pmd running as primary app and iotfwd as
> secondary app.
> 
> Signed-off-by: Kumar Amber <kumar.amber@intel.com>

Applied

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

end of thread, other threads:[~2021-01-07  3:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-04  5:31 [dts] [PATCH] tests/cbdma: add multi app test Kumar Amber
2021-01-07  3:38 ` Tu, Lijuan

test suite reviews and discussions

This inbox may be cloned and mirrored by anyone:

	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

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dts


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