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
def teardown
begin
@container.shutdown(3)
rescue LXC::Error
if @container.running?
@container.stop
@container.wait(:stopped, 3)
end
end
assert(!@container.running?)
end
def test_container_running
@container.wait(:running, 3)