Add no-newline SSH key test

This commit is contained in:
Tom Parker-Shemilt
2019-06-12 22:30:26 +01:00
parent a848d92823
commit 024fd958e8

View File

@@ -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"'