Standardizing project structure
This commit is contained in:
parent
adc97bb5d0
commit
80529bcf79
11 changed files with 582 additions and 21 deletions
|
@ -1,18 +1,16 @@
|
|||
require 'test/unit'
|
||||
require './lxc'
|
||||
$:.unshift File.expand_path(File.join(File.dirname(__FILE__), 'lib'))
|
||||
|
||||
LXC_TEMPLATE = 'ubuntu'
|
||||
CONTAINER_NAME = 'test'
|
||||
CLONE_NAME = 'test_clone'
|
||||
require 'test/unit'
|
||||
require 'lxc'
|
||||
|
||||
class TestLXCCreated < Test::Unit::TestCase
|
||||
def setup
|
||||
if Process::Sys::geteuid != 0
|
||||
raise 'This test must be ran as root'
|
||||
end
|
||||
@name = CONTAINER_NAME
|
||||
@name = 'test'
|
||||
@container = LXC::Container.new(@name)
|
||||
@container.create(LXC_TEMPLATE) unless @container.defined?
|
||||
@container.create('ubuntu') unless @container.defined?
|
||||
end
|
||||
|
||||
def test_container_defined
|
||||
|
|
|
@ -1,19 +1,17 @@
|
|||
$:.unshift File.expand_path(File.join(File.dirname(__FILE__), 'lib'))
|
||||
|
||||
require 'test/unit'
|
||||
require 'tempfile'
|
||||
require './lxc'
|
||||
|
||||
LXC_TEMPLATE = 'ubuntu'
|
||||
CONTAINER_NAME = 'test'
|
||||
CLONE_NAME = 'test_clone'
|
||||
require 'lxc'
|
||||
|
||||
class TestLXCRunning < Test::Unit::TestCase
|
||||
def setup
|
||||
if Process::Sys::geteuid != 0
|
||||
raise 'This test must be ran as root'
|
||||
end
|
||||
@name = CONTAINER_NAME
|
||||
@name = 'test'
|
||||
@container = LXC::Container.new(@name)
|
||||
@container.create(LXC_TEMPLATE) unless @container.defined?
|
||||
@container.create('ubuntu') unless @container.defined?
|
||||
@container.start
|
||||
end
|
||||
|
||||
|
@ -92,7 +90,7 @@ class TestLXCRunning < Test::Unit::TestCase
|
|||
|
||||
assert_nothing_raised do
|
||||
begin
|
||||
clone = @container.clone(CLONE_NAME)
|
||||
clone = @container.clone('test_clone')
|
||||
clone.start
|
||||
clone.stop
|
||||
ensure
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
$:.unshift File.expand_path(File.join(File.dirname(__FILE__), 'lib'))
|
||||
|
||||
require 'test/unit'
|
||||
require './lxc'
|
||||
require 'lxc'
|
||||
|
||||
class TestLXCUndefined < Test::Unit::TestCase
|
||||
def setup
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue