testlab 1.3.1 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.travis.yml +2 -0
- data/README.md +1 -1
- data/lib/testlab/container.rb +2 -2
- data/lib/testlab/interface.rb +1 -1
- data/lib/testlab/labfile.rb +9 -0
- data/lib/testlab/network.rb +2 -2
- data/lib/testlab/node.rb +3 -1
- data/lib/testlab/user.rb +1 -1
- data/lib/testlab/version.rb +1 -1
- data/spec/container_spec.rb +7 -0
- data/spec/network_spec.rb +8 -0
- data/spec/node_spec.rb +8 -0
- metadata +4 -4
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
[](http://badge.fury.io/rb/testlab)
|
2
2
|
[](https://gemnasium.com/zpatten/testlab)
|
3
|
-
[](http://travis-ci.org/lookout/testlab)
|
4
4
|
[](https://coveralls.io/r/zpatten/testlab)
|
5
5
|
[](https://codeclimate.com/github/zpatten/testlab)
|
6
6
|
|
data/lib/testlab/container.rb
CHANGED
@@ -132,10 +132,10 @@ class TestLab
|
|
132
132
|
|
133
133
|
|
134
134
|
def initialize(*args)
|
135
|
-
@ui
|
135
|
+
@ui = TestLab.ui
|
136
136
|
|
137
|
+
@ui.logger.info { "Loading Container '#{self.id}'" }
|
137
138
|
super(*args)
|
138
|
-
|
139
139
|
@ui.logger.info { "Container '#{self.id}' Loaded" }
|
140
140
|
end
|
141
141
|
|
data/lib/testlab/interface.rb
CHANGED
data/lib/testlab/labfile.rb
CHANGED
@@ -11,6 +11,15 @@ class TestLab
|
|
11
11
|
|
12
12
|
attribute :testlab
|
13
13
|
attribute :config, :default => Hash.new
|
14
|
+
attribute :version, :default => TestLab::VERSION
|
15
|
+
|
16
|
+
def initialize(*args)
|
17
|
+
@ui = TestLab.ui
|
18
|
+
|
19
|
+
@ui.logger.info { "Loading Labfile '#{self.id}'" }
|
20
|
+
super(*args)
|
21
|
+
@ui.logger.info { "Labfile '#{self.id}' Loaded" }
|
22
|
+
end
|
14
23
|
|
15
24
|
def config_dir
|
16
25
|
self.testlab.config_dir
|
data/lib/testlab/network.rb
CHANGED
data/lib/testlab/node.rb
CHANGED
data/lib/testlab/user.rb
CHANGED
data/lib/testlab/version.rb
CHANGED
data/spec/container_spec.rb
CHANGED
@@ -153,6 +153,7 @@ describe TestLab::Container do
|
|
153
153
|
subject.lxc.stub(:state) { :not_created }
|
154
154
|
subject.lxc_clone.stub(:exists?) { false }
|
155
155
|
subject.node.ssh.stub(:exec)
|
156
|
+
subject.stub(:provisioners) { Array.new }
|
156
157
|
|
157
158
|
subject.create
|
158
159
|
end
|
@@ -165,6 +166,7 @@ describe TestLab::Container do
|
|
165
166
|
subject.lxc.stub(:state) { :stopped }
|
166
167
|
subject.lxc.stub(:destroy) { true }
|
167
168
|
subject.lxc_clone.stub(:exists?) { false }
|
169
|
+
subject.stub(:provisioners) { Array.new }
|
168
170
|
|
169
171
|
subject.destroy
|
170
172
|
end
|
@@ -178,9 +180,12 @@ describe TestLab::Container do
|
|
178
180
|
subject.lxc.stub(:wait) { true }
|
179
181
|
subject.lxc.stub(:state) { :running }
|
180
182
|
subject.lxc.stub(:attach)
|
183
|
+
subject.stub(:provisioners) { Array.new }
|
181
184
|
|
182
185
|
subject.lxc_clone.stub(:exists?) { false }
|
183
186
|
|
187
|
+
ZTK::TCPSocketCheck.any_instance.stub(:wait) { true }
|
188
|
+
|
184
189
|
subject.up
|
185
190
|
end
|
186
191
|
end
|
@@ -192,6 +197,8 @@ describe TestLab::Container do
|
|
192
197
|
subject.lxc.stub(:stop) { true }
|
193
198
|
subject.lxc.stub(:wait) { true }
|
194
199
|
subject.lxc.stub(:state) { :stopped }
|
200
|
+
subject.stub(:provisioners) { Array.new }
|
201
|
+
|
195
202
|
subject.down
|
196
203
|
end
|
197
204
|
end
|
data/spec/network_spec.rb
CHANGED
@@ -112,6 +112,8 @@ describe TestLab::Network do
|
|
112
112
|
subject.node.stub(:state) { :running }
|
113
113
|
subject.stub(:state) { :not_created }
|
114
114
|
subject.node.ssh.stub(:bootstrap) { true }
|
115
|
+
subject.stub(:provisioners) { Array.new }
|
116
|
+
|
115
117
|
subject.create
|
116
118
|
end
|
117
119
|
end
|
@@ -121,6 +123,8 @@ describe TestLab::Network do
|
|
121
123
|
subject.node.stub(:state) { :running }
|
122
124
|
subject.stub(:state) { :stopped }
|
123
125
|
subject.node.ssh.stub(:bootstrap) { true }
|
126
|
+
subject.stub(:provisioners) { Array.new }
|
127
|
+
|
124
128
|
subject.destroy
|
125
129
|
end
|
126
130
|
end
|
@@ -130,6 +134,8 @@ describe TestLab::Network do
|
|
130
134
|
subject.node.stub(:state) { :running }
|
131
135
|
subject.stub(:state) { :stopped }
|
132
136
|
subject.node.ssh.stub(:bootstrap) { true }
|
137
|
+
subject.stub(:provisioners) { Array.new }
|
138
|
+
|
133
139
|
subject.up
|
134
140
|
end
|
135
141
|
end
|
@@ -139,6 +145,8 @@ describe TestLab::Network do
|
|
139
145
|
subject.node.stub(:state) { :running }
|
140
146
|
subject.stub(:state) { :running }
|
141
147
|
subject.node.ssh.stub(:bootstrap) { true }
|
148
|
+
subject.stub(:provisioners) { Array.new }
|
149
|
+
|
142
150
|
subject.down
|
143
151
|
end
|
144
152
|
end
|
data/spec/node_spec.rb
CHANGED
@@ -71,6 +71,8 @@ describe TestLab::Node do
|
|
71
71
|
it "should create the node" do
|
72
72
|
subject.instance_variable_get(:@provider).stub(:create) { true }
|
73
73
|
subject.stub(:state) { :not_created }
|
74
|
+
subject.stub(:provisioners) { Array.new }
|
75
|
+
|
74
76
|
subject.create
|
75
77
|
end
|
76
78
|
end
|
@@ -79,6 +81,8 @@ describe TestLab::Node do
|
|
79
81
|
it "should destroy the node" do
|
80
82
|
subject.instance_variable_get(:@provider).stub(:destroy) { true }
|
81
83
|
subject.stub(:state) { :stopped }
|
84
|
+
subject.stub(:provisioners) { Array.new }
|
85
|
+
|
82
86
|
subject.destroy
|
83
87
|
end
|
84
88
|
end
|
@@ -87,6 +91,8 @@ describe TestLab::Node do
|
|
87
91
|
it "should online the node" do
|
88
92
|
subject.instance_variable_get(:@provider).stub(:up) { true }
|
89
93
|
subject.stub(:state) { :stopped }
|
94
|
+
subject.stub(:provisioners) { Array.new }
|
95
|
+
|
90
96
|
subject.up
|
91
97
|
end
|
92
98
|
end
|
@@ -95,6 +101,8 @@ describe TestLab::Node do
|
|
95
101
|
it "should offline the node" do
|
96
102
|
subject.instance_variable_get(:@provider).stub(:down) { true }
|
97
103
|
subject.stub(:state) { :running }
|
104
|
+
subject.stub(:provisioners) { Array.new }
|
105
|
+
|
98
106
|
subject.down
|
99
107
|
end
|
100
108
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: testlab
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-08-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: gli
|
@@ -338,7 +338,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
338
338
|
version: '0'
|
339
339
|
segments:
|
340
340
|
- 0
|
341
|
-
hash:
|
341
|
+
hash: 3530419206438769386
|
342
342
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
343
343
|
none: false
|
344
344
|
requirements:
|
@@ -347,7 +347,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
347
347
|
version: '0'
|
348
348
|
segments:
|
349
349
|
- 0
|
350
|
-
hash:
|
350
|
+
hash: 3530419206438769386
|
351
351
|
requirements: []
|
352
352
|
rubyforge_project:
|
353
353
|
rubygems_version: 1.8.25
|