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,11 +16,15 @@ class TestLXCRunning < Test::Unit::TestCase
end end
def teardown def teardown
@container.shutdown(3) begin
if @container.running? @container.shutdown(3)
@container.stop rescue LXC::Error
@container.wait(:stopped, 3) if @container.running?
@container.stop
@container.wait(:stopped, 3)
end
end end
assert(!@container.running?)
end end
def test_container_running def test_container_running