lxc 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,7 +6,7 @@ rvm:
6
6
  - 2.0.0
7
7
 
8
8
  before_install:
9
- - sudo apt-get -qq --force-yes update
9
+ - sudo apt-get -qq -y --force-yes update
10
10
 
11
11
  bundler_args: --binstubs
12
12
 
@@ -2,7 +2,7 @@ class LXC
2
2
 
3
3
  unless const_defined?(:VERSION)
4
4
  # LXC Gem Version
5
- VERSION = "0.0.5"
5
+ VERSION = "0.0.6"
6
6
  end
7
7
 
8
8
  end
@@ -0,0 +1 @@
1
+ state: STOPPED
File without changes
File without changes
@@ -4,19 +4,7 @@ describe LXC::Container do
4
4
 
5
5
  TEST_CONTAINER_NAME = "test-container"
6
6
 
7
- subject {
8
-
9
- ssh_connection = ::ZTK::SSH.new(
10
- :host_name => "127.0.0.1",
11
- :user => ENV['USER'],
12
- :keys => "#{ENV['HOME']}/.ssh/id_rsa"
13
- ).ssh
14
-
15
- @lxc = LXC.new
16
- @lxc.use_ssh = ssh_connection
17
-
18
- LXC::Container.new(@lxc, TEST_CONTAINER_NAME)
19
- }
7
+ subject { LXC::Container.new(LXC.new, TEST_CONTAINER_NAME) }
20
8
 
21
9
  describe "class" do
22
10
 
@@ -27,11 +15,9 @@ describe LXC::Container do
27
15
  describe "attributes" do
28
16
 
29
17
  describe "#name" do
30
-
31
18
  it "should be readable and match what was passed to the initializer" do
32
19
  subject.name.should == TEST_CONTAINER_NAME
33
20
  end
34
-
35
21
  end
36
22
 
37
23
  end
@@ -40,32 +26,41 @@ describe LXC::Container do
40
26
 
41
27
  describe "methods" do
42
28
 
43
- describe "#exists?" do
44
- it "should return false for an un-created remote container" do
45
- subject.exists?.should == false
46
- end
47
- end
29
+ LXC_VERSIONS.each do |lxc_version|
30
+ context "LXC Target Version #{lxc_version}" do
48
31
 
49
- describe "#pid" do
50
- it "should return -1 for an un-created remote container" do
51
- subject.pid.should == -1
52
- end
53
- end
32
+ describe "#exists?" do
33
+ it "should return false for an un-created remote container" do
34
+ subject.stub(:exec) { lxc_fixture(lxc_version, "lxc-ls-wo-containers.out") }
54
35
 
55
- describe "#state" do
56
- it "should return stopped for an un-created remote container" do
57
- subject.state.should == :stopped
58
- end
59
- end
36
+ subject.exists?.should == false
37
+ end
38
+ end
60
39
 
61
- describe "#wait" do
62
- it "should timeout while waiting for a non-existant remote container to start" do
63
- subject.wait([:running], 1).should == false
64
- %x(pkill -f lxc-wait)
65
- end
40
+ describe "#pid" do
41
+ it "should return -1 for an un-created remote container" do
42
+ subject.stub(:exec) { lxc_fixture(lxc_version, "lxc-info-pid-stopped.out") }
43
+
44
+ subject.pid.should == -1
45
+ end
46
+ end
47
+
48
+ describe "#state" do
49
+ it "should return stopped for an un-created remote container" do
50
+ subject.stub(:exec) { lxc_fixture(lxc_version, "lxc-info-state-stopped.out") }
51
+
52
+ subject.state.should == :stopped
53
+ end
54
+ end
55
+
56
+ describe "#wait" do
57
+ it "should be successfully when waiting to stop a non-existant remote container" do
58
+ subject.stub(:exec) { lxc_fixture(lxc_version, "lxc-wait.out") }
59
+
60
+ subject.wait([:stopped], 120).should == true
61
+ end
62
+ end
66
63
 
67
- it "should be successfully when waiting to stop a non-existant remote container" do
68
- subject.wait([:stopped], 120).should == true
69
64
  end
70
65
  end
71
66
 
@@ -27,7 +27,6 @@ describe LXC do
27
27
  describe "methods" do
28
28
 
29
29
  LXC_VERSIONS.each do |lxc_version|
30
-
31
30
  context "LXC Target Version #{lxc_version}" do
32
31
 
33
32
  describe "#ls" do
@@ -185,7 +184,6 @@ describe LXC do
185
184
  end
186
185
 
187
186
  end # LXC Version Context
188
-
189
187
  end # LXC_VERSIONS
190
188
 
191
189
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: lxc
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.5
5
+ version: 0.0.6
6
6
  platform: ruby
7
7
  authors:
8
8
  - Zachary Patten
@@ -124,15 +124,21 @@ files:
124
124
  - lib/lxc/version.rb
125
125
  - lxc.gemspec
126
126
  - spec/fixtures/0.7.5/lxc-checkconfig.out
127
+ - spec/fixtures/0.7.5/lxc-info-pid-stopped.out
128
+ - spec/fixtures/0.7.5/lxc-info-state-stopped.out
127
129
  - spec/fixtures/0.7.5/lxc-ls-w-containers.out
128
130
  - spec/fixtures/0.7.5/lxc-ls-wo-containers.out
129
131
  - spec/fixtures/0.7.5/lxc-ps.out
130
132
  - spec/fixtures/0.7.5/lxc-version.out
133
+ - spec/fixtures/0.7.5/lxc-wait.out
131
134
  - spec/fixtures/0.8.0-rc2/lxc-checkconfig.out
135
+ - spec/fixtures/0.8.0-rc2/lxc-info-pid-stopped.out
136
+ - spec/fixtures/0.8.0-rc2/lxc-info-state-stopped.out
132
137
  - spec/fixtures/0.8.0-rc2/lxc-ls-w-containers.out
133
138
  - spec/fixtures/0.8.0-rc2/lxc-ls-wo-containers.out
134
139
  - spec/fixtures/0.8.0-rc2/lxc-ps.out
135
140
  - spec/fixtures/0.8.0-rc2/lxc-version.out
141
+ - spec/fixtures/0.8.0-rc2/lxc-wait.out
136
142
  - spec/lxc/container_spec.rb
137
143
  - spec/lxc_spec.rb
138
144
  - spec/spec_helper.rb
@@ -149,7 +155,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
149
155
  requirements:
150
156
  - - ">="
151
157
  - !ruby/object:Gem::Version
152
- hash: 479965379080138848
158
+ hash: -1821779695803479880
153
159
  segments:
154
160
  - 0
155
161
  version: "0"
@@ -158,7 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
158
164
  requirements:
159
165
  - - ">="
160
166
  - !ruby/object:Gem::Version
161
- hash: 479965379080138848
167
+ hash: -1821779695803479880
162
168
  segments:
163
169
  - 0
164
170
  version: "0"
@@ -171,15 +177,21 @@ specification_version: 3
171
177
  summary: An interface for controlling local or remote Linux Containers (LXC)
172
178
  test_files:
173
179
  - spec/fixtures/0.7.5/lxc-checkconfig.out
180
+ - spec/fixtures/0.7.5/lxc-info-pid-stopped.out
181
+ - spec/fixtures/0.7.5/lxc-info-state-stopped.out
174
182
  - spec/fixtures/0.7.5/lxc-ls-w-containers.out
175
183
  - spec/fixtures/0.7.5/lxc-ls-wo-containers.out
176
184
  - spec/fixtures/0.7.5/lxc-ps.out
177
185
  - spec/fixtures/0.7.5/lxc-version.out
186
+ - spec/fixtures/0.7.5/lxc-wait.out
178
187
  - spec/fixtures/0.8.0-rc2/lxc-checkconfig.out
188
+ - spec/fixtures/0.8.0-rc2/lxc-info-pid-stopped.out
189
+ - spec/fixtures/0.8.0-rc2/lxc-info-state-stopped.out
179
190
  - spec/fixtures/0.8.0-rc2/lxc-ls-w-containers.out
180
191
  - spec/fixtures/0.8.0-rc2/lxc-ls-wo-containers.out
181
192
  - spec/fixtures/0.8.0-rc2/lxc-ps.out
182
193
  - spec/fixtures/0.8.0-rc2/lxc-version.out
194
+ - spec/fixtures/0.8.0-rc2/lxc-wait.out
183
195
  - spec/lxc/container_spec.rb
184
196
  - spec/lxc_spec.rb
185
197
  - spec/spec_helper.rb