Ensure #stop is called if #shutdown fails in test
This commit is contained in:
parent
a453b51005
commit
f3dc3e3de0
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue