testlab 0.7.5 → 0.7.6
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 +4 -4
- data/lib/testlab/container/io.rb +4 -2
- data/lib/testlab/providers/local.rb +4 -4
- data/lib/testlab/providers/vagrant.rb +6 -4
- data/lib/testlab/version.rb +1 -1
- data/spec/support/install-lxc.sh +28 -0
- metadata +5 -3
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -26,12 +26,12 @@ The TestLab command-line program `tl` follows in the style of git:
|
|
26
26
|
tl [global options] command [command options] [arguments...]
|
27
27
|
|
28
28
|
VERSION
|
29
|
-
0.7.
|
29
|
+
0.7.5
|
30
30
|
|
31
31
|
GLOBAL OPTIONS
|
32
|
-
-l, --labfile=path/to/file - Path to Labfile: ${
|
33
|
-
-r, --repo=path/to/directory - Path to Repository directory: ${PWD} (default: /home/zpatten/code/personal/testlab-repo)
|
34
|
-
-c, --config=path/to/directory - Path to Configuration directory: ${
|
32
|
+
-l, --labfile=path/to/file - Path to Labfile: ${REPO}/Labfile (default: none)
|
33
|
+
-r, --repo=path/to/directory - Path to Repository directory: ${PWD} (default: /home/zpatten/code/personal/testlab-repo/vendor/checkouts/testlab)
|
34
|
+
-c, --config=path/to/directory - Path to Configuration directory: ${REPO}/.testlab-$(hostname -s) (default: none)
|
35
35
|
--version - Display the program version
|
36
36
|
-v, --[no-]verbose - Show verbose output
|
37
37
|
-q, --[no-]quiet - Quiet mode
|
data/lib/testlab/container/io.rb
CHANGED
@@ -14,8 +14,9 @@ class TestLab
|
|
14
14
|
|
15
15
|
self.down
|
16
16
|
|
17
|
-
sc_file
|
17
|
+
sc_file = %(/tmp/#{self.id}.sc)
|
18
18
|
local_file ||= File.join(Dir.pwd, File.basename(sc_file))
|
19
|
+
local_file = File.expand_path(local_file)
|
19
20
|
|
20
21
|
please_wait(:ui => @ui, :message => format_object_action(self, 'Compress', :cyan)) do
|
21
22
|
self.node.ssh.bootstrap(<<-EOF)
|
@@ -48,7 +49,8 @@ EOF
|
|
48
49
|
self.down
|
49
50
|
self.destroy
|
50
51
|
|
51
|
-
sc_file
|
52
|
+
sc_file = %(/tmp/#{self.id}.sc)
|
53
|
+
local_file = File.expand_path(local_file)
|
52
54
|
|
53
55
|
please_wait(:ui => @ui, :message => format_object_action(self, 'Import', :cyan)) do
|
54
56
|
self.node.ssh.exec(%(sudo rm -fv #{sc_file}), :silence => true, :ignore_exit_status => true)
|
@@ -30,12 +30,12 @@ class TestLab
|
|
30
30
|
|
31
31
|
# This is a NO-OP
|
32
32
|
def up
|
33
|
-
|
33
|
+
true
|
34
34
|
end
|
35
35
|
|
36
36
|
# This is a NO-OP
|
37
37
|
def down
|
38
|
-
|
38
|
+
true
|
39
39
|
end
|
40
40
|
|
41
41
|
# This is a NO-OP
|
@@ -43,7 +43,7 @@ class TestLab
|
|
43
43
|
self.down
|
44
44
|
self.up
|
45
45
|
|
46
|
-
|
46
|
+
true
|
47
47
|
end
|
48
48
|
|
49
49
|
# This is a NO-OP
|
@@ -67,7 +67,7 @@ class TestLab
|
|
67
67
|
end
|
68
68
|
|
69
69
|
def instance_id
|
70
|
-
|
70
|
+
TestLab.hostname
|
71
71
|
end
|
72
72
|
|
73
73
|
def user
|
@@ -46,6 +46,8 @@ class TestLab
|
|
46
46
|
# Create the Vagrant instance
|
47
47
|
def create
|
48
48
|
self.up
|
49
|
+
|
50
|
+
true
|
49
51
|
end
|
50
52
|
|
51
53
|
# Destroy Vagrant-controlled VM
|
@@ -55,7 +57,7 @@ class TestLab
|
|
55
57
|
self.down
|
56
58
|
self.vagrant_cli("destroy", "--force", self.instance_id)
|
57
59
|
|
58
|
-
|
60
|
+
true
|
59
61
|
end
|
60
62
|
|
61
63
|
################################################################################
|
@@ -65,7 +67,7 @@ class TestLab
|
|
65
67
|
self.vagrant_cli("up", self.instance_id)
|
66
68
|
ZTK::TCPSocketCheck.new(:host => self.ip, :port => self.port, :wait => 120, :ui => @ui).wait
|
67
69
|
|
68
|
-
|
70
|
+
true
|
69
71
|
end
|
70
72
|
|
71
73
|
# Halt Vagrant-controlled VM
|
@@ -74,7 +76,7 @@ class TestLab
|
|
74
76
|
|
75
77
|
self.vagrant_cli("halt", self.instance_id)
|
76
78
|
|
77
|
-
|
79
|
+
true
|
78
80
|
end
|
79
81
|
|
80
82
|
################################################################################
|
@@ -84,7 +86,7 @@ class TestLab
|
|
84
86
|
self.down
|
85
87
|
self.up
|
86
88
|
|
87
|
-
|
89
|
+
true
|
88
90
|
end
|
89
91
|
|
90
92
|
################################################################################
|
data/lib/testlab/version.rb
CHANGED
@@ -0,0 +1,28 @@
|
|
1
|
+
################################################################################
|
2
|
+
#
|
3
|
+
# Author: Zachary Patten <zachary AT jovelabs DOT com>
|
4
|
+
# Copyright: Copyright (c) Zachary Patten
|
5
|
+
# License: Apache License, Version 2.0
|
6
|
+
#
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
# you may not use this file except in compliance with the License.
|
9
|
+
# You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
+
# See the License for the specific language governing permissions and
|
17
|
+
# limitations under the License.
|
18
|
+
#
|
19
|
+
################################################################################
|
20
|
+
#!/bin/bash
|
21
|
+
apt-get -qq update
|
22
|
+
cat <<EOF | tee /usr/sbin/policy-rc.d
|
23
|
+
#!/bin/sh
|
24
|
+
exit 101
|
25
|
+
EOF
|
26
|
+
chmod 755 /usr/sbin/policy-rc.d
|
27
|
+
apt-get -qq install lxc
|
28
|
+
lxc-version
|
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.7.
|
4
|
+
version: 0.7.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -308,6 +308,7 @@ files:
|
|
308
308
|
- spec/provisioners/shell_spec.rb
|
309
309
|
- spec/spec_helper.rb
|
310
310
|
- spec/support/Labfile
|
311
|
+
- spec/support/install-lxc.sh
|
311
312
|
- spec/testlab_spec.rb
|
312
313
|
- spec/utility_spec.rb
|
313
314
|
- testlab.gemspec
|
@@ -326,7 +327,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
326
327
|
version: '0'
|
327
328
|
segments:
|
328
329
|
- 0
|
329
|
-
hash: -
|
330
|
+
hash: -3143129893742225023
|
330
331
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
331
332
|
none: false
|
332
333
|
requirements:
|
@@ -335,7 +336,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
335
336
|
version: '0'
|
336
337
|
segments:
|
337
338
|
- 0
|
338
|
-
hash: -
|
339
|
+
hash: -3143129893742225023
|
339
340
|
requirements: []
|
340
341
|
rubyforge_project:
|
341
342
|
rubygems_version: 1.8.25
|
@@ -358,6 +359,7 @@ test_files:
|
|
358
359
|
- spec/provisioners/shell_spec.rb
|
359
360
|
- spec/spec_helper.rb
|
360
361
|
- spec/support/Labfile
|
362
|
+
- spec/support/install-lxc.sh
|
361
363
|
- spec/testlab_spec.rb
|
362
364
|
- spec/utility_spec.rb
|
363
365
|
has_rdoc:
|