test suite reviews and discussions
 help / color / mirror / Atom feed
From: Hongbo Li <hongbox.li@intel.com>
To: dts@dpdk.org
Cc: Hongbo Li <hongbox.li@intel.com>
Subject: [dts][PATCH V1] tests/dcf_lifecycle:add kernel check in test script
Date: Sat,  4 Mar 2023 01:17:49 +0800	[thread overview]
Message-ID: <20230303171749.10233-1-hongbox.li@intel.com> (raw)

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>
---
 tests/TestSuite_dcf_lifecycle.py | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/tests/TestSuite_dcf_lifecycle.py b/tests/TestSuite_dcf_lifecycle.py
index cd7e1824..ef1af255 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()
-- 
2.17.1


             reply	other threads:[~2023-03-03  9:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-03 17:17 Hongbo Li [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-02-01  8:00 [dts][PATCH V1] tests/dcf_lifecycle: add " Weiyuan Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230303171749.10233-1-hongbox.li@intel.com \
    --to=hongbox.li@intel.com \
    --cc=dts@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).