diff mbox series

[v3,09/10] selftests/mm: Drop unnecessary sudo usage

Message ID 20250228-mm-selftests-v3-9-958e3b6f0203@google.com (mailing list archive)
State New
Headers show
Series selftests/mm: Some cleanups from trying to run them | expand

Commit Message

Brendan Jackman Feb. 28, 2025, 4:54 p.m. UTC
This script must be run as root anyway (see all the writing to
privileged files in /proc etc).

Remove the unnecessary use of sudo to avoid breaking on single-user
systems that don't have sudo. This also avoids confusing readers.

Signed-off-by: Brendan Jackman <jackmanb@google.com>
---
 tools/testing/selftests/mm/run_vmtests.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Dev Jain Feb. 28, 2025, 5:26 p.m. UTC | #1
On 28/02/25 10:24 pm, Brendan Jackman wrote:
> This script must be run as root anyway (see all the writing to
> privileged files in /proc etc).
> 
> Remove the unnecessary use of sudo to avoid breaking on single-user
> systems that don't have sudo. This also avoids confusing readers.
> 
> Signed-off-by: Brendan Jackman <jackmanb@google.com>

Reviewed-by: Dev Jain <dev.jain@arm.com>
diff mbox series

Patch

diff --git a/tools/testing/selftests/mm/run_vmtests.sh b/tools/testing/selftests/mm/run_vmtests.sh
index da7e266681031d2772fb0c4139648904a18e0bf9..0f9fe757c3320a6551e39b6d4552fd4874b0bf43 100755
--- a/tools/testing/selftests/mm/run_vmtests.sh
+++ b/tools/testing/selftests/mm/run_vmtests.sh
@@ -386,7 +386,7 @@  CATEGORY="madv_populate" run_test ./madv_populate
 
 if [ -x ./memfd_secret ]
 then
-(echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope 2>&1) | tap_prefix
+(echo 0 > /proc/sys/kernel/yama/ptrace_scope 2>&1) | tap_prefix
 CATEGORY="memfd_secret" run_test ./memfd_secret
 fi