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

View file

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