Add no-newline SSH key test
This commit is contained in:
1 parent
a848d92823
commit
024fd958e8
1 file changed
+7
@@ -13,6 +13,9 @@ setup() {
|
|||||||
# now create key that will be really used
|
# now create key that will be really used
|
||||||
create_key
|
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
|
# the temporary key is useful for adding in the file with two keys
|
||||||
# useful for a negative test
|
# useful for a negative test
|
||||||
{ cat /tmp/testkey.pub ; echo "$KEY" ; } > /tmp/testkey-double.pub
|
{ cat /tmp/testkey.pub ; echo "$KEY" ; } > /tmp/testkey-double.pub
|
||||||
@@ -70,6 +73,10 @@ teardown() {
|
|||||||
echo "output: $output"
|
echo "output: $output"
|
||||||
echo "status: $status"
|
echo "status: $status"
|
||||||
assert_success
|
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
|
# 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"'
|
run /bin/bash -c 'echo invalid >> "${DOKKU_ROOT:-/home/dokku}/.ssh/authorized_keys"'
|
||||||
|
|||||||
Reference in new issue
Block a user