[V1] tests/TestSuite_ieee1588:Modify sed command

Message ID 1600254387-20435-1-git-send-email-xix.zhang@intel.com (mailing list archive)
State Superseded
Headers
Series [V1] tests/TestSuite_ieee1588:Modify sed command |

Commit Message

Zhang, XiX Sept. 16, 2020, 11:06 a.m. UTC
Modify sed command 


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

Comments

Zhang, XiX Sept. 16, 2020, 11:06 a.m. UTC | #1
Tested-by: Zhang, XiX <xix.zhang@intel.com>

> -----Original Message-----
> From: Zhang, XiX
> Sent: Wednesday, September 16, 2020 7:06 PM
> To: dts@dpdk.org
> Cc: Zhang, XiX <xix.zhang@intel.com>
> Subject: [dts][PATCH V1] tests/TestSuite_ieee1588:Modify sed command
> 
> 
> Modify sed command
> 
> 
> Signed-off-by: xizhan4x <xix.zhang@intel.com>
> ---
>  tests/TestSuite_ieee1588.py | 15 ++++++++++-----
>  1 file changed, 10 insertions(+), 5 deletions(-)
> 
> diff --git a/tests/TestSuite_ieee1588.py b/tests/TestSuite_ieee1588.py index
> 19f17d1..8632286 100644
> --- a/tests/TestSuite_ieee1588.py
> +++ b/tests/TestSuite_ieee1588.py
> @@ -56,6 +56,7 @@ class TestIeee1588(TestCase):
>          # Change the config file to support IEEE1588 and recompile the
> package.
>          self.dut.send_expect(
>              "sed -i -e 's/IEEE1588=n$/IEEE1588=y/' config/common_base",
> "# ", 30)
> +        self.dut.set_build_options({'RTE_LIBRTE_IEEE1588': 'y'})
>          self.dut.skip_setup = False
>          self.dut.build_install_dpdk(self.target)
> 
> @@ -91,18 +92,21 @@ class TestIeee1588(TestCase):
>          port = self.tester.get_local_port(dutPorts[0])
>          itf = self.tester.get_interface(port)
> 
> -        self.tester.send_expect(
> -            "tcpdump -i %s -e ether src %s" % (itf, mac), "tcpdump", 20)
>          self.send_session = self.tester.create_session('send_session')
> +        self.send_session.send_expect(
> +            "tcpdump -i %s -e ether src %s" % (itf, mac), "tcpdump",
> + 20)
> +
>          setattr(self.send_session, 'tmp_file', self.tester.tmp_file)
> +        setattr(self.send_session, 'tmp_file',
> + self.tester.get_session_output)
>          pkt = Packet(pkt_type='TIMESYNC')
>          pkt.config_layer('ether', {'dst': mac})
> -        pkt.send_pkt(self.send_session, tx_port=itf)
> +        pkt.send_pkt(self.tester, tx_port=itf)
>          time.sleep(1)
> +
> +        out = self.send_session.get_session_output(timeout=20)
> +        self.send_session.send_expect("^C", "# ", 20)
>          self.send_session.close()
> -        out = self.tester.get_session_output(timeout=20)
> 
> -        self.tester.send_expect("^C", "# ", 20)
> 
>          self.verify("0x88f7" in out, "Ether type is not PTP")
> 
> @@ -171,4 +175,5 @@ class TestIeee1588(TestCase):
>          # Restore the config file and recompile the package.
>          self.dut.send_expect(
>              "sed -i -e 's/IEEE1588=y$/IEEE1588=n/' config/common_base",
> "# ", 30)
> +        self.dut.set_build_options({'RTE_LIBRTE_IEEE1588': 'n'})
>          self.dut.build_install_dpdk(self.target)
> --
> 1.8.3.1
  
Zhang, XiX Sept. 17, 2020, 5:19 a.m. UTC | #2
Hi  Lijuan
Please ignore this patch, I will re submit patch v2


Regards,
Zhang, Xi



> -----Original Message-----
> From: Zhang, XiX
> Sent: Wednesday, September 16, 2020 7:06 PM
> To: dts@dpdk.org
> Subject: RE: [dts][PATCH V1] tests/TestSuite_ieee1588:Modify sed command
> 
> Tested-by: Zhang, XiX <xix.zhang@intel.com>
> 
> > -----Original Message-----
> > From: Zhang, XiX
> > Sent: Wednesday, September 16, 2020 7:06 PM
> > To: dts@dpdk.org
> > Cc: Zhang, XiX <xix.zhang@intel.com>
> > Subject: [dts][PATCH V1] tests/TestSuite_ieee1588:Modify sed command
> >
> >
> > Modify sed command
> >
> >
> > Signed-off-by: xizhan4x <xix.zhang@intel.com>
> > ---
> >  tests/TestSuite_ieee1588.py | 15 ++++++++++-----
> >  1 file changed, 10 insertions(+), 5 deletions(-)
> >
> > diff --git a/tests/TestSuite_ieee1588.py b/tests/TestSuite_ieee1588.py
> > index
> > 19f17d1..8632286 100644
> > --- a/tests/TestSuite_ieee1588.py
> > +++ b/tests/TestSuite_ieee1588.py
> > @@ -56,6 +56,7 @@ class TestIeee1588(TestCase):
> >          # Change the config file to support IEEE1588 and recompile
> > the package.
> >          self.dut.send_expect(
> >              "sed -i -e 's/IEEE1588=n$/IEEE1588=y/'
> > config/common_base", "# ", 30)
> > +        self.dut.set_build_options({'RTE_LIBRTE_IEEE1588': 'y'})
> >          self.dut.skip_setup = False
> >          self.dut.build_install_dpdk(self.target)
> >
> > @@ -91,18 +92,21 @@ class TestIeee1588(TestCase):
> >          port = self.tester.get_local_port(dutPorts[0])
> >          itf = self.tester.get_interface(port)
> >
> > -        self.tester.send_expect(
> > -            "tcpdump -i %s -e ether src %s" % (itf, mac), "tcpdump", 20)
> >          self.send_session =
> > self.tester.create_session('send_session')
> > +        self.send_session.send_expect(
> > +            "tcpdump -i %s -e ether src %s" % (itf, mac), "tcpdump",
> > + 20)
> > +
> >          setattr(self.send_session, 'tmp_file', self.tester.tmp_file)
> > +        setattr(self.send_session, 'tmp_file',
> > + self.tester.get_session_output)
> >          pkt = Packet(pkt_type='TIMESYNC')
> >          pkt.config_layer('ether', {'dst': mac})
> > -        pkt.send_pkt(self.send_session, tx_port=itf)
> > +        pkt.send_pkt(self.tester, tx_port=itf)
> >          time.sleep(1)
> > +
> > +        out = self.send_session.get_session_output(timeout=20)
> > +        self.send_session.send_expect("^C", "# ", 20)
> >          self.send_session.close()
> > -        out = self.tester.get_session_output(timeout=20)
> >
> > -        self.tester.send_expect("^C", "# ", 20)
> >
> >          self.verify("0x88f7" in out, "Ether type is not PTP")
> >
> > @@ -171,4 +175,5 @@ class TestIeee1588(TestCase):
> >          # Restore the config file and recompile the package.
> >          self.dut.send_expect(
> >              "sed -i -e 's/IEEE1588=y$/IEEE1588=n/'
> > config/common_base", "# ", 30)
> > +        self.dut.set_build_options({'RTE_LIBRTE_IEEE1588': 'n'})
> >          self.dut.build_install_dpdk(self.target)
> > --
> > 1.8.3.1
  
Ma, LihongX Sept. 17, 2020, 8:21 a.m. UTC | #3
Acked-by: lihongx ma<lihongx.ma@intel.com>

Regards,
Ma,lihong

> -----Original Message-----
> From: dts <dts-bounces@dpdk.org> On Behalf Of xizhan4x
> Sent: Wednesday, September 16, 2020 7:06 PM
> To: dts@dpdk.org
> Cc: Zhang, XiX <xix.zhang@intel.com>
> Subject: [dts] [PATCH V1] tests/TestSuite_ieee1588:Modify sed command
> 
> 
> Modify sed command
> 
>
  
Zhang, XiX Sept. 22, 2020, 7:45 a.m. UTC | #4
Hi Lijuan
Please ignore this patch. Lingli has submitted the latest patch


Regards,
Zhang, Xi
> -----Original Message-----
> From: Ma, LihongX
> Sent: Thursday, September 17, 2020 4:21 PM
> To: Zhang, XiX <xix.zhang@intel.com>; dts@dpdk.org
> Cc: Zhang, XiX <xix.zhang@intel.com>
> Subject: RE: [dts] [PATCH V1] tests/TestSuite_ieee1588:Modify sed command
> 
> Acked-by: lihongx ma<lihongx.ma@intel.com>
>
  

Patch

diff --git a/tests/TestSuite_ieee1588.py b/tests/TestSuite_ieee1588.py
index 19f17d1..8632286 100644
--- a/tests/TestSuite_ieee1588.py
+++ b/tests/TestSuite_ieee1588.py
@@ -56,6 +56,7 @@  class TestIeee1588(TestCase):
         # Change the config file to support IEEE1588 and recompile the package.
         self.dut.send_expect(
             "sed -i -e 's/IEEE1588=n$/IEEE1588=y/' config/common_base", "# ", 30)
+        self.dut.set_build_options({'RTE_LIBRTE_IEEE1588': 'y'})
         self.dut.skip_setup = False
         self.dut.build_install_dpdk(self.target)
 
@@ -91,18 +92,21 @@  class TestIeee1588(TestCase):
         port = self.tester.get_local_port(dutPorts[0])
         itf = self.tester.get_interface(port)
 
-        self.tester.send_expect(
-            "tcpdump -i %s -e ether src %s" % (itf, mac), "tcpdump", 20)
         self.send_session = self.tester.create_session('send_session')
+        self.send_session.send_expect(
+            "tcpdump -i %s -e ether src %s" % (itf, mac), "tcpdump", 20)
+
         setattr(self.send_session, 'tmp_file', self.tester.tmp_file)
+        setattr(self.send_session, 'tmp_file', self.tester.get_session_output)
         pkt = Packet(pkt_type='TIMESYNC')
         pkt.config_layer('ether', {'dst': mac})
-        pkt.send_pkt(self.send_session, tx_port=itf)
+        pkt.send_pkt(self.tester, tx_port=itf)
         time.sleep(1)
+
+        out = self.send_session.get_session_output(timeout=20)
+        self.send_session.send_expect("^C", "# ", 20)
         self.send_session.close()
-        out = self.tester.get_session_output(timeout=20)
 
-        self.tester.send_expect("^C", "# ", 20)
 
         self.verify("0x88f7" in out, "Ether type is not PTP")
 
@@ -171,4 +175,5 @@  class TestIeee1588(TestCase):
         # Restore the config file and recompile the package.
         self.dut.send_expect(
             "sed -i -e 's/IEEE1588=y$/IEEE1588=n/' config/common_base", "# ", 30)
+        self.dut.set_build_options({'RTE_LIBRTE_IEEE1588': 'n'})
         self.dut.build_install_dpdk(self.target)