Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
This commit is contained in:
Dominik Richter 2015-09-08 14:25:24 +02:00
parent ae44b904e1
commit a6c47a2e39
2 changed files with 12 additions and 12 deletions

View file

@ -81,7 +81,7 @@ module Vulcano
ctx.rules.each do |rule_id, rule|
#::Vulcano::DSL.execute_rule(rule, profile_id)
checks = rule.instance_variable_get(:@checks)
checks.each do |m, a, b|
checks.each do |_, a, b|
# resource skipping
if !a.empty? &&
a[0].respond_to?(:resource_skipped) &&

View file

@ -18,12 +18,12 @@ class DockerTester
end
def run
puts ["Running tests:", @tests].flatten.join("\n- ")
puts ['Running tests:', @tests].flatten.join("\n- ")
puts ''
# test all images
@conf['images'].each{|n|
@conf['images'].each do |n|
test_image(n)
}.all? or raise "Test failures"
end.all? or fail 'Test failures'
end
def docker_images_by_tag
@ -39,9 +39,9 @@ class DockerTester
def tests_conf
# get the test configuration
conf_path = File::join(File::dirname(__FILE__), '..', '.tests.yaml')
raise "Can't find tests config in #{conf_path}" unless File::file?(conf_path)
conf = YAML.load(File::read(conf_path))
conf_path = File.join(File.dirname(__FILE__), '..', '.tests.yaml')
fail "Can't find tests config in #{conf_path}" unless File.file?(conf_path)
YAML.load(File.read(conf_path))
end
def test_container(container_id)
@ -54,13 +54,13 @@ class DockerTester
def test_image(name)
dname = "docker-#{name}:latest"
image = @images[dname]
raise "Can't find docker image #{dname}" if image.nil?
fail "Can't find docker image #{dname}" if image.nil?
puts "--> start docker #{name}"
container = Docker::Container.create(
'Cmd' => [ '/bin/bash' ],
'Cmd' => %w{ /bin/bash },
'Image' => image.id,
'OpenStdin' => true,
'OpenStdin' => true
)
container.start