From patchwork Fri Mar 3 17:17:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Li, HongboX" X-Patchwork-Id: 124774 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 A0E7241DC6; Fri, 3 Mar 2023 10:01:14 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9B45840687; Fri, 3 Mar 2023 10:01:14 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 1DB29400D6 for ; Fri, 3 Mar 2023 10:01:12 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1677834073; x=1709370073; h=from:to:cc:subject:date:message-id; bh=nP/83UnIdn/IKEEd6vOZkUxPYn66l4HBTT+EyzZLP2k=; b=VsRSAh/ssVagGtHfNj2uIcZCJnmLlsRMBYyEjdGna+Wh+IMf16tfEJLa 5U4gOApMeEJMHecORL5UKss/vAmCT2/PrqBFXpjVsOCFVeCT4qFuL0KU5 wYmVoPNUhGRqGpr6Ht12WV7ArHEosiSb28HcZvvS/upq+y0CLR865ziL6 us0Crb5c+0AbO9kq+C9pSyjYAAO3U7AqeI8Bl5QrpBfL+K8kceisEXz17 yIc6DKR/8D3+JXbIZw8TH/z0za+upGk1eygiLTnBU1BQe3Hg0rV1a2A0a +xGMsHcd6FuhEuDoh+ph2mXNcJ53eO1QPpLpLVeCW6XntLEKzi/2WmGpU w==; X-IronPort-AV: E=McAfee;i="6500,9779,10637"; a="337314997" X-IronPort-AV: E=Sophos;i="5.98,230,1673942400"; d="scan'208";a="337314997" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Mar 2023 01:01:12 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10637"; a="849398851" X-IronPort-AV: E=Sophos;i="5.98,230,1673942400"; d="scan'208";a="849398851" Received: from unknown (HELO cvl_100g_103.icx.intel.com) ([10.239.252.93]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Mar 2023 01:01:10 -0800 From: Hongbo Li To: dts@dpdk.org Cc: Hongbo Li Subject: [dts][PATCH V1] tests/dcf_lifecycle:add kernel check in test script Date: Sat, 4 Mar 2023 01:17:49 +0800 Message-Id: <20230303171749.10233-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 --- 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()