From patchwork Fri Mar 24 15:57:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Li, HongboX" X-Patchwork-Id: 125501 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E017C4282B; Fri, 24 Mar 2023 08:39:48 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BC8DD406B8; Fri, 24 Mar 2023 08:39:48 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 5D7B34068E for ; Fri, 24 Mar 2023 08:39:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679643586; x=1711179586; h=from:to:cc:subject:date:message-id; bh=w/LUxFv3bAy5vD+/T4AzaBSRSHXQo0rIjGoSqoYSPgk=; b=Rez7WNyDzAropPHViYOVXmvJqocKputQUrhBw85AdvXSCnqi4jvZKdGg 8kBqC3LyanMJOrjTBFPuZxW8SY0SlquXpPKDARcmHJNA9NH+1INtio+Zc 4sT8LJWEZ7mipDYtByuibd00VQ0VsbqS4mZL4jq+/rMB41H/ZVIAlMTtz m8kj+mk9MJ7A+qu2gnY7dbfrv/cgwbbecYUlYr/gXFmgZ6FwYbb1vn+is Tt0ClZX//aDU1tyqWhnn4GO33cCU4HtU9fPMDkxPakZ3wKPYVbV0WzFlO wyq85ry+bSiyRlshboGIqJxCYk1OIjWIuFCZCwT9stu6CvooyOOlz6aKx w==; X-IronPort-AV: E=McAfee;i="6600,9927,10658"; a="328132055" X-IronPort-AV: E=Sophos;i="5.98,287,1673942400"; d="scan'208";a="328132055" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Mar 2023 00:39:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10658"; a="928558192" X-IronPort-AV: E=Sophos;i="5.98,287,1673942400"; d="scan'208";a="928558192" 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; 24 Mar 2023 00:39:19 -0700 From: Hongbo Li To: dts@dpdk.org Cc: Hongbo Li Subject: [dts][PATCH V2] tests/dcf_lifecycle:add kernel check in test script Date: Fri, 24 Mar 2023 23:57:59 +0800 Message-Id: <20230324155759.8864-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 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)