From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id AD3ED42856; Tue, 28 Mar 2023 10:33:40 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A7A7340A87; Tue, 28 Mar 2023 10:33:40 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 5609F40156 for ; Tue, 28 Mar 2023 10:33:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679992418; x=1711528418; h=from:to:cc:subject:date:message-id; bh=kZlbYYUjxspBvuWG4YKn68bJK2mxv+IgvBPNGlUgzEc=; b=YKzqTeUnnDYr5kSPJfl31pxVdsjhtcPxd2/bMPIrvVN1mqJK+OIybwUT rPnq1p3duLlAINfVjicon8HayOpXk0owlDXk+5CHPbT3CNa3/acjXD+y+ 24WnvEd+ovRZaM9O0A3U2MxrQpRooDLGWV4SWgIUHC9pOREDB7FZ7SdZV x8d9EQNQEZpi7l3g05uQ0zxDar8UVAW/fitLTndMChQqdfb1XAPz380E5 7TR7uJb+f7MbhRbRee7FL5M4DaVBC/O27DLLTon89N1woIZOXwoL6rk0H giRT4nEco02Xxa1SURJFHLKz3yPkCjuxVO7g2G0x6oAS4RoZa+qkhDIWi w==; X-IronPort-AV: E=McAfee;i="6600,9927,10662"; a="340530721" X-IronPort-AV: E=Sophos;i="5.98,296,1673942400"; d="scan'208";a="340530721" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Mar 2023 01:33:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10662"; a="929783925" X-IronPort-AV: E=Sophos;i="5.98,296,1673942400"; d="scan'208";a="929783925" Received: from unknown (HELO cvl_100g_103.icx.intel.com) ([10.239.252.93]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Mar 2023 01:33:35 -0700 From: Hongbo Li To: dts@dpdk.org Cc: Hongbo Li Subject: [dts][PATCH V3] tests/dcf_lifecycle: add kernel check in test script Date: Wed, 29 Mar 2023 00:51:41 +0800 Message-Id: <20230328165141.32675-1-hongbox.li@intel.com> X-Mailer: git-send-email 2.17.1 X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org 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 --- v2:skip case of test_dcf_with_adq_03 v3:assigning an initial value to the variable self.kernel_version, and optimization warning log. tests/TestSuite_dcf_lifecycle.py | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/tests/TestSuite_dcf_lifecycle.py b/tests/TestSuite_dcf_lifecycle.py index d3758c6c..fd828ef8 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,12 @@ class TestDcfLifeCycle(TestCase): self.verify_supported_nic() # prepare testing environment self.preset_test_environment() + self.kernel_version = "" + 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("kernel version cannot be found.") def tear_down_all(self): """ @@ -1182,6 +1188,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 +1201,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 +1214,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