Test user 'progs-test' will be used to test the behavior of normal user.

In order to pass this check, add the user by "useradd -M progs-test".
Note that progs-test should not have root privileges.

Signed-off-by: Misono Tomohiro <misono.tomoh...@jp.fujitsu.com>
---
 tests/common | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/tests/common b/tests/common
index 7e4e09df..7a37a4cd 100644
--- a/tests/common
+++ b/tests/common
@@ -314,6 +314,16 @@ check_global_prereq()
        fi
 }
 
+check_testuser()
+{
+       id -u progs-test > /dev/null 2>&1
+       if [ $? -ne 0 ]; then
+               _not_run "Need to add user \"progs-test\""
+       fi
+       # Note that progs-test should not have root privileges
+       # otherwise test may not run as expected
+}
+
 check_image()
 {
        local image
-- 
2.14.4


--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to