[dts] [PATCH V1 1/1] tests/flow_classify: fix check condition logic error

Li, WenjieX A wenjiex.a.li at intel.com
Wed Sep 25 07:32:33 CEST 2019


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

> -----Original Message-----
> From: Mo, YufengX
> Sent: Wednesday, September 25, 2019 1:08 PM
> To: dts at dpdk.org; Li, WenjieX A <wenjiex.a.li at intel.com>
> Cc: Lin, Xueqin <xueqin.lin at intel.com>; Mo, YufengX <yufengx.mo at 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 at 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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: TestFlowClassify.log
Type: application/octet-stream
Size: 194669 bytes
Desc: TestFlowClassify.log
URL: <http://mails.dpdk.org/archives/dts/attachments/20190925/57cd5d44/attachment.obj>


More information about the dts mailing list