test suite reviews and discussions
 help / color / Atom feed
* [dts] [PATCH V1 0/1] tests/flow_classify: fix check condition logic error
@ 2019-09-25  5:07 yufengmx
  2019-09-25  5:07 ` [dts] [PATCH V1 1/1] " yufengmx
  0 siblings, 1 reply; 4+ messages in thread
From: yufengmx @ 2019-09-25  5:07 UTC (permalink / raw)
  To: dts, wenjiex.a.li; +Cc: xueqin.lin, yufengmx

 fix check condition logic error. 
 missed use local directory check method, change os.path.exists to is_existed_on_crb. 

yufengmx (1):
  tests/flow_classify: fix check condition logic error

 tests/TestSuite_flow_classify.py | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

-- 
2.21.0


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

* [dts] [PATCH V1 1/1] tests/flow_classify: fix check condition logic error
  2019-09-25  5:07 [dts] [PATCH V1 0/1] tests/flow_classify: fix check condition logic error yufengmx
@ 2019-09-25  5:07 ` " yufengmx
  2019-09-25  5:32   ` Li, WenjieX A
  2019-09-25  5:47   ` Tu, Lijuan
  0 siblings, 2 replies; 4+ messages in thread
From: yufengmx @ 2019-09-25  5:07 UTC (permalink / raw)
  To: dts, wenjiex.a.li; +Cc: xueqin.lin, yufengmx


fix check condition logic error.
missed use local directory check method, change os.path.exists to is_existed_on_crb.

Signed-off-by: yufengmx <yufengx.mo@intel.com>
---
 tests/TestSuite_flow_classify.py | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/tests/TestSuite_flow_classify.py b/tests/TestSuite_flow_classify.py
index ffa6136..c51b0a2 100644
--- a/tests/TestSuite_flow_classify.py
+++ b/tests/TestSuite_flow_classify.py
@@ -46,6 +46,16 @@ from settings import HEADER_SIZE
 
 class TestFlowClassify(TestCase):
 
+    def is_existed_on_crb(self, check_path, crb='dut'):
+        alt_session = self.dut.alt_session \
+                      if crb == 'dut' else \
+                      self.tester.alt_session
+        alt_session.send_expect("ls %s > /dev/null 2>&1" % check_path, "# ")
+        cmd = "echo $?"
+        output = alt_session.send_expect(cmd, "# ")
+        ret = True if output and output.strip() == "0" else False
+        return ret
+
     def get_cores_mask(self, config='all'):
         sockets = [self.dut.get_numa_id(index) for index in self.dut_ports]
         socket_count = Counter(sockets)
@@ -291,7 +301,7 @@ class TestFlowClassify(TestCase):
                                    'examples',
                                    'flow_classify',
                                    'ipv4_rules_file.txt'])
-        if not os.path.exists(rule_config):
+        if not self.is_existed_on_crb(rule_config):
             raise VerifyFailure("rules file doesn't existed")
         core = "1S/1C/1T"
         option = r" -c {0} -n 4 --file-prefix=test -- --rule_ipv4={1}".format(
@@ -390,7 +400,7 @@ class TestFlowClassify(TestCase):
             elif flow_type == 'single_stream':
                 if rule_priority is None and captured_pkts != 0:
                     msg = "invalid stream hasn't been filtered out"
-                elif rule_priority is None and captured_pkts != total_packets:
+                elif rule_priority and captured_pkts != total_packets:
                     msg = "expect {0} ".format(total_packets) + \
                           "captured {0}".format(captured_pkts)
                 else:
-- 
2.21.0


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

* Re: [dts] [PATCH V1 1/1] tests/flow_classify: fix check condition logic error
  2019-09-25  5:07 ` [dts] [PATCH V1 1/1] " yufengmx
@ 2019-09-25  5:32   ` Li, WenjieX A
  2019-09-25  5:47   ` Tu, Lijuan
  1 sibling, 0 replies; 4+ messages in thread
From: Li, WenjieX A @ 2019-09-25  5:32 UTC (permalink / raw)
  To: Mo, YufengX, dts; +Cc: Lin, Xueqin, Li, WenjieX A

[-- Attachment #1: Type: text/plain, Size: 2728 bytes --]

Tested-by: Li, WenjieX A <wenjiex.a.li@intel.com>

> -----Original Message-----
> From: Mo, YufengX
> Sent: Wednesday, September 25, 2019 1:08 PM
> To: dts@dpdk.org; Li, WenjieX A <wenjiex.a.li@intel.com>
> Cc: Lin, Xueqin <xueqin.lin@intel.com>; Mo, YufengX <yufengx.mo@intel.com>
> Subject: [dts][PATCH V1 1/1] tests/flow_classify: fix check condition logic error
> 
> 
> fix check condition logic error.
> missed use local directory check method, change os.path.exists to
> is_existed_on_crb.
> 
> Signed-off-by: yufengmx <yufengx.mo@intel.com>
> ---
>  tests/TestSuite_flow_classify.py | 14 ++++++++++++--
>  1 file changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/TestSuite_flow_classify.py b/tests/TestSuite_flow_classify.py
> index ffa6136..c51b0a2 100644
> --- a/tests/TestSuite_flow_classify.py
> +++ b/tests/TestSuite_flow_classify.py
> @@ -46,6 +46,16 @@ from settings import HEADER_SIZE
> 
>  class TestFlowClassify(TestCase):
> 
> +    def is_existed_on_crb(self, check_path, crb='dut'):
> +        alt_session = self.dut.alt_session \
> +                      if crb == 'dut' else \
> +                      self.tester.alt_session
> +        alt_session.send_expect("ls %s > /dev/null 2>&1" % check_path, "# ")
> +        cmd = "echo $?"
> +        output = alt_session.send_expect(cmd, "# ")
> +        ret = True if output and output.strip() == "0" else False
> +        return ret
> +
>      def get_cores_mask(self, config='all'):
>          sockets = [self.dut.get_numa_id(index) for index in self.dut_ports]
>          socket_count = Counter(sockets) @@ -291,7 +301,7 @@ class
> TestFlowClassify(TestCase):
>                                     'examples',
>                                     'flow_classify',
>                                     'ipv4_rules_file.txt'])
> -        if not os.path.exists(rule_config):
> +        if not self.is_existed_on_crb(rule_config):
>              raise VerifyFailure("rules file doesn't existed")
>          core = "1S/1C/1T"
>          option = r" -c {0} -n 4 --file-prefix=test -- --rule_ipv4={1}".format( @@ -
> 390,7 +400,7 @@ class TestFlowClassify(TestCase):
>              elif flow_type == 'single_stream':
>                  if rule_priority is None and captured_pkts != 0:
>                      msg = "invalid stream hasn't been filtered out"
> -                elif rule_priority is None and captured_pkts != total_packets:
> +                elif rule_priority and captured_pkts != total_packets:
>                      msg = "expect {0} ".format(total_packets) + \
>                            "captured {0}".format(captured_pkts)
>                  else:
> --
> 2.21.0


[-- Attachment #2: TestFlowClassify.log --]
[-- Type: application/octet-stream, Size: 194669 bytes --]

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

* Re: [dts] [PATCH V1 1/1] tests/flow_classify: fix check condition logic error
  2019-09-25  5:07 ` [dts] [PATCH V1 1/1] " yufengmx
  2019-09-25  5:32   ` Li, WenjieX A
@ 2019-09-25  5:47   ` Tu, Lijuan
  1 sibling, 0 replies; 4+ messages in thread
From: Tu, Lijuan @ 2019-09-25  5:47 UTC (permalink / raw)
  To: Mo, YufengX, dts, Li,  WenjieX A; +Cc: Lin, Xueqin, Mo, YufengX

Applied, thanks

> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of yufengmx
> Sent: Wednesday, September 25, 2019 1:08 PM
> To: dts@dpdk.org; Li, WenjieX A <wenjiex.a.li@intel.com>
> Cc: Lin, Xueqin <xueqin.lin@intel.com>; Mo, YufengX
> <yufengx.mo@intel.com>
> Subject: [dts] [PATCH V1 1/1] tests/flow_classify: fix check condition logic
> error
> 
> 
> fix check condition logic error.
> missed use local directory check method, change os.path.exists to
> is_existed_on_crb.
> 
> Signed-off-by: yufengmx <yufengx.mo@intel.com>
> ---
>  tests/TestSuite_flow_classify.py | 14 ++++++++++++--
>  1 file changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/TestSuite_flow_classify.py b/tests/TestSuite_flow_classify.py
> index ffa6136..c51b0a2 100644
> --- a/tests/TestSuite_flow_classify.py
> +++ b/tests/TestSuite_flow_classify.py
> @@ -46,6 +46,16 @@ from settings import HEADER_SIZE
> 
>  class TestFlowClassify(TestCase):
> 
> +    def is_existed_on_crb(self, check_path, crb='dut'):
> +        alt_session = self.dut.alt_session \
> +                      if crb == 'dut' else \
> +                      self.tester.alt_session
> +        alt_session.send_expect("ls %s > /dev/null 2>&1" % check_path, "# ")
> +        cmd = "echo $?"
> +        output = alt_session.send_expect(cmd, "# ")
> +        ret = True if output and output.strip() == "0" else False
> +        return ret
> +
>      def get_cores_mask(self, config='all'):
>          sockets = [self.dut.get_numa_id(index) for index in self.dut_ports]
>          socket_count = Counter(sockets) @@ -291,7 +301,7 @@ class
> TestFlowClassify(TestCase):
>                                     'examples',
>                                     'flow_classify',
>                                     'ipv4_rules_file.txt'])
> -        if not os.path.exists(rule_config):
> +        if not self.is_existed_on_crb(rule_config):
>              raise VerifyFailure("rules file doesn't existed")
>          core = "1S/1C/1T"
>          option = r" -c {0} -n 4 --file-prefix=test -- --rule_ipv4={1}".format( @@ -
> 390,7 +400,7 @@ class TestFlowClassify(TestCase):
>              elif flow_type == 'single_stream':
>                  if rule_priority is None and captured_pkts != 0:
>                      msg = "invalid stream hasn't been filtered out"
> -                elif rule_priority is None and captured_pkts != total_packets:
> +                elif rule_priority and captured_pkts != total_packets:
>                      msg = "expect {0} ".format(total_packets) + \
>                            "captured {0}".format(captured_pkts)
>                  else:
> --
> 2.21.0


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

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-25  5:07 [dts] [PATCH V1 0/1] tests/flow_classify: fix check condition logic error yufengmx
2019-09-25  5:07 ` [dts] [PATCH V1 1/1] " yufengmx
2019-09-25  5:32   ` Li, WenjieX A
2019-09-25  5:47   ` 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