From bfbd57490bf5cfbf5b78f294628f36a5b6ba06ed Mon Sep 17 00:00:00 2001 From: deajan Date: Fri, 2 Sep 2016 20:31:49 +0200 Subject: [PATCH] Added known_hosts workaround for ssh tests --- dev/tests/run_tests.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/dev/tests/run_tests.sh b/dev/tests/run_tests.sh index ef9b0cf..d023a76 100755 --- a/dev/tests/run_tests.sh +++ b/dev/tests/run_tests.sh @@ -1,12 +1,9 @@ #!/usr/bin/env bash -## obackup basic tests suite 2016090203 +## obackup basic tests suite 2016090204 #TODO: Must recreate files before each test set -ping localhost -gpg --help - OBACKUP_DIR="$(pwd)" OBACKUP_DIR=${OBACKUP_DIR%%/dev*} DEV_DIR="$OBACKUP_DIR/dev" @@ -146,7 +143,11 @@ function SetupSSH { echo -e 'y\n'| ssh-keygen -t rsa -b 2048 -N "" -f "${HOME}/.ssh/id_rsa_local" cat "${HOME}/.ssh/id_rsa_local.pub" >> "${HOME}/.ssh/authorized_keys" chmod 600 "${HOME}/.ssh/authorized_keys" - ls ${HOME}/.ssh -lah + + # Add localhost to known hosts so self connect works + if [ -z $(ssh-keygen -F localhost) ]; then + ssh-keyscan -H localhost >> ~/.ssh/known_hosts + fi } function oneTimeSetUp () {