diff options
Diffstat (limited to 'tests/setup_sshd_test')
-rwxr-xr-x | tests/setup_sshd_test | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/tests/setup_sshd_test b/tests/setup_sshd_test index b177949..1a779a4 100755 --- a/tests/setup_sshd_test +++ b/tests/setup_sshd_test @@ -7,7 +7,8 @@ init_tests \ setup_sshd_dropbear \ setup_sshd_openssh \ setup_sshd_interactive_openssh_nologin \ - setup_sshd_interactive_openssh_prohibitpass + setup_sshd_interactive_openssh_prohibitpass \ + setup_sshd_interactive_openssh_user_exist setup_sshd_usage_body() { test_usage setup-sshd @@ -85,3 +86,20 @@ setup_sshd_interactive_openssh_prohibitpass_body() { grep "$WGETCONTENT" root/.ssh/authorized_keys } +setup_sshd_interactive_openssh_user_exist_body() { + init_env + mkdir -p etc/ssh + # should not ask permit root login or ssh key if user exists + echo "joe:x:1000:1000:joe,,,:/home/joe:/bin/ash" >etc/passwd + ( + echo "openssh" + ) >answers + atf_check -s exit:0 \ + -e empty \ + -o match:"Which ssh server" \ + -o not-match:"Allow root ssh login" \ + -o not-match:"Enter ssh key" \ + -o match:"apk add.* openssh" \ + setup-sshd < answers +} + |