From e43941756aa8430effbd7c42a831adee6132a004 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Tue, 28 Jun 2022 12:47:12 +0200 Subject: tests: setup-user: add test for -k opt ref https://gitlab.alpinelinux.org/alpine/alpine-conf/-/merge_requests/70 --- tests/setup_user_test | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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" +} + + -- cgit v1.2.3