testlab 0.4.10 → 0.4.11

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/README.md CHANGED
@@ -25,10 +25,9 @@ For more information see the TestLab Documentation, `testlab-repo`, command-line
25
25
 
26
26
  * Latest VirtualBox Package
27
27
  * Latest Vagrant Package (non-gem version)
28
- * Ubuntu 13.04 Recommended; 12.10 Minimum
28
+ * Ubuntu 13.04 Base Box Recommended
29
29
 
30
30
  * Ubuntu 13.04 Server 64-bit (Raring) Base Box - https://github.com/zpatten/raring64
31
- * Ubuntu 12.10 Server 64-bit (Quantal) Base Box - https://github.com/zpatten/quantal64
32
31
 
33
32
  # EXAMPLE USE
34
33
 
@@ -54,7 +54,8 @@ class TestLab
54
54
  @ui.logger.debug { "Container Destroy: #{self.id} " }
55
55
 
56
56
  please_wait(:ui => @ui, :message => format_object_action(self, 'Destroy', :red)) do
57
- self.lxc.destroy
57
+ self.lxc.destroy(%(-f))
58
+ self.lxc_clone.destroy(%(-f))
58
59
  end
59
60
 
60
61
  true
@@ -115,14 +116,13 @@ class TestLab
115
116
  def clone
116
117
  @ui.logger.debug { "Container Clone: #{self.id}" }
117
118
 
118
- self.down
119
-
120
119
  please_wait(:ui => @ui, :message => format_object_action(self, 'Clone', :yellow)) do
121
120
 
122
121
  # ensure our container is in "ephemeral" mode
123
122
  self.to_ephemeral
124
123
 
125
- self.lxc_clone.start_ephemeral(%(-o #{self.id}-master), %(-n #{self.id}), %(-d))
124
+ self.node.ssh.exec(%(sudo arp --verbose --delete #{self.ip}), :ignore_exit_status => true)
125
+ self.lxc_clone.start_ephemeral(%W(-o #{self.lxc_clone.name} -n #{self.lxc.name} -d))
126
126
  end
127
127
 
128
128
  true
@@ -60,10 +60,13 @@ class TestLab
60
60
  def to_static
61
61
  if self.lxc_clone.exists?
62
62
  self.lxc.stop
63
+ self.lxc.destroy(%(-f))
64
+
63
65
  self.lxc_clone.stop
64
- self.lxc_clone.clone(%(-o #{self.lxc_clone.name}), %(-n #{self.lxc.name}))
65
- build_lxc_config(self.lxc.config)
66
+ self.lxc_clone.clone(%W(-o #{self.lxc_clone.name} -n #{self.lxc.name}))
66
67
  self.lxc_clone.destroy(%(-f))
68
+
69
+ build_lxc_config(self.lxc.config)
67
70
  end
68
71
 
69
72
  true
@@ -71,16 +74,22 @@ class TestLab
71
74
 
72
75
  # Convert to Ephemeral Container
73
76
  #
74
- # If the current container is operating as a static ocntainer, this will
77
+ # If the current container is operating as a static container, this will
75
78
  # convert it to a ephemeral container, otherwise no changes will occur.
76
79
  #
77
80
  # @return [Boolean] Returns true if successful.
78
81
  def to_ephemeral
79
82
  if (self.lxc.exists? && !self.lxc_clone.exists?)
83
+ self.lxc_clone.stop
84
+ self.lxc_clone.destroy(%(-f))
85
+
80
86
  self.lxc.stop
81
- self.lxc.clone(%(-o #{self.lxc.name}), %(-n #{self.lxc_clone.name}))
82
- build_lxc_config(self.lxc_clone.config)
87
+ self.lxc.clone(%W(-o #{self.lxc.name} -n #{self.lxc_clone.name}))
83
88
  self.lxc.destroy(%(-f))
89
+
90
+ build_lxc_config(self.lxc_clone.config)
91
+ else
92
+ self.lxc.stop
84
93
  end
85
94
 
86
95
  true
@@ -1,6 +1,6 @@
1
1
  class TestLab
2
2
  unless const_defined?(:VERSION)
3
3
  # TestLab Gem Version
4
- VERSION = "0.4.10"
4
+ VERSION = "0.4.11"
5
5
  end
6
6
  end
@@ -156,6 +156,7 @@ describe TestLab::Container do
156
156
  describe "#destroy" do
157
157
  it "should destroy the container" do
158
158
  subject.lxc.stub(:destroy) { true }
159
+ subject.lxc_clone.stub(:destroy) { true }
159
160
  subject.destroy
160
161
  end
161
162
  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.4.10
4
+ version: 0.4.11
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -281,7 +281,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
281
281
  version: '0'
282
282
  segments:
283
283
  - 0
284
- hash: -561292551195131094
284
+ hash: -4607919379801357092
285
285
  required_rubygems_version: !ruby/object:Gem::Requirement
286
286
  none: false
287
287
  requirements:
@@ -290,7 +290,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
290
290
  version: '0'
291
291
  segments:
292
292
  - 0
293
- hash: -561292551195131094
293
+ hash: -4607919379801357092
294
294
  requirements: []
295
295
  rubyforge_project:
296
296
  rubygems_version: 1.8.25