Reviewed-by: Nicholas Pratte <npra...@iol.unh.edu>

On Mon, Aug 12, 2024 at 11:04 AM <jspew...@iol.unh.edu> wrote:
>
> From: Jeremy Spewock <jspew...@iol.unh.edu>
>
> There were two different commands in the hugepage mounting process that
> were not using super-user privileges; one for unmounting hugepages and
> another for re-mounting them. This patch adds the flag that enables
> enhanced permissions for both of these actions.
>
> Bugzilla ID: 1439
> Fixes: b8bdc4c58f57 ("dts: replace pexpect with fabric")
> Cc: juraj.lin...@pantheon.tech
>
> Signed-off-by: Jeremy Spewock <jspew...@iol.unh.edu>
> ---
>  dts/framework/testbed_model/linux_session.py | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/dts/framework/testbed_model/linux_session.py 
> b/dts/framework/testbed_model/linux_session.py
> index 99abc21353..544a665b83 100644
> --- a/dts/framework/testbed_model/linux_session.py
> +++ b/dts/framework/testbed_model/linux_session.py
> @@ -123,12 +123,12 @@ def _get_numa_nodes(self) -> list[int]:
>      def _mount_huge_pages(self) -> None:
>          self._logger.info("Re-mounting Hugepages.")
>          hugapge_fs_cmd = "awk '/hugetlbfs/ { print $2 }' /proc/mounts"
> -        self.send_command(f"umount $({hugapge_fs_cmd})")
> +        self.send_command(f"umount $({hugapge_fs_cmd})", privileged=True)
>          result = self.send_command(hugapge_fs_cmd)
>          if result.stdout == "":
>              remote_mount_path = "/mnt/huge"
> -            self.send_command(f"mkdir -p {remote_mount_path}")
> -            self.send_command(f"mount -t hugetlbfs nodev 
> {remote_mount_path}")
> +            self.send_command(f"mkdir -p {remote_mount_path}", 
> privileged=True)
> +            self.send_command(f"mount -t hugetlbfs nodev 
> {remote_mount_path}", privileged=True)
>
>      def _supports_numa(self) -> bool:
>          # the system supports numa if self._numa_nodes is non-empty and 
> there are more
> --
> 2.45.2
>

Reply via email to