diff mbox series

framework: strip the PEXPECT from the output

Message ID 20220927115141.9578-1-reshma.pattan@intel.com (mailing list archive)
State Accepted
Headers show
Series framework: strip the PEXPECT from the output | expand

Checks

Context Check Description
ci/Intel-dts-suite-test success Testing OK
ci/Intel-dts-pylama-test success Testing OK
ci/Intel-dts-format-test success Testing OK

Commit Message

Pattan, Reshma Sept. 27, 2022, 11:51 a.m. UTC
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(+)

Comments

Tu, Lijuan Oct. 10, 2022, 3:33 a.m. UTC | #1
On Tue, 27 Sep 2022 12:51:41 +0100, Reshma Pattan <reshma.pattan@intel.com> wrote:
> 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>

Acked-by: Lijuan Tu <lijuan.tu@intel.com>
Applied, thanks
diff mbox series

Patch

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", "# ")