diff mbox series

[v4,2/9] shell API/tests: Require root for TST_{FORMAT, MOUNT}_DEVICE

Message ID 20220902133710.1785-3-pvorel@suse.cz
State Changes Requested
Headers show
Series shell: df01.sh: $TST_ALL_FILESYSTEMS (.all_filesystems) | expand

Commit Message

Petr Vorel Sept. 2, 2022, 1:37 p.m. UTC
Although the warning is quite obvious:
tst_device.c:101: TINFO: Not allowed to open /dev/loop-control. Are you root?: EACCES (13)
tst_device.c:140: TINFO: No free devices found
TBROK: Failed to acquire device

it's safer to expect root to get valid result.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 lib/newlib_tests/shell/tst_format_device.sh      | 1 +
 lib/newlib_tests/shell/tst_mount_device.sh       | 1 +
 lib/newlib_tests/shell/tst_mount_device_tmpfs.sh | 1 +
 3 files changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/lib/newlib_tests/shell/tst_format_device.sh b/lib/newlib_tests/shell/tst_format_device.sh
index 73a919086..dbe4ea9e7 100755
--- a/lib/newlib_tests/shell/tst_format_device.sh
+++ b/lib/newlib_tests/shell/tst_format_device.sh
@@ -3,6 +3,7 @@ 
 # Copyright (c) 2022 Petr Vorel <pvorel@suse.cz>
 
 TST_FORMAT_DEVICE=1
+TST_NEEDS_ROOT=1
 TST_TESTFUNC=test
 TST_CNT=2
 TST_DEV_FS_OPTS="-b 1024"
diff --git a/lib/newlib_tests/shell/tst_mount_device.sh b/lib/newlib_tests/shell/tst_mount_device.sh
index 561f878d2..70f80f84a 100755
--- a/lib/newlib_tests/shell/tst_mount_device.sh
+++ b/lib/newlib_tests/shell/tst_mount_device.sh
@@ -3,6 +3,7 @@ 
 # Copyright (c) 2022 Petr Vorel <pvorel@suse.cz>
 
 TST_MOUNT_DEVICE=1
+TST_NEEDS_ROOT=1
 TST_FS_TYPE=ext4
 TST_TESTFUNC=test
 TST_CNT=3
diff --git a/lib/newlib_tests/shell/tst_mount_device_tmpfs.sh b/lib/newlib_tests/shell/tst_mount_device_tmpfs.sh
index 36a78bc85..ed2ba8c50 100755
--- a/lib/newlib_tests/shell/tst_mount_device_tmpfs.sh
+++ b/lib/newlib_tests/shell/tst_mount_device_tmpfs.sh
@@ -3,6 +3,7 @@ 
 # Copyright (c) 2022 Petr Vorel <pvorel@suse.cz>
 
 TST_MOUNT_DEVICE=1
+TST_NEEDS_ROOT=1
 TST_FS_TYPE=tmpfs
 TST_TESTFUNC=test