testlab 0.8.6 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +5 -1
- data/bin/tl-console +14 -0
- data/lib/testlab/container/actions.rb +0 -1
- data/lib/testlab/container/io.rb +10 -4
- data/lib/testlab/version.rb +1 -1
- metadata +6 -4
data/Gemfile
CHANGED
data/bin/tl-console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'rubygems'
|
3
|
+
require 'bundler/setup'
|
4
|
+
require 'pry'
|
5
|
+
require 'testlab'
|
6
|
+
|
7
|
+
ENV['LOG_LEVEL'] = 'DEBUG'
|
8
|
+
logger = ZTK::Logger.new(STDOUT)
|
9
|
+
|
10
|
+
ui = ZTK::UI.new(:logger => logger)
|
11
|
+
l = TestLab.new(:ui => ui, :repo_dir => Dir.pwd)
|
12
|
+
l.boot
|
13
|
+
|
14
|
+
binding.pry
|
data/lib/testlab/container/io.rb
CHANGED
@@ -19,9 +19,10 @@ class TestLab
|
|
19
19
|
remote_filename = File.basename(export_tempfile.path.dup)
|
20
20
|
export_tempfile.close!
|
21
21
|
|
22
|
-
remote_file
|
22
|
+
remote_file = File.join("", "tmp", remote_filename)
|
23
23
|
local_file ||= File.join(Dir.pwd, File.basename(remote_file))
|
24
24
|
local_file = File.expand_path(local_file)
|
25
|
+
root_fs_path = self.lxc.fs_root.split(File::SEPARATOR).last
|
25
26
|
|
26
27
|
please_wait(:ui => @ui, :message => format_object_action(self, 'Compress', :cyan)) do
|
27
28
|
self.node.ssh.bootstrap(<<-EOF)
|
@@ -29,7 +30,8 @@ set -x
|
|
29
30
|
set -e
|
30
31
|
|
31
32
|
du -sh #{self.lxc.container_root}
|
32
|
-
|
33
|
+
cd #{self.lxc.container_root}
|
34
|
+
find #{root_fs_path} -depth -print0 | cpio -o0 | pbzip2 -#{compression} -vfczm#{PBZIP2_MEMORY} > #{remote_file}
|
33
35
|
chown ${SUDO_USER}:${SUDO_USER} #{remote_file}
|
34
36
|
ls -lah #{remote_file}
|
35
37
|
EOF
|
@@ -53,13 +55,15 @@ EOF
|
|
53
55
|
|
54
56
|
self.down
|
55
57
|
self.destroy
|
58
|
+
self.create
|
56
59
|
|
57
60
|
import_tempfile = Tempfile.new('import')
|
58
61
|
remote_filename = File.basename(import_tempfile.path.dup)
|
59
62
|
import_tempfile.close!
|
60
63
|
|
61
|
-
remote_file
|
62
|
-
local_file
|
64
|
+
remote_file = File.join("", "tmp", remote_filename)
|
65
|
+
local_file = File.expand_path(local_file)
|
66
|
+
root_fs_path = self.lxc.fs_root.split(File::SEPARATOR).last
|
63
67
|
|
64
68
|
please_wait(:ui => @ui, :message => format_object_action(self, 'Import', :cyan)) do
|
65
69
|
self.node.ssh.exec(%(sudo rm -fv #{remote_file}), :silence => true, :ignore_exit_status => true)
|
@@ -72,6 +76,8 @@ set -x
|
|
72
76
|
set -e
|
73
77
|
|
74
78
|
ls -lah #{remote_file}
|
79
|
+
cd #{self.lxc.container_root}
|
80
|
+
rm -rf #{root_fs_path}
|
75
81
|
pbzip2 -vdcm#{PBZIP2_MEMORY} #{remote_file} | cpio -uid && rm -fv #{remote_file}
|
76
82
|
du -sh #{self.lxc.container_root}
|
77
83
|
EOF
|
data/lib/testlab/version.rb
CHANGED
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.9.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-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: gli
|
@@ -208,6 +208,7 @@ email:
|
|
208
208
|
- zachary AT jovelabs DOT com
|
209
209
|
executables:
|
210
210
|
- tl
|
211
|
+
- tl-console
|
211
212
|
extensions: []
|
212
213
|
extra_rdoc_files: []
|
213
214
|
files:
|
@@ -222,6 +223,7 @@ files:
|
|
222
223
|
- README.md
|
223
224
|
- Rakefile
|
224
225
|
- bin/tl
|
226
|
+
- bin/tl-console
|
225
227
|
- features/step_definitions/container_steps.rb
|
226
228
|
- features/step_definitions/network_steps.rb
|
227
229
|
- features/step_definitions/node_steps.rb
|
@@ -329,7 +331,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
329
331
|
version: '0'
|
330
332
|
segments:
|
331
333
|
- 0
|
332
|
-
hash:
|
334
|
+
hash: 2591373511513958371
|
333
335
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
334
336
|
none: false
|
335
337
|
requirements:
|
@@ -338,7 +340,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
338
340
|
version: '0'
|
339
341
|
segments:
|
340
342
|
- 0
|
341
|
-
hash:
|
343
|
+
hash: 2591373511513958371
|
342
344
|
requirements: []
|
343
345
|
rubyforge_project:
|
344
346
|
rubygems_version: 1.8.25
|