From patchwork Tue Sep 27 11:51:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Pattan, Reshma" X-Patchwork-Id: 116972 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 87774A00C2; Tue, 27 Sep 2022 13:51:46 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8034641133; Tue, 27 Sep 2022 13:51:46 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id A560A40694 for ; Tue, 27 Sep 2022 13:51:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1664279505; x=1695815505; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=PlO9tlTCCZ5+Ia/qpgFzNaLHZQaFtYOklkXyPPaUOIQ=; b=LK5M3nRTTzd2ctHzJX4uTp99zNKdCtg0naseIf2m+2sHv/c23FUbzFX8 LfD3OBXHk/QqtTr+BgBAiCrr9JayaoYGO4tyuQ7Bsb2AzHnSvMQiW2Uke Gf8zSApbGt85MVgyqn5rqybHMs1UQsrA2ljL81QEaRgiaGZUVzbtdVeuh Ng9DOVamrL/Ja5AFwb+T9FNLDTIux09KOHzn6r055FCX1KWmdcJGxr0vn Htc8hpmefTcUoPTBuJGXz1nz7DlQzVoKZwP0L7kKGOkNrxmOPydeYmneu /OFnzlJN+DwFKANskOr3y92QIr9lyrTcC2LN4jmiaYykMv2y0m6xIR8VU Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10482"; a="302775731" X-IronPort-AV: E=Sophos;i="5.93,349,1654585200"; d="scan'208";a="302775731" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Sep 2022 04:51:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10482"; a="654698390" X-IronPort-AV: E=Sophos;i="5.93,349,1654585200"; d="scan'208";a="654698390" Received: from silpixa00401314.ir.intel.com ([10.243.23.141]) by orsmga001.jf.intel.com with ESMTP; 27 Sep 2022 04:51:44 -0700 From: Reshma Pattan To: dts@dpdk.org Cc: Reshma Pattan Subject: [dts] [PATCH] framework: strip the PEXPECT from the output Date: Tue, 27 Sep 2022 12:51:41 +0100 Message-Id: <20220927115141.9578-1-reshma.pattan@intel.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 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 During hugetlbfs mount check, if no hugetlbfs is mounted the output would have a string " [PEXPECT]#". The output must strip the " [PEXPECT]#" if no hugetlbfs mounted, inorder to correctly decide there is no mounted hugetlbfs and to mount the new one. Signed-off-by: Reshma Pattan Acked-by: Lijuan Tu --- framework/crb.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/framework/crb.py b/framework/crb.py index 5ce4e2c9..9559e738 100644 --- a/framework/crb.py +++ b/framework/crb.py @@ -207,6 +207,9 @@ class Crb(object): """ self.send_expect("umount `awk '/hugetlbfs/ { print $2 }' /proc/mounts`", "# ") out = self.send_expect("awk '/hugetlbfs/ { print $2 }' /proc/mounts", "# ") + # if no hugetlbfs mounted, then above command will return " [PEXPECT]#" + # so strip the unexptectd " [PEXPECT]#", to proceed to mount the hugetlbfs + out = out.strip(' [PEXPECT]#') # only mount hugepage when no hugetlbfs mounted if not len(out): self.send_expect("mkdir -p /mnt/huge", "# ")