[dts] [PATCH] framework: strip the PEXPECT from the output

Reshma Pattan reshma.pattan at intel.com
Tue Sep 27 13:51:41 CEST 2022


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 at 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



More information about the dts mailing list