test suite reviews and discussions
 help / color / mirror / Atom feed
From: Reshma Pattan <reshma.pattan@intel.com>
To: dts@dpdk.org
Cc: Reshma Pattan <reshma.pattan@intel.com>
Subject: [dts] [PATCH] framework: strip the PEXPECT from the output
Date: Tue, 27 Sep 2022 12:51:41 +0100	[thread overview]
Message-ID: <20220927115141.9578-1-reshma.pattan@intel.com> (raw)

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 <reshma.pattan@intel.com>
---
 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", "# ")
-- 
2.31.1


             reply	other threads:[~2022-09-27 11:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-27 11:51 Reshma Pattan [this message]
2022-10-10  3:33 ` lijuan.tu

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=20220927115141.9578-1-reshma.pattan@intel.com \
    --to=reshma.pattan@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).