2013-12-06 17:43:19 +01:00
|
|
|
$:.unshift File.expand_path(File.join(File.dirname(__FILE__), 'lib'))
|
|
|
|
|
2013-12-05 20:29:25 +01:00
|
|
|
require 'test/unit'
|
2013-12-06 17:43:19 +01:00
|
|
|
require 'lxc'
|
2013-12-05 20:29:25 +01:00
|
|
|
|
|
|
|
class TestLXCUndefined < Test::Unit::TestCase
|
|
|
|
def setup
|
2013-12-06 17:59:20 +01:00
|
|
|
@name = 'test_undefined'
|
2013-12-05 20:29:25 +01:00
|
|
|
@container = LXC::Container.new(@name)
|
|
|
|
end
|
|
|
|
|
|
|
|
def test_container_config_file_name
|
|
|
|
config_path = File.join(LXC.default_config_path, @name, 'config')
|
|
|
|
assert_equal(config_path, @container.config_file_name)
|
|
|
|
end
|
|
|
|
|
|
|
|
def test_container_not_defined
|
2013-12-06 17:59:20 +01:00
|
|
|
assert(!@container.defined?)
|
2013-12-05 20:29:25 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def test_container_init_pid
|
2013-12-06 17:59:20 +01:00
|
|
|
assert_nil(@container.init_pid)
|
2013-12-05 20:29:25 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def test_container_not_running
|
2013-12-06 17:59:20 +01:00
|
|
|
assert(!@container.running?)
|
2013-12-05 20:29:25 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def test_container_stopped
|
|
|
|
assert_equal('STOPPED', @container.state)
|
|
|
|
end
|
|
|
|
end
|