migrate transport runner tests

This commit is contained in:
Dominik Richter 2015-10-05 23:46:33 +02:00
parent 6d54b6e2c5
commit 5662bb7383
5 changed files with 11 additions and 16 deletions

View file

@ -25,7 +25,7 @@ class Cmd < Vulcano.resource(1)
end
def exist?
res = vulcano.run_command("type \"#{@command}\" > /dev/null")
res = vulcano.backend.run_command("type \"#{@command}\" > /dev/null")
res.exit_status.to_i == 0
end
end

View file

@ -1,4 +1,5 @@
# encoding: utf-8
describe command('echo hello') do
its(:stdout) { should eq "hello\n" }
its(:stderr) { should eq '' }

View file

@ -11,9 +11,8 @@ puts ''
backends = {}
backends[:docker] = proc {
backend_conf = Vulcano::Backend.target_config({ 'host' => container_id })
backend_class = Vulcano::Backend.registry['docker']
backend_class.new(backend_conf)
opt = { 'host' => container_id }
Vulcano::Backend.create('docker', opt)
}
backends.each do |type, get_backend|

View file

@ -5,15 +5,12 @@ require 'vulcano/backend'
backends = {}
backends[:local] = proc {
backend_conf = Vulcano::Backend.target_config({})
backend_class = Vulcano::Backend.registry['local']
backend_class.new(backend_conf)
Vulcano::Backend.create('local', {}).backend
}
backends[:specinfra_local] = proc {
backend_conf = Vulcano::Backend.target_config({ 'backend' => 'exec' })
backend_class = Vulcano::Backend.registry['specinfra']
backend_class.new(backend_conf)
opt = { 'backend' => 'exec' }
Vulcano::Backend.create('specinfra', opt).backend
}
tests = ARGV

View file

@ -3,19 +3,17 @@ require_relative 'helper'
require 'vulcano/backend'
backends = {}
backend_conf = Vulcano::Backend.target_config({
backend_conf = {
'target' => 'ssh://vagrant@localhost',
'key_file' => '/root/.ssh/id_rsa',
})
}
backends[:specinfra_ssh] = proc {
backend_class = Vulcano::Backend.registry['specinfra']
backend_class.new(backend_conf)
Vulcano::Backend.create('specinfra', backend_conf).backend
}
backends[:ssh] = proc {
backend_class = Vulcano::Backend.registry['ssh']
backend_class.new(backend_conf)
Vulcano::Backend.create('ssh', backend_conf).backend
}
tests = ARGV