mirror of
https://github.com/dokku/dokku.git
synced 2025-12-29 00:25:08 +01:00
Add no-newline SSH key test
This commit is contained in:
@@ -13,6 +13,9 @@ setup() {
|
||||
# now create key that will be really used
|
||||
create_key
|
||||
|
||||
# Test key without a trailing newline
|
||||
echo -n "$KEY" > /tmp/testkey-no-newline.pub
|
||||
|
||||
# the temporary key is useful for adding in the file with two keys
|
||||
# useful for a negative test
|
||||
{ cat /tmp/testkey.pub ; echo "$KEY" ; } > /tmp/testkey-double.pub
|
||||
@@ -70,6 +73,10 @@ teardown() {
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
run /bin/bash -c "dokku ssh-keys:add name5 /tmp/testkey-no-newline.pub"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
# leave this as the last test in the sequence! It introduces an error in authorized_keys
|
||||
run /bin/bash -c 'echo invalid >> "${DOKKU_ROOT:-/home/dokku}/.ssh/authorized_keys"'
|
||||
|
||||
Reference in New Issue
Block a user