framework: strip the PEXPECT from the output
Checks
Context |
Check |
Description |
ci/Intel-dts-format-test |
success
|
Testing OK
|
ci/Intel-dts-pylama-test |
success
|
Testing OK
|
ci/Intel-dts-suite-test |
success
|
Testing OK
|
Commit Message
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
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
@@ -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", "# ")