diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2022-06-28 12:47:12 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2022-06-28 12:49:39 +0200 |
commit | e43941756aa8430effbd7c42a831adee6132a004 (patch) | |
tree | 159363a53b945741d52a4b0c8fbabf0bdf6683b6 | |
parent | e8b27f95bf6e4aa263fcb0f67ee37cb0aab35f1d (diff) | |
download | alpine-conf-e43941756aa8430effbd7c42a831adee6132a004.zip |
tests: setup-user: add test for -k opt
ref https://gitlab.alpinelinux.org/alpine/alpine-conf/-/merge_requests/70
-rwxr-xr-x | tests/setup_user_test | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/setup_user_test b/tests/setup_user_test index 3e5bf39..11b6161 100755 --- a/tests/setup_user_test +++ b/tests/setup_user_test @@ -11,7 +11,8 @@ init_tests \ setup_user_interactive_suggest_ssh \ setup_user_groups_commas \ setup_user_groups_spaces \ - setup_user_admin + setup_user_admin \ + setup_user_keys_opt setup_user_usage_body() { test_usage setup-user @@ -133,3 +134,15 @@ setup_user_admin_body() { grep wheel etc/doas.d/doas.conf } + +setup_user_keys_opt_body() { + init_env + export WGETCONTENT='ssh-id from alpine' + atf_check -s exit:0 \ + -o match:"adduser.* -D .*testuser" \ + setup-user -k https://gitlab.alpinelinux.org/user.keys testuser + grep "$WGETCONTENT" home/testuser/.ssh/authorized_keys \ + || atf_fail "ssh key not fetched from alpinelinux" +} + + |