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