From a6a50d89f9c01de6560aeecd4149c5c676c47361 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Thu, 7 Jul 2022 15:22:25 +0200 Subject: tests: setup-sshd: add test for SSH_KEY env var Apparently we can set ssh key via SSH_KEY env var. make sure that it works. --- tests/setup_sshd_test | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/setup_sshd_test b/tests/setup_sshd_test index f6770e0..5048802 100755 --- a/tests/setup_sshd_test +++ b/tests/setup_sshd_test @@ -10,7 +10,8 @@ init_tests \ setup_sshd_interactive_openssh_nologin \ setup_sshd_interactive_openssh_prohibitpass \ setup_sshd_interactive_openssh_nokey \ - setup_sshd_interactive_openssh_user_exist + setup_sshd_interactive_openssh_user_exist \ + setup_sshd_openssh_ssh_key setup_sshd_usage_body() { test_usage setup-sshd @@ -138,3 +139,13 @@ setup_sshd_interactive_openssh_user_exist_body() { setup-sshd < answers } +setup_sshd_openssh_ssh_key_body() { + init_env + SSH_KEY="ssh-rsa foobar user@example.com" atf_check -s exit:0 \ + -o match:"apk add.*openssh" \ + -e empty \ + setup-sshd openssh + grep "ssh-rsa foobar user@example.com" root/.ssh/authorized_keys \ + || atf_fail "did not add ssh key" +} + -- cgit v1.2.3