jamie-lxc 0.0.1.alpha5 → 0.0.1.alpha6
Sign up to get free protection for your applications and to get access to all the features.
- data/jamie-lxc.gemspec +2 -2
- data/lib/jamie/driver/lxc.rb +6 -10
- data/test/lxc_driver_tests.rb +14 -6
- metadata +4 -4
data/jamie-lxc.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |gem|
|
2
2
|
gem.name = "jamie-lxc"
|
3
|
-
gem.version = "0.0.1.
|
3
|
+
gem.version = "0.0.1.alpha6"
|
4
4
|
gem.authors = ["Sean Porter"]
|
5
5
|
gem.email = ["portertech@gmail.com"]
|
6
6
|
gem.description = "LXC driver for Jamie"
|
@@ -9,7 +9,7 @@ Gem::Specification.new do |gem|
|
|
9
9
|
gem.license = "MIT"
|
10
10
|
gem.has_rdoc = false
|
11
11
|
|
12
|
-
gem.add_dependency("jamie", ">= 0.1.0.
|
12
|
+
gem.add_dependency("jamie", ">= 0.1.0.alpha19")
|
13
13
|
|
14
14
|
gem.add_development_dependency("rake")
|
15
15
|
|
data/lib/jamie/driver/lxc.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
require "securerandom"
|
2
|
-
require "benchmark"
|
3
2
|
require "jamie"
|
4
3
|
|
5
4
|
module Jamie
|
@@ -14,18 +13,15 @@ module Jamie
|
|
14
13
|
default_config "username", "jamie"
|
15
14
|
default_config "password", "jamie"
|
16
15
|
|
17
|
-
def create(
|
16
|
+
def create(state)
|
18
17
|
state["container_id"] = instance.name + "-" + ::SecureRandom.hex(3)
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
wait_for_sshd(state["hostname"])
|
24
|
-
end
|
25
|
-
puts " Created #{state["container_id"]} in #{elapsed_time.real} seconds."
|
18
|
+
clone_container(state)
|
19
|
+
start_container(state)
|
20
|
+
state["hostname"] = container_ip(state)
|
21
|
+
wait_for_sshd(state["hostname"])
|
26
22
|
end
|
27
23
|
|
28
|
-
def destroy(
|
24
|
+
def destroy(state)
|
29
25
|
if state["container_id"]
|
30
26
|
destroy_container(state)
|
31
27
|
end
|
data/test/lxc_driver_tests.rb
CHANGED
@@ -1,24 +1,32 @@
|
|
1
1
|
require "minitest/spec"
|
2
2
|
require "minitest/autorun"
|
3
|
+
require "stringio"
|
3
4
|
|
4
5
|
require File.join(File.dirname(__FILE__), "..", "lib", "jamie", "driver", "lxc")
|
5
6
|
|
6
7
|
describe Jamie::Driver::Lxc do
|
7
8
|
|
8
9
|
before do
|
9
|
-
|
10
|
-
|
11
|
-
"jamie_root"
|
10
|
+
@logger_output = StringIO.new
|
11
|
+
driver_options = {
|
12
|
+
"jamie_root" => File.dirname(__FILE__),
|
12
13
|
"base_container" => "ubuntu-1204"
|
13
14
|
}
|
14
|
-
|
15
|
-
|
16
|
-
|
15
|
+
instance_options = {
|
16
|
+
"logger" => Jamie::Logger.new(:stdout => @logger_output),
|
17
|
+
"suite" => Jamie::Suite.new("name" => "test", "run_list" => Array.new),
|
18
|
+
"platform" => Jamie::Platform.new("name" => "ubuntu-1204"),
|
19
|
+
"driver" => Jamie::Driver::Lxc.new(driver_options),
|
20
|
+
"jr" => Jamie::Jr.new("test")
|
21
|
+
}
|
22
|
+
@instance = Jamie::Instance.new(instance_options)
|
17
23
|
end
|
18
24
|
|
19
25
|
it "can clone a base lxc container" do
|
20
26
|
@instance.create
|
27
|
+
@logger_output.string.must_match(/creation of <test-ubuntu-1204> complete/i)
|
21
28
|
@instance.destroy
|
29
|
+
@logger_output.string.must_match(/destruction of <test-ubuntu-1204> complete/i)
|
22
30
|
end
|
23
31
|
|
24
32
|
end
|
metadata
CHANGED
@@ -2,14 +2,14 @@
|
|
2
2
|
name: jamie-lxc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease: 6
|
5
|
-
version: 0.0.1.
|
5
|
+
version: 0.0.1.alpha6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Sean Porter
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-01-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
type: :runtime
|
@@ -18,14 +18,14 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 0.1.0.
|
21
|
+
version: 0.1.0.alpha19
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
none: false
|
25
25
|
requirements:
|
26
26
|
- - ! '>='
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
version: 0.1.0.
|
28
|
+
version: 0.1.0.alpha19
|
29
29
|
name: jamie
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
type: :development
|