test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH V1] tests/TestSuite_kernelpf_iavf.py:An abnormal exit needs to execute the same command as a normal exit.
@ 2019-11-06  7:54 Peng Zhihong
  2019-11-07  7:10 ` Ma, LihongX
  0 siblings, 1 reply; 5+ messages in thread
From: Peng Zhihong @ 2019-11-06  7:54 UTC (permalink / raw)
  To: dts; +Cc: Peng Zhihong

An abnormal exit needs to execute the same command as a normal exit.

Signed-off-by: Peng Zhihong <zhihongx.peng@intel.com>
---
 tests/TestSuite_kernelpf_iavf.py | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/tests/TestSuite_kernelpf_iavf.py b/tests/TestSuite_kernelpf_iavf.py
index 668eb28..89c22d3 100644
--- a/tests/TestSuite_kernelpf_iavf.py
+++ b/tests/TestSuite_kernelpf_iavf.py
@@ -47,6 +47,7 @@ from pmd_output import PmdOutput
 from settings import HEADER_SIZE
 from packet import Packet
 from utils import RED
+from exception import VerifyFailure
 
 VM_CORES_MASK = 'all'
 MAX_VLAN = 4095
@@ -336,18 +337,27 @@ class TestKernelpfIavf(TestCase):
         self.vm_testpmd.execute_cmd("start")
         self.send_random_pkt(self.vf_mac, count=1)
         out = self.vm_dut.get_session_output()
-        self.verify(self.vf_mac in out, 'vf receive pkt fail with current mac')
+        if self.vf_mac not in out:
+            self.dut.send_expect("ip link set dev %s vf 0 trust off" % self.host_intf, "# ")
+            raise VerifyFailure('allmulti all off vf receive pkt fail with current mac')
         self.send_random_pkt(multicast_mac, count=1)
         out = self.vm_dut.get_session_output()
-        self.verify(multicast_mac not in out, 'vf receive pkt with multicast mac')
+        if multicast_mac in out:
+            self.dut.send_expect("ip link set dev %s vf 0 trust off" % self.host_intf, "# ")
+            raise VerifyFailure('allmulti all off vf receive pkt with multicast mac')
 
         self.vm_testpmd.execute_cmd("set allmulti all on")
         self.send_random_pkt(self.vf_mac, count=1)
         out = self.vm_dut.get_session_output()
-        self.verify(self.vf_mac in out, 'vf receive pkt fail with current mac')
+        if self.vf_mac not in out:
+            self.dut.send_expect("ip link set dev %s vf 0 trust off" % self.host_intf, "# ")
+            raise VerifyFailure('allmulti all on vf receive pkt fail with current mac')
         self.send_random_pkt(multicast_mac, count=1)
         out = self.vm_dut.get_session_output()
-        self.verify(multicast_mac in out, 'vf receive pkt fail with multicast mac')
+        if multicast_mac not in out:
+            self.dut.send_expect("ip link set dev %s vf 0 trust off" % self.host_intf, "# ")
+            raise VerifyFailure('allmulti all on vf receive pkt fail with multicast mac')
+
         self.dut.send_expect("ip link set dev %s vf 0 trust off" % self.host_intf, "# ")
 
     def test_vf_broadcast(self):
-- 
2.17.1


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

* Re: [dts] [PATCH V1] tests/TestSuite_kernelpf_iavf.py:An abnormal exit needs to execute the same command as a normal exit.
  2019-11-06  7:54 [dts] [PATCH V1] tests/TestSuite_kernelpf_iavf.py:An abnormal exit needs to execute the same command as a normal exit Peng Zhihong
@ 2019-11-07  7:10 ` Ma, LihongX
  2019-11-07  7:21   ` Peng, ZhihongX
  0 siblings, 1 reply; 5+ messages in thread
From: Ma, LihongX @ 2019-11-07  7:10 UTC (permalink / raw)
  To: Peng, ZhihongX, dts; +Cc: Peng, ZhihongX

Hi, zhihong
I saw the cmd ' self.dut.send_expect("ip link set dev %s vf 0 trust off" % self.host_intf, "# ")' have been execute in tear_down
So I think you don't need execute it before every verify.

-----Original Message-----
From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Peng Zhihong
Sent: Wednesday, November 6, 2019 3:55 PM
To: dts@dpdk.org
Cc: Peng, ZhihongX <zhihongx.peng@intel.com>
Subject: [dts] [PATCH V1] tests/TestSuite_kernelpf_iavf.py:An abnormal exit needs to execute the same command as a normal exit.

An abnormal exit needs to execute the same command as a normal exit.

Signed-off-by: Peng Zhihong <zhihongx.peng@intel.com>
---
 tests/TestSuite_kernelpf_iavf.py | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/tests/TestSuite_kernelpf_iavf.py b/tests/TestSuite_kernelpf_iavf.py
index 668eb28..89c22d3 100644
--- a/tests/TestSuite_kernelpf_iavf.py
+++ b/tests/TestSuite_kernelpf_iavf.py
@@ -47,6 +47,7 @@ from pmd_output import PmdOutput  from settings import HEADER_SIZE  from packet import Packet  from utils import RED
+from exception import VerifyFailure
 
 VM_CORES_MASK = 'all'
 MAX_VLAN = 4095
@@ -336,18 +337,27 @@ class TestKernelpfIavf(TestCase):
         self.vm_testpmd.execute_cmd("start")
         self.send_random_pkt(self.vf_mac, count=1)
         out = self.vm_dut.get_session_output()
-        self.verify(self.vf_mac in out, 'vf receive pkt fail with current mac')
+        if self.vf_mac not in out:
+            self.dut.send_expect("ip link set dev %s vf 0 trust off" % self.host_intf, "# ")
+            raise VerifyFailure('allmulti all off vf receive pkt fail 
+ with current mac')
         self.send_random_pkt(multicast_mac, count=1)
         out = self.vm_dut.get_session_output()
-        self.verify(multicast_mac not in out, 'vf receive pkt with multicast mac')
+        if multicast_mac in out:
+            self.dut.send_expect("ip link set dev %s vf 0 trust off" % self.host_intf, "# ")
+            raise VerifyFailure('allmulti all off vf receive pkt with 
+ multicast mac')
 
         self.vm_testpmd.execute_cmd("set allmulti all on")
         self.send_random_pkt(self.vf_mac, count=1)
         out = self.vm_dut.get_session_output()
-        self.verify(self.vf_mac in out, 'vf receive pkt fail with current mac')
+        if self.vf_mac not in out:
+            self.dut.send_expect("ip link set dev %s vf 0 trust off" % self.host_intf, "# ")
+            raise VerifyFailure('allmulti all on vf receive pkt fail 
+ with current mac')
         self.send_random_pkt(multicast_mac, count=1)
         out = self.vm_dut.get_session_output()
-        self.verify(multicast_mac in out, 'vf receive pkt fail with multicast mac')
+        if multicast_mac not in out:
+            self.dut.send_expect("ip link set dev %s vf 0 trust off" % self.host_intf, "# ")
+            raise VerifyFailure('allmulti all on vf receive pkt fail 
+ with multicast mac')
+
         self.dut.send_expect("ip link set dev %s vf 0 trust off" % self.host_intf, "# ")
 
     def test_vf_broadcast(self):
--
2.17.1


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

* Re: [dts] [PATCH V1] tests/TestSuite_kernelpf_iavf.py:An abnormal exit needs to execute the same command as a normal exit.
  2019-11-07  7:10 ` Ma, LihongX
@ 2019-11-07  7:21   ` Peng, ZhihongX
  2019-11-08  5:12     ` Ma, LihongX
  0 siblings, 1 reply; 5+ messages in thread
From: Peng, ZhihongX @ 2019-11-07  7:21 UTC (permalink / raw)
  To: Ma, LihongX, dts

This case is executed twice, because the case was executed once when it was successful, so the exception exit is executed once for consistency.

-----Original Message-----
From: Ma, LihongX 
Sent: Thursday, November 7, 2019 3:11 PM
To: Peng, ZhihongX <zhihongx.peng@intel.com>; dts@dpdk.org
Cc: Peng, ZhihongX <zhihongx.peng@intel.com>
Subject: RE: [dts] [PATCH V1] tests/TestSuite_kernelpf_iavf.py:An abnormal exit needs to execute the same command as a normal exit.

Hi, zhihong
I saw the cmd ' self.dut.send_expect("ip link set dev %s vf 0 trust off" % self.host_intf, "# ")' have been execute in tear_down So I think you don't need execute it before every verify.

-----Original Message-----
From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Peng Zhihong
Sent: Wednesday, November 6, 2019 3:55 PM
To: dts@dpdk.org
Cc: Peng, ZhihongX <zhihongx.peng@intel.com>
Subject: [dts] [PATCH V1] tests/TestSuite_kernelpf_iavf.py:An abnormal exit needs to execute the same command as a normal exit.

An abnormal exit needs to execute the same command as a normal exit.

Signed-off-by: Peng Zhihong <zhihongx.peng@intel.com>
---
 tests/TestSuite_kernelpf_iavf.py | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/tests/TestSuite_kernelpf_iavf.py b/tests/TestSuite_kernelpf_iavf.py
index 668eb28..89c22d3 100644
--- a/tests/TestSuite_kernelpf_iavf.py
+++ b/tests/TestSuite_kernelpf_iavf.py
@@ -47,6 +47,7 @@ from pmd_output import PmdOutput  from settings import HEADER_SIZE  from packet import Packet  from utils import RED
+from exception import VerifyFailure
 
 VM_CORES_MASK = 'all'
 MAX_VLAN = 4095
@@ -336,18 +337,27 @@ class TestKernelpfIavf(TestCase):
         self.vm_testpmd.execute_cmd("start")
         self.send_random_pkt(self.vf_mac, count=1)
         out = self.vm_dut.get_session_output()
-        self.verify(self.vf_mac in out, 'vf receive pkt fail with current mac')
+        if self.vf_mac not in out:
+            self.dut.send_expect("ip link set dev %s vf 0 trust off" % self.host_intf, "# ")
+            raise VerifyFailure('allmulti all off vf receive pkt fail 
+ with current mac')
         self.send_random_pkt(multicast_mac, count=1)
         out = self.vm_dut.get_session_output()
-        self.verify(multicast_mac not in out, 'vf receive pkt with multicast mac')
+        if multicast_mac in out:
+            self.dut.send_expect("ip link set dev %s vf 0 trust off" % self.host_intf, "# ")
+            raise VerifyFailure('allmulti all off vf receive pkt with 
+ multicast mac')
 
         self.vm_testpmd.execute_cmd("set allmulti all on")
         self.send_random_pkt(self.vf_mac, count=1)
         out = self.vm_dut.get_session_output()
-        self.verify(self.vf_mac in out, 'vf receive pkt fail with current mac')
+        if self.vf_mac not in out:
+            self.dut.send_expect("ip link set dev %s vf 0 trust off" % self.host_intf, "# ")
+            raise VerifyFailure('allmulti all on vf receive pkt fail 
+ with current mac')
         self.send_random_pkt(multicast_mac, count=1)
         out = self.vm_dut.get_session_output()
-        self.verify(multicast_mac in out, 'vf receive pkt fail with multicast mac')
+        if multicast_mac not in out:
+            self.dut.send_expect("ip link set dev %s vf 0 trust off" % self.host_intf, "# ")
+            raise VerifyFailure('allmulti all on vf receive pkt fail 
+ with multicast mac')
+
         self.dut.send_expect("ip link set dev %s vf 0 trust off" % self.host_intf, "# ")
 
     def test_vf_broadcast(self):
--
2.17.1


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

* Re: [dts] [PATCH V1] tests/TestSuite_kernelpf_iavf.py:An abnormal exit needs to execute the same command as a normal exit.
  2019-11-07  7:21   ` Peng, ZhihongX
@ 2019-11-08  5:12     ` Ma, LihongX
  2019-11-22  6:09       ` Tu, Lijuan
  0 siblings, 1 reply; 5+ messages in thread
From: Ma, LihongX @ 2019-11-08  5:12 UTC (permalink / raw)
  To: Peng, ZhihongX, dts

If like that, I think we should put more time to verify it.

-----Original Message-----
From: Peng, ZhihongX 
Sent: Thursday, November 7, 2019 3:21 PM
To: Ma, LihongX <lihongx.ma@intel.com>; dts@dpdk.org
Subject: RE: [dts] [PATCH V1] tests/TestSuite_kernelpf_iavf.py:An abnormal exit needs to execute the same command as a normal exit.

This case is executed twice, because the case was executed once when it was successful, so the exception exit is executed once for consistency.

-----Original Message-----
From: Ma, LihongX
Sent: Thursday, November 7, 2019 3:11 PM
To: Peng, ZhihongX <zhihongx.peng@intel.com>; dts@dpdk.org
Cc: Peng, ZhihongX <zhihongx.peng@intel.com>
Subject: RE: [dts] [PATCH V1] tests/TestSuite_kernelpf_iavf.py:An abnormal exit needs to execute the same command as a normal exit.

Hi, zhihong
I saw the cmd ' self.dut.send_expect("ip link set dev %s vf 0 trust off" % self.host_intf, "# ")' have been execute in tear_down So I think you don't need execute it before every verify.

-----Original Message-----
From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Peng Zhihong
Sent: Wednesday, November 6, 2019 3:55 PM
To: dts@dpdk.org
Cc: Peng, ZhihongX <zhihongx.peng@intel.com>
Subject: [dts] [PATCH V1] tests/TestSuite_kernelpf_iavf.py:An abnormal exit needs to execute the same command as a normal exit.

An abnormal exit needs to execute the same command as a normal exit.

Signed-off-by: Peng Zhihong <zhihongx.peng@intel.com>
---
 tests/TestSuite_kernelpf_iavf.py | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/tests/TestSuite_kernelpf_iavf.py b/tests/TestSuite_kernelpf_iavf.py
index 668eb28..89c22d3 100644
--- a/tests/TestSuite_kernelpf_iavf.py
+++ b/tests/TestSuite_kernelpf_iavf.py
@@ -47,6 +47,7 @@ from pmd_output import PmdOutput  from settings import HEADER_SIZE  from packet import Packet  from utils import RED
+from exception import VerifyFailure
 
 VM_CORES_MASK = 'all'
 MAX_VLAN = 4095
@@ -336,18 +337,27 @@ class TestKernelpfIavf(TestCase):
         self.vm_testpmd.execute_cmd("start")
         self.send_random_pkt(self.vf_mac, count=1)
         out = self.vm_dut.get_session_output()
-        self.verify(self.vf_mac in out, 'vf receive pkt fail with current mac')
+        if self.vf_mac not in out:
+            self.dut.send_expect("ip link set dev %s vf 0 trust off" % self.host_intf, "# ")
+            raise VerifyFailure('allmulti all off vf receive pkt fail 
+ with current mac')
         self.send_random_pkt(multicast_mac, count=1)
         out = self.vm_dut.get_session_output()
-        self.verify(multicast_mac not in out, 'vf receive pkt with multicast mac')
+        if multicast_mac in out:
+            self.dut.send_expect("ip link set dev %s vf 0 trust off" % self.host_intf, "# ")
+            raise VerifyFailure('allmulti all off vf receive pkt with 
+ multicast mac')
 
         self.vm_testpmd.execute_cmd("set allmulti all on")
         self.send_random_pkt(self.vf_mac, count=1)
         out = self.vm_dut.get_session_output()
-        self.verify(self.vf_mac in out, 'vf receive pkt fail with current mac')
+        if self.vf_mac not in out:
+            self.dut.send_expect("ip link set dev %s vf 0 trust off" % self.host_intf, "# ")
+            raise VerifyFailure('allmulti all on vf receive pkt fail 
+ with current mac')
         self.send_random_pkt(multicast_mac, count=1)
         out = self.vm_dut.get_session_output()
-        self.verify(multicast_mac in out, 'vf receive pkt fail with multicast mac')
+        if multicast_mac not in out:
+            self.dut.send_expect("ip link set dev %s vf 0 trust off" % self.host_intf, "# ")
+            raise VerifyFailure('allmulti all on vf receive pkt fail 
+ with multicast mac')
+
         self.dut.send_expect("ip link set dev %s vf 0 trust off" % self.host_intf, "# ")
 
     def test_vf_broadcast(self):
--
2.17.1


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

* Re: [dts] [PATCH V1] tests/TestSuite_kernelpf_iavf.py:An abnormal exit needs to execute the same command as a normal exit.
  2019-11-08  5:12     ` Ma, LihongX
@ 2019-11-22  6:09       ` Tu, Lijuan
  0 siblings, 0 replies; 5+ messages in thread
From: Tu, Lijuan @ 2019-11-22  6:09 UTC (permalink / raw)
  To: Ma, LihongX, Peng, ZhihongX, dts

Tear_down will be executed whatever the case is successful or failure. Every case will start from set_up and end with tear_down.
So I don't think it's reasonable to have this patch.

Another sighting, it's better to get current "trust setting" before you change it, and then restore it after your testing.

> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Ma, LihongX
> Sent: Friday, November 8, 2019 1:12 PM
> To: Peng, ZhihongX <zhihongx.peng@intel.com>; dts@dpdk.org
> Subject: Re: [dts] [PATCH V1] tests/TestSuite_kernelpf_iavf.py:An abnormal
> exit needs to execute the same command as a normal exit.
> 
> If like that, I think we should put more time to verify it.
> 
> -----Original Message-----
> From: Peng, ZhihongX
> Sent: Thursday, November 7, 2019 3:21 PM
> To: Ma, LihongX <lihongx.ma@intel.com>; dts@dpdk.org
> Subject: RE: [dts] [PATCH V1] tests/TestSuite_kernelpf_iavf.py:An abnormal
> exit needs to execute the same command as a normal exit.
> 
> This case is executed twice, because the case was executed once when it was
> successful, so the exception exit is executed once for consistency.
> 
> -----Original Message-----
> From: Ma, LihongX
> Sent: Thursday, November 7, 2019 3:11 PM
> To: Peng, ZhihongX <zhihongx.peng@intel.com>; dts@dpdk.org
> Cc: Peng, ZhihongX <zhihongx.peng@intel.com>
> Subject: RE: [dts] [PATCH V1] tests/TestSuite_kernelpf_iavf.py:An abnormal
> exit needs to execute the same command as a normal exit.
> 
> Hi, zhihong
> I saw the cmd ' self.dut.send_expect("ip link set dev %s vf 0 trust off" %
> self.host_intf, "# ")' have been execute in tear_down So I think you don't
> need execute it before every verify.
> 
> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Peng Zhihong
> Sent: Wednesday, November 6, 2019 3:55 PM
> To: dts@dpdk.org
> Cc: Peng, ZhihongX <zhihongx.peng@intel.com>
> Subject: [dts] [PATCH V1] tests/TestSuite_kernelpf_iavf.py:An abnormal exit
> needs to execute the same command as a normal exit.
> 
> An abnormal exit needs to execute the same command as a normal exit.
> 
> Signed-off-by: Peng Zhihong <zhihongx.peng@intel.com>
> ---
>  tests/TestSuite_kernelpf_iavf.py | 18 ++++++++++++++----
>  1 file changed, 14 insertions(+), 4 deletions(-)
> 
> diff --git a/tests/TestSuite_kernelpf_iavf.py
> b/tests/TestSuite_kernelpf_iavf.py
> index 668eb28..89c22d3 100644
> --- a/tests/TestSuite_kernelpf_iavf.py
> +++ b/tests/TestSuite_kernelpf_iavf.py
> @@ -47,6 +47,7 @@ from pmd_output import PmdOutput  from settings
> import HEADER_SIZE  from packet import Packet  from utils import RED
> +from exception import VerifyFailure
> 
>  VM_CORES_MASK = 'all'
>  MAX_VLAN = 4095
> @@ -336,18 +337,27 @@ class TestKernelpfIavf(TestCase):
>          self.vm_testpmd.execute_cmd("start")
>          self.send_random_pkt(self.vf_mac, count=1)
>          out = self.vm_dut.get_session_output()
> -        self.verify(self.vf_mac in out, 'vf receive pkt fail with current mac')
> +        if self.vf_mac not in out:
> +            self.dut.send_expect("ip link set dev %s vf 0 trust off" % self.host_intf,
> "# ")
> +            raise VerifyFailure('allmulti all off vf receive pkt fail
> + with current mac')
>          self.send_random_pkt(multicast_mac, count=1)
>          out = self.vm_dut.get_session_output()
> -        self.verify(multicast_mac not in out, 'vf receive pkt with multicast mac')
> +        if multicast_mac in out:
> +            self.dut.send_expect("ip link set dev %s vf 0 trust off" % self.host_intf,
> "# ")
> +            raise VerifyFailure('allmulti all off vf receive pkt with
> + multicast mac')
> 
>          self.vm_testpmd.execute_cmd("set allmulti all on")
>          self.send_random_pkt(self.vf_mac, count=1)
>          out = self.vm_dut.get_session_output()
> -        self.verify(self.vf_mac in out, 'vf receive pkt fail with current mac')
> +        if self.vf_mac not in out:
> +            self.dut.send_expect("ip link set dev %s vf 0 trust off" % self.host_intf,
> "# ")
> +            raise VerifyFailure('allmulti all on vf receive pkt fail
> + with current mac')
>          self.send_random_pkt(multicast_mac, count=1)
>          out = self.vm_dut.get_session_output()
> -        self.verify(multicast_mac in out, 'vf receive pkt fail with multicast mac')
> +        if multicast_mac not in out:
> +            self.dut.send_expect("ip link set dev %s vf 0 trust off" % self.host_intf,
> "# ")
> +            raise VerifyFailure('allmulti all on vf receive pkt fail
> + with multicast mac')
> +
>          self.dut.send_expect("ip link set dev %s vf 0 trust off" % self.host_intf,
> "# ")
> 
>      def test_vf_broadcast(self):
> --
> 2.17.1


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

end of thread, other threads:[~2019-11-22  6:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-06  7:54 [dts] [PATCH V1] tests/TestSuite_kernelpf_iavf.py:An abnormal exit needs to execute the same command as a normal exit Peng Zhihong
2019-11-07  7:10 ` Ma, LihongX
2019-11-07  7:21   ` Peng, ZhihongX
2019-11-08  5:12     ` Ma, LihongX
2019-11-22  6:09       ` Tu, Lijuan

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).