[dts] [PATCH] tests/pmdrss_hash: check reta_lines before verifying the result
Liu, Yong
yong.liu at intel.com
Sun Feb 11 02:38:54 CET 2018
Thanks, Michael.
I'm fine with the logic refine, but variable "reta_lines" should better be an argument of verify function than a global variable.
Could you please modify your patch?
Regards,
Marvin
> -----Original Message-----
> From: dts [mailto:dts-bounces at dpdk.org] On Behalf Of michael.luo at intel.com
> Sent: Thursday, February 08, 2018 6:58 PM
> To: dts at dpdk.org
> Subject: [dts] [PATCH] tests/pmdrss_hash: check reta_lines before
> verifying the result
>
> From: Luo Gaoliang <michael.luo at intel.com>
>
> If reta_lines was empty, DTS shows the test case passed still.
> So add the checking of reta_lines before verifying result.
>
> Signed-off-by: Luo Gaoliang <michael.luo at intel.com>
> ---
> tests/TestSuite_pmdrss_hash.py | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/tests/TestSuite_pmdrss_hash.py
> b/tests/TestSuite_pmdrss_hash.py
> index 78e4075..7a1f870 100644
> --- a/tests/TestSuite_pmdrss_hash.py
> +++ b/tests/TestSuite_pmdrss_hash.py
> @@ -184,6 +184,7 @@ class TestPmdrssHash(TestCase):
> global reta_lines
> global reta_num
> result = []
> + self.verify(len(reta_lines) > 0, 'No packet received!')
> self.result_table_create(
> ['packet index', 'hash value', 'hash index', 'queue id',
> 'actual queue id', 'pass '])
>
> @@ -370,6 +371,8 @@ class TestPmdrssHash(TestCase):
> item = item.strip()
> if(item.startswith("RSS hash")):
> name, value = item.split("=", 1)
> + else:
> + continue
>
> reta_line[name.strip()] = value.strip()
> reta_lines.append(reta_line)
> @@ -384,6 +387,7 @@ class TestPmdrssHash(TestCase):
> global reta_lines
> global reta_num
> result = []
> + self.verify(len(reta_lines) > 0, 'No packet received!')
> self.result_table_create(
> ['packet index', 'RSS hash', 'hash index', 'queue id',
> 'actual queue id', 'pass '])
>
> --
> 2.7.4
More information about the dts
mailing list