test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts][PATCH V2] tests/dcf_lifecycle:add kernel check in test script
@ 2023-03-24 15:57 Hongbo Li
  2023-03-28  1:11 ` Tu, Lijuan
  0 siblings, 1 reply; 2+ messages in thread
From: Hongbo Li @ 2023-03-24 15:57 UTC (permalink / raw)
  To: dts; +Cc: Hongbo Li

1.Some testcase require the kernel 4.19+ in the testplan, but test script does not check the kernel. Which will cause the lower version of kernel to fail when run cases.
2.The "--color" option of dmesg command is not supported in the OS with the lower version kernel, and the option only changes the color of the output. So delete this option to make the OS with the lower version kernel support some testcase.

Signed-off-by: Hongbo Li <hongbox.li@intel.com>
---
v2:skip case of test_dcf_with_adq_03

 tests/TestSuite_dcf_lifecycle.py | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/tests/TestSuite_dcf_lifecycle.py b/tests/TestSuite_dcf_lifecycle.py
index d3758c6c..f3f17678 100644
--- a/tests/TestSuite_dcf_lifecycle.py
+++ b/tests/TestSuite_dcf_lifecycle.py
@@ -184,7 +184,7 @@ class TestDcfLifeCycle(TestCase):
         self.d_a_con(cmd)
 
     def get_dmesg(self):
-        cmd = "dmesg --color=never"
+        cmd = "dmesg"
         return self.d_a_con(cmd) or ""
 
     def vf_init(self):
@@ -1078,6 +1078,11 @@ class TestDcfLifeCycle(TestCase):
         self.verify_supported_nic()
         # prepare testing environment
         self.preset_test_environment()
+        kernel_version = self.dut.send_expect("uname -r", "# ")
+        try:
+            self.kernel_version = re.match("[0-9]+\.\d*", kernel_version).group(0)
+        except Exception as e:
+            self.logger.warning(e)
 
     def tear_down_all(self):
         """
@@ -1182,6 +1187,11 @@ class TestDcfLifeCycle(TestCase):
         """
         When ADQ set on PF, PF should reject the DCF mode
         """
+        if self.kernel_version:
+            self.skip_case(
+                self.kernel_version > "4.19",
+                "Host kernel version is required 4.19+",
+            )
         msg = "begin : When ADQ set on PF, PF should reject the DCF mode"
         self.logger.info(msg)
         self.verify_dcf_with_adq_01()
@@ -1190,6 +1200,11 @@ class TestDcfLifeCycle(TestCase):
         """
         When DCF mode enabled, ADQ setting on PF shall fail
         """
+        if self.kernel_version:
+            self.skip_case(
+                self.kernel_version > "4.19",
+                "Host kernel version is required 4.19+",
+            )
         msg = "begin : When DCF mode enabled, ADQ setting on PF shall fail"
         self.logger.info(msg)
         self.verify_dcf_with_adq_02()
@@ -1198,6 +1213,11 @@ class TestDcfLifeCycle(TestCase):
         """
         DCF and ADQ can be enabled on different PF
         """
+        if self.kernel_version:
+            self.skip_case(
+                self.kernel_version > "4.19",
+                "Host kernel version is required 4.19+",
+            )
         self.verify(len(self.dut_ports) >= 2, "2 ports at least")
         msg = "begin : DCF and ADQ can be enabled on different PF"
         self.logger.info(msg)
-- 
2.17.1


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

* RE: [dts][PATCH V2] tests/dcf_lifecycle:add kernel check in test script
  2023-03-24 15:57 [dts][PATCH V2] tests/dcf_lifecycle:add kernel check in test script Hongbo Li
@ 2023-03-28  1:11 ` Tu, Lijuan
  0 siblings, 0 replies; 2+ messages in thread
From: Tu, Lijuan @ 2023-03-28  1:11 UTC (permalink / raw)
  To: Li, HongboX, dts; +Cc: Li, HongboX



> -----Original Message-----
> From: Hongbo Li <hongbox.li@intel.com>
> Sent: Friday, March 24, 2023 11:58 PM
> To: dts@dpdk.org
> Cc: Li, HongboX <hongbox.li@intel.com>
> Subject: [dts][PATCH V2] tests/dcf_lifecycle:add kernel check in test script
> 
> 1.Some testcase require the kernel 4.19+ in the testplan, but test script does not
> check the kernel. Which will cause the lower version of kernel to fail when run
> cases.
> 2.The "--color" option of dmesg command is not supported in the OS with the
> lower version kernel, and the option only changes the color of the output. So
> delete this option to make the OS with the lower version kernel support some
> testcase.
> 
> Signed-off-by: Hongbo Li <hongbox.li@intel.com>
> ---
> v2:skip case of test_dcf_with_adq_03
> 
>  tests/TestSuite_dcf_lifecycle.py | 22 +++++++++++++++++++++-
>  1 file changed, 21 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/TestSuite_dcf_lifecycle.py b/tests/TestSuite_dcf_lifecycle.py
> index d3758c6c..f3f17678 100644
> --- a/tests/TestSuite_dcf_lifecycle.py
> +++ b/tests/TestSuite_dcf_lifecycle.py
> @@ -184,7 +184,7 @@ class TestDcfLifeCycle(TestCase):
>          self.d_a_con(cmd)
> 
>      def get_dmesg(self):
> -        cmd = "dmesg --color=never"
> +        cmd = "dmesg"
>          return self.d_a_con(cmd) or ""
> 
>      def vf_init(self):
> @@ -1078,6 +1078,11 @@ class TestDcfLifeCycle(TestCase):
>          self.verify_supported_nic()
>          # prepare testing environment
>          self.preset_test_environment()
> +        kernel_version = self.dut.send_expect("uname -r", "# ")
> +        try:
> +            self.kernel_version = re.match("[0-9]+\.\d*", kernel_version).group(0)
> +        except Exception as e:
> +            self.logger.warning(e)

If exception happens here, will raise attribute error in the call lines, as self.kernel_version cannot be found.

> 
>      def tear_down_all(self):
>          """
> @@ -1182,6 +1187,11 @@ class TestDcfLifeCycle(TestCase):
>          """
>          When ADQ set on PF, PF should reject the DCF mode
>          """
> +        if self.kernel_version:
> +            self.skip_case(
> +                self.kernel_version > "4.19",
> +                "Host kernel version is required 4.19+",
> +            )
>          msg = "begin : When ADQ set on PF, PF should reject the DCF mode"
>          self.logger.info(msg)
>          self.verify_dcf_with_adq_01()
> @@ -1190,6 +1200,11 @@ class TestDcfLifeCycle(TestCase):
>          """
>          When DCF mode enabled, ADQ setting on PF shall fail
>          """
> +        if self.kernel_version:
> +            self.skip_case(
> +                self.kernel_version > "4.19",
> +                "Host kernel version is required 4.19+",
> +            )
>          msg = "begin : When DCF mode enabled, ADQ setting on PF shall fail"
>          self.logger.info(msg)
>          self.verify_dcf_with_adq_02()
> @@ -1198,6 +1213,11 @@ class TestDcfLifeCycle(TestCase):
>          """
>          DCF and ADQ can be enabled on different PF
>          """
> +        if self.kernel_version:
> +            self.skip_case(
> +                self.kernel_version > "4.19",
> +                "Host kernel version is required 4.19+",
> +            )
>          self.verify(len(self.dut_ports) >= 2, "2 ports at least")
>          msg = "begin : DCF and ADQ can be enabled on different PF"
>          self.logger.info(msg)
> --
> 2.17.1


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

end of thread, other threads:[~2023-03-28  1:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-24 15:57 [dts][PATCH V2] tests/dcf_lifecycle:add kernel check in test script Hongbo Li
2023-03-28  1:11 ` 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).