Ensure #stop is called if #shutdown fails in test

This commit is contained in:
Andre Nathan 2014-02-11 08:45:58 -02:00
parent a453b51005
commit f3dc3e3de0

View file

@ -16,12 +16,16 @@ class TestLXCRunning < Test::Unit::TestCase
end end
def teardown def teardown
begin
@container.shutdown(3) @container.shutdown(3)
rescue LXC::Error
if @container.running? if @container.running?
@container.stop @container.stop
@container.wait(:stopped, 3) @container.wait(:stopped, 3)
end end
end end
assert(!@container.running?)
end
def test_container_running def test_container_running
@container.wait(:running, 3) @container.wait(:running, 3)