[V1] tests/TestSuite_cbdma:Modify the start IOAT path

Message ID 1600322957-32663-1-git-send-email-xix.zhang@intel.com (mailing list archive)
State Accepted
Headers
Series [V1] tests/TestSuite_cbdma:Modify the start IOAT path |

Commit Message

Zhang, XiX Sept. 17, 2020, 6:09 a.m. UTC
  Modify the start IOAT path supoort meson build

Signed-off-by: xizhan4x <xix.zhang@intel.com>
---
 tests/TestSuite_cbdma.py | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
  

Comments

Zhang, XiX Sept. 17, 2020, 6:14 a.m. UTC | #1
Test-by: Zhang, XiX <xix.zhang@intel.com>

> -----Original Message-----
> From: Zhang, XiX
> Sent: Thursday, September 17, 2020 2:09 PM
> To: dts@dpdk.org
> Cc: Zhang, XiX <xix.zhang@intel.com>
> Subject: [dts][PATCH V1] tests/TestSuite_cbdma:Modify the start IOAT path
> 
> Modify the start IOAT path supoort meson build
> 
> Signed-off-by: xizhan4x <xix.zhang@intel.com>
> ---
>  tests/TestSuite_cbdma.py | 16 ++++++++++------
>  1 file changed, 10 insertions(+), 6 deletions(-)
> 
> diff --git a/tests/TestSuite_cbdma.py b/tests/TestSuite_cbdma.py index
> d7ca3ae..14611f0 100644
> --- a/tests/TestSuite_cbdma.py
> +++ b/tests/TestSuite_cbdma.py
> @@ -54,7 +54,8 @@ class TestCBDMA(TestCase):
>          self.verify(len(self.dut_ports) >= 2, "Insufficient ports for testing")
>          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/')
> +        out = self.dut.build_dpdk_apps('./examples/ioat')
> +        self.app_path=self.dut.apps_name['ioat']
>          self.verify('Error' not in out, 'compilation ioat error')
> 
>      def set_up(self):
> @@ -139,14 +140,17 @@ class TestCBDMA(TestCase):
>          num is 2
>          '''
>          # flush other output
> -        self.dut.get_session_output(timeout=1)
> -        cmd_command = './examples/ioat/build/ioatfwd ' + eal_params + \
> +        self.send_session=self.dut.new_session("new_session")
> +        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.dut.send_expect(cmd_command, 'ioatfwd,')
> +        self.send_session.send_expect(cmd_command,
> + f'{target[-1].strip()},')
>          time.sleep(1)
> -        out = self.dut.get_session_output(timeout=1)
> +        out = self.send_session.get_session_before(timeout=1)
>          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 @@
> -210,7 +214,7 @@ class TestCBDMA(TestCase):
>          """
>          Check stats of ioat app, each ioat channel can enqueue packets
>          """
> -        out = self.dut.get_session_output(timeout=2)
> +        out = self.send_session.get_session_before(timeout=2)
>          index = out.rfind('Statistics for port 0')
>          out = out[index:]
>          data_info = re.findall('successful_enqueues:\s*(\d*)', out)
> --
> 1.8.3.1
  
Wang, Yinan Sept. 22, 2020, 5:41 a.m. UTC | #2
Acked-by: Wang, Yinan <yinan.wang@intel.com>

> -----Original Message-----
> From: dts <dts-bounces@dpdk.org> On Behalf Of Zhang, XiX
> Sent: 2020年9月17日 14:14
> To: dts@dpdk.org
> Subject: Re: [dts] [PATCH V1] tests/TestSuite_cbdma:Modify the start IOAT
> path
> 
> Test-by: Zhang, XiX <xix.zhang@intel.com>
> 
> > -----Original Message-----
> > From: Zhang, XiX
> > Sent: Thursday, September 17, 2020 2:09 PM
> > To: dts@dpdk.org
> > Cc: Zhang, XiX <xix.zhang@intel.com>
> > Subject: [dts][PATCH V1] tests/TestSuite_cbdma:Modify the start IOAT
> path
> >
> > Modify the start IOAT path supoort meson build
> >
> > Signed-off-by: xizhan4x <xix.zhang@intel.com>
> > ---
> >  tests/TestSuite_cbdma.py | 16 ++++++++++------
> >  1 file changed, 10 insertions(+), 6 deletions(-)
> >
> > diff --git a/tests/TestSuite_cbdma.py b/tests/TestSuite_cbdma.py index
> > d7ca3ae..14611f0 100644
> > --- a/tests/TestSuite_cbdma.py
> > +++ b/tests/TestSuite_cbdma.py
> > @@ -54,7 +54,8 @@ class TestCBDMA(TestCase):
> >          self.verify(len(self.dut_ports) >= 2, "Insufficient ports for testing")
> >          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/')
> > +        out = self.dut.build_dpdk_apps('./examples/ioat')
> > +        self.app_path=self.dut.apps_name['ioat']
> >          self.verify('Error' not in out, 'compilation ioat error')
> >
> >      def set_up(self):
> > @@ -139,14 +140,17 @@ class TestCBDMA(TestCase):
> >          num is 2
> >          '''
> >          # flush other output
> > -        self.dut.get_session_output(timeout=1)
> > -        cmd_command = './examples/ioat/build/ioatfwd ' + eal_params + \
> > +        self.send_session=self.dut.new_session("new_session")
> > +        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.dut.send_expect(cmd_command, 'ioatfwd,')
> > +        self.send_session.send_expect(cmd_command,
> > + f'{target[-1].strip()},')
> >          time.sleep(1)
> > -        out = self.dut.get_session_output(timeout=1)
> > +        out = self.send_session.get_session_before(timeout=1)
> >          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 @@
> > -210,7 +214,7 @@ class TestCBDMA(TestCase):
> >          """
> >          Check stats of ioat app, each ioat channel can enqueue packets
> >          """
> > -        out = self.dut.get_session_output(timeout=2)
> > +        out = self.send_session.get_session_before(timeout=2)
> >          index = out.rfind('Statistics for port 0')
> >          out = out[index:]
> >          data_info = re.findall('successful_enqueues:\s*(\d*)', out)
> > --
> > 1.8.3.1
  
Tu, Lijuan Sept. 23, 2020, 7:31 a.m. UTC | #3
> Subject: [dts] [PATCH V1] tests/TestSuite_cbdma:Modify the start IOAT path
> 
> Modify the start IOAT path supoort meson build
> 
> Signed-off-by: xizhan4x <xix.zhang@intel.com>

Applied
  

Patch

diff --git a/tests/TestSuite_cbdma.py b/tests/TestSuite_cbdma.py
index d7ca3ae..14611f0 100644
--- a/tests/TestSuite_cbdma.py
+++ b/tests/TestSuite_cbdma.py
@@ -54,7 +54,8 @@  class TestCBDMA(TestCase):
         self.verify(len(self.dut_ports) >= 2, "Insufficient ports for testing")
         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/')
+        out = self.dut.build_dpdk_apps('./examples/ioat')
+        self.app_path=self.dut.apps_name['ioat']
         self.verify('Error' not in out, 'compilation ioat error')
 
     def set_up(self):
@@ -139,14 +140,17 @@  class TestCBDMA(TestCase):
         num is 2
         '''
         # flush other output
-        self.dut.get_session_output(timeout=1)
-        cmd_command = './examples/ioat/build/ioatfwd ' + eal_params + \
+        self.send_session=self.dut.new_session("new_session")
+        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.dut.send_expect(cmd_command, 'ioatfwd,')
+        self.send_session.send_expect(cmd_command, f'{target[-1].strip()},')
         time.sleep(1)
-        out = self.dut.get_session_output(timeout=1)
+        out = self.send_session.get_session_before(timeout=1)
         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
@@ -210,7 +214,7 @@  class TestCBDMA(TestCase):
         """
         Check stats of ioat app, each ioat channel can enqueue packets
         """
-        out = self.dut.get_session_output(timeout=2)
+        out = self.send_session.get_session_before(timeout=2)
         index = out.rfind('Statistics for port 0')
         out = out[index:]
         data_info = re.findall('successful_enqueues:\s*(\d*)', out)