summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy Day <timday@amazon.com>2024-08-09 23:16:48 -0400
committerTimothy Day <timday@amazon.com>2024-08-09 23:16:48 -0400
commit359756ea1fe17c654dbf465c55b0c6bd79ebaac9 (patch)
treeb6e941dac32f43fe605290da66bf988b004c68c8
parentceabdf74bb35a554406aaddc53d22db003087bf3 (diff)
tests/prelude.sh
Some tests require a dummy user. Automatically create a ktest_user (UID 1000) in ktest_group (GID 1000). Signed-off-by: Timothy Day <timday@amazon.com>
-rw-r--r--tests/prelude.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/prelude.sh b/tests/prelude.sh
index 943b178..86891a5 100644
--- a/tests/prelude.sh
+++ b/tests/prelude.sh
@@ -209,6 +209,12 @@ allow_taint()
ktest_allow_taint=true
}
+create_ktest_user()
+{
+ groupadd -g 1000 ktest_group
+ useradd -u 1000 -g 1000 ktest_user
+}
+
set_watchdog()
{
ktest_timeout=$(($ktest_timeout_multiplier * $1))
@@ -333,6 +339,7 @@ main()
list_tests
;;
run-tests)
+ create_ktest_user
run_init_hooks
run_tests "$@"
;;