testlab 0.7.6 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +2 -1
- data/bin/tl +8 -4
- data/features/step_definitions/testlab_steps.rb +5 -1
- data/features/support/Labfile.local +46 -0
- data/features/support/Labfile.vagrant +58 -0
- data/features/support/env.rb +8 -0
- data/features/testlab.feature +4 -8
- data/lib/commands/container.rb +28 -240
- data/lib/commands/network.rb +27 -193
- data/lib/commands/node.rb +9 -160
- data/lib/commands/testlab.rb +72 -10
- data/lib/testlab/container/actions.rb +2 -2
- data/lib/testlab/container/io.rb +21 -12
- data/lib/testlab/container/lifecycle.rb +13 -0
- data/lib/testlab/container/ssh.rb +2 -2
- data/lib/testlab/container.rb +3 -1
- data/lib/testlab/interface.rb +2 -0
- data/lib/testlab/network/actions.rb +2 -2
- data/lib/testlab/network/lifecycle.rb +15 -0
- data/lib/testlab/network/status.rb +1 -1
- data/lib/testlab/network.rb +3 -1
- data/lib/testlab/node/lifecycle.rb +9 -0
- data/lib/testlab/node.rb +2 -0
- data/lib/testlab/user.rb +2 -0
- data/lib/testlab/utility/gli.rb +83 -0
- data/lib/testlab/utility/logger.rb +35 -30
- data/lib/testlab/utility.rb +2 -0
- data/lib/testlab/version.rb +1 -1
- data/lib/testlab.rb +111 -38
- data/spec/container_spec.rb +4 -0
- data/spec/network_spec.rb +4 -0
- metadata +9 -6
- data/features/support/Labfile +0 -85
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: 0.
|
4
|
+
version: 0.8.0
|
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-07-
|
12
|
+
date: 2013-07-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: gli
|
@@ -226,7 +226,8 @@ files:
|
|
226
226
|
- features/step_definitions/network_steps.rb
|
227
227
|
- features/step_definitions/node_steps.rb
|
228
228
|
- features/step_definitions/testlab_steps.rb
|
229
|
-
- features/support/Labfile
|
229
|
+
- features/support/Labfile.local
|
230
|
+
- features/support/Labfile.vagrant
|
230
231
|
- features/support/env.rb
|
231
232
|
- features/testlab.feature
|
232
233
|
- lib/commands/container.rb
|
@@ -297,6 +298,7 @@ files:
|
|
297
298
|
- lib/testlab/user/lifecycle.rb
|
298
299
|
- lib/testlab/utility.rb
|
299
300
|
- lib/testlab/utility/cidr.rb
|
301
|
+
- lib/testlab/utility/gli.rb
|
300
302
|
- lib/testlab/utility/logger.rb
|
301
303
|
- lib/testlab/utility/misc.rb
|
302
304
|
- lib/testlab/version.rb
|
@@ -327,7 +329,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
327
329
|
version: '0'
|
328
330
|
segments:
|
329
331
|
- 0
|
330
|
-
hash:
|
332
|
+
hash: 762214206939884966
|
331
333
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
332
334
|
none: false
|
333
335
|
requirements:
|
@@ -336,7 +338,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
336
338
|
version: '0'
|
337
339
|
segments:
|
338
340
|
- 0
|
339
|
-
hash:
|
341
|
+
hash: 762214206939884966
|
340
342
|
requirements: []
|
341
343
|
rubyforge_project:
|
342
344
|
rubygems_version: 1.8.25
|
@@ -348,7 +350,8 @@ test_files:
|
|
348
350
|
- features/step_definitions/network_steps.rb
|
349
351
|
- features/step_definitions/node_steps.rb
|
350
352
|
- features/step_definitions/testlab_steps.rb
|
351
|
-
- features/support/Labfile
|
353
|
+
- features/support/Labfile.local
|
354
|
+
- features/support/Labfile.vagrant
|
352
355
|
- features/support/env.rb
|
353
356
|
- features/testlab.feature
|
354
357
|
- spec/container_spec.rb
|
data/features/support/Labfile
DELETED
@@ -1,85 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
#^syntax detection
|
3
|
-
|
4
|
-
# Labfile Simple Example
|
5
|
-
#########################
|
6
|
-
# This is a simple example that builds a lab with a chef-server and chef-client.
|
7
|
-
|
8
|
-
# Here we define our node; in this case we are using the localhost. We've
|
9
|
-
# selected the Vagrant provider so the Vagrant VM will be our target LXC node.
|
10
|
-
node :vagrant do
|
11
|
-
|
12
|
-
# This sets the provider for our node. This could be many things, from
|
13
|
-
# Vagrant, to AWS, to Local, to custom internal providers. Any class can be
|
14
|
-
# supplied assuming it's interface honors our contract.
|
15
|
-
provider TestLab::Provider::Vagrant
|
16
|
-
|
17
|
-
# These are provisioners that only need to run against the node (i.e. they
|
18
|
-
# do not have any container components). Provisioner classes applied to
|
19
|
-
# containers only are automatically interogated and executed during runtime
|
20
|
-
# if they have a node component.
|
21
|
-
provisioners [
|
22
|
-
TestLab::Provisioner::Raring,
|
23
|
-
TestLab::Provisioner::Bind
|
24
|
-
]
|
25
|
-
|
26
|
-
# this is a generic configuration object (hash) which is supplied to
|
27
|
-
# the provider
|
28
|
-
config ({
|
29
|
-
:vagrant => {
|
30
|
-
:id => "test-cucumber-#{TestLab.hostname}".downcase,
|
31
|
-
:cpus => ZTK::Parallel::MAX_FORKS.div(2), # use half of the available processors
|
32
|
-
:memory => ZTK::Parallel::MAX_MEMORY.div(3).div(1024 * 1024), # use a third of available RAM
|
33
|
-
:box => 'raring64',
|
34
|
-
:box_url => 'https://dl.dropboxusercontent.com/u/22904185/boxes/raring64.box',
|
35
|
-
:file => File.dirname(__FILE__)
|
36
|
-
},
|
37
|
-
:bind => {
|
38
|
-
:domain => "default.zone"
|
39
|
-
}
|
40
|
-
})
|
41
|
-
|
42
|
-
# Here we define our network segments; these will manifest into network
|
43
|
-
# bridges on the target LXC node.
|
44
|
-
network 'labnet' do
|
45
|
-
# provisioners [TestLab::Provisioner::Route]
|
46
|
-
address '10.128.0.1/16'
|
47
|
-
bridge :br0
|
48
|
-
end
|
49
|
-
|
50
|
-
# test-server.default.zone
|
51
|
-
###########################
|
52
|
-
container "test-server" do
|
53
|
-
distro "ubuntu"
|
54
|
-
release "precise"
|
55
|
-
|
56
|
-
provisioners [
|
57
|
-
TestLab::Provisioner::Resolv,
|
58
|
-
TestLab::Provisioner::AptCacherNG,
|
59
|
-
TestLab::Provisioner::Apt
|
60
|
-
]
|
61
|
-
|
62
|
-
# Here we define a default user to seed onto the box. This user will be
|
63
|
-
# given passwordless sudo access as well.
|
64
|
-
user 'deployer' do
|
65
|
-
password 'deployer'
|
66
|
-
identity File.join(ENV['HOME'], '.ssh', 'id_rsa')
|
67
|
-
public_identity File.join(ENV['HOME'], '.ssh', 'id_rsa.pub')
|
68
|
-
uid 2600
|
69
|
-
gid 2600
|
70
|
-
end
|
71
|
-
|
72
|
-
# Interfaces define what networks this container is linked to and what our
|
73
|
-
# configuration on that network should be. In the event we have more than
|
74
|
-
# one interface we should define one as the "primary". When multiple
|
75
|
-
# interfaces are at play, the default route for the container will be off
|
76
|
-
# the primary interface.
|
77
|
-
interface do
|
78
|
-
network_id 'labnet'
|
79
|
-
name :eth0
|
80
|
-
address '10.128.0.254/16'
|
81
|
-
mac '00:00:5e:63:b5:9f'
|
82
|
-
end
|
83
|
-
end
|
84
|
-
|
85
|
-
end
|