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
|
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)
|
||||||
|
|
Loading…
Reference in a new issue