From 419fd6b2d61e469dba72633f1f88c319d3aee9d6 Mon Sep 17 00:00:00 2001 From: Kaspars Skels Date: Sun, 21 Oct 2018 14:03:06 -0500 Subject: [PATCH] Fix SSH handling in sanity tests If file ~/.ssh/known_hosts doesn't exist (as when new VM is used) ssh-keyscan -R will fail Change-Id: I989fd3ef3ea541e6e63da6059ca0f6ff0a55bcaa --- tools/tests.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/tests.sh b/tools/tests.sh index b9164395b..f8300da9c 100755 --- a/tools/tests.sh +++ b/tools/tests.sh @@ -89,7 +89,9 @@ function wait_for_ssh_port { wait_for_ssh_port $FLOATING_IP # SSH into the VM and check it can reach the outside world +touch ~/.ssh/known_hosts ssh-keygen -R "$FLOATING_IP" + ssh-keyscan "$FLOATING_IP" >> ~/.ssh/known_hosts ssh -i ${OSH_VM_KEY_STACK} cirros@${FLOATING_IP} ping -q -c 1 -W 2 ${OSH_EXT_GATEWAY}