summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2022-05-21 14:14:15 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2022-05-21 14:14:15 +0200
commit52f89df6f1cbe6ab092a93522dfaaa403094ef79 (patch)
treeae3639e7723973021ce96a64da504a7b20c11c50 /tests
parenta3a8dfaf6669b61f289ced571a14e8d0067e5d68 (diff)
downloadalpine-conf-52f89df6f1cbe6ab092a93522dfaaa403094ef79.zip
setup-sshd: dont ask for root login if user was created
Don't ask about root login if a user account was created
Diffstat (limited to 'tests')
-rwxr-xr-xtests/setup_sshd_test20
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
+}
+