testlab 0.8.6 → 0.9.0

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/Gemfile CHANGED
@@ -1,6 +1,10 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gem "json" if (RUBY_VERSION == "1.8.7")
4
- gem "activesupport", "< 4.0.0" if (RUBY_VERSION < "1.9.3")
4
+
5
+ if (RUBY_VERSION < "1.9.3")
6
+ gem "activesupport", "< 4.0.0"
7
+ gem "redcarpet", "< 3.0.0"
8
+ end
5
9
 
6
10
  gemspec
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
@@ -61,7 +61,6 @@ class TestLab
61
61
  self.to_static
62
62
 
63
63
  self.lxc.start(%(--daemon))
64
- self.lxc.wait(:running)
65
64
 
66
65
  (self.lxc.state != :running) and raise ContainerError, "The container failed to online!"
67
66
 
@@ -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 = File.join("", "tmp", remote_filename)
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
- find #{self.lxc.container_root} -print0 -depth | cpio -o0 | pbzip2 -#{compression} -vfczm#{PBZIP2_MEMORY} > #{remote_file}
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 = File.join("", "tmp", remote_filename)
62
- local_file = File.expand_path(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
@@ -1,6 +1,6 @@
1
1
  class TestLab
2
2
  unless const_defined?(:VERSION)
3
3
  # TestLab Gem Version
4
- VERSION = "0.8.6"
4
+ VERSION = "0.9.0"
5
5
  end
6
6
  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: 0.8.6
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-04 00:00:00.000000000 Z
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: -1442946295549762745
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: -1442946295549762745
343
+ hash: 2591373511513958371
342
344
  requirements: []
343
345
  rubyforge_project:
344
346
  rubygems_version: 1.8.25