diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2022-05-23 08:48:16 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2022-05-23 08:48:16 +0200 |
commit | 219f49a92d9c0bbef126bdfe8cb8ad1182f9dcb6 (patch) | |
tree | 5e7ff204bc87250fca4d94c8683826f4e91567b4 | |
parent | 33fb623d7109c23c928da7af2820be92ecdffadd (diff) | |
download | alpine-conf-219f49a92d9c0bbef126bdfe8cb8ad1182f9dcb6.zip |
tests: setup-user: add test for suggested ssh key url
-rwxr-xr-x | tests/setup_user_test | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/setup_user_test b/tests/setup_user_test index f1e0315..3e5bf39 100755 --- a/tests/setup_user_test +++ b/tests/setup_user_test @@ -8,6 +8,7 @@ init_tests \ setup_user_interactive \ setup_user_interactive_fullname \ setup_user_interactive_singlename \ + setup_user_interactive_suggest_ssh \ setup_user_groups_commas \ setup_user_groups_spaces \ setup_user_admin @@ -83,6 +84,26 @@ setup_user_interactive_singlename_body() { setup-user -f "Joe" -k none <answers } +setup_user_interactive_suggest_ssh_body() { + init_env + ( echo "testuser" + echo "FullName" + echo "al" + echo "" + )>answers + export WGETCONTENT='ssh-id from alpine' + atf_check -s exit:0 \ + -o match:"Setup a user" \ + -o match:"Full name for user" \ + -o match:"Enter ssh key.*none" \ + -o match:"Enter ssh key.*gitlab.alpinelinux.org.*testuser.keys" \ + -o match:"adduser.* -g FullName .*testuser" \ + -e empty \ + setup-user <answers + grep "$WGETCONTENT" home/testuser/.ssh/authorized_keys \ + || atf_fail "ssh key not fetched from alpinelinux" +} + setup_user_groups_commas_body() { init_env atf_check -s exit:0 \ |