make ssh tests work with vagrant ssh user

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
This commit is contained in:
Dominik Richter 2015-09-25 00:55:54 +02:00
parent 5ed71ef444
commit 3858606fb7
2 changed files with 4 additions and 8 deletions

View file

@ -47,16 +47,12 @@ execute 'create ssh key' do
not_if 'test -e /root/.ssh/id_rsa'
end
remote_file 'copy ssh key to authorized keys' do
path '/root/.ssh/authorized_keys'
source 'file:///root/.ssh/id_rsa.pub'
owner 'root'
group 'root'
mode 0644
execute 'add ssh key to vagrant user' do
command 'cat /root/.ssh/id_rsa.pub >> /home/vagrant/.ssh/authorized_keys'
end
execute 'test ssh connection' do
command 'ssh -o StrictHostKeyChecking=no -i /root/.ssh/id_rsa root@localhost "echo 1"'
command 'ssh -o StrictHostKeyChecking=no -i /root/.ssh/id_rsa vagrant@localhost "echo 1"'
end
# execute tests

View file

@ -6,7 +6,7 @@ backends = {}
backends[:specinfra_ssh] = proc {
backend_conf = Vulcano::Backend.target_config({
'target' => 'ssh://root@localhost',
'target' => 'ssh://vagrant@localhost',
'key_file' => '/root/.ssh/id_rsa',
})
backend_class = Vulcano::Backend.registry['specinfra']