testlab 0.4.14 → 0.4.15

Sign up to get free protection for your applications and to get access to all the features.
@@ -101,7 +101,10 @@ class TestLab
101
101
  attribute :release, :default => 'precise'
102
102
  attribute :arch
103
103
 
104
- attribute :persist
104
+ # Instructs ephemeral containers to persist; otherwise tmpfs will be used
105
+ # as the backend store for ephemeral containers.
106
+ # NOTE: tmpfs is very memory intensive and is disabled by default.
107
+ attribute :persist, :default => true
105
108
 
106
109
 
107
110
  def initialize(*args)
@@ -108,7 +108,7 @@ class TestLab
108
108
  true
109
109
  end
110
110
 
111
- # Clone the contaienr
111
+ # Clone the container
112
112
  #
113
113
  # Prepares the container, if needed, for ephemeral cloning and clones it.
114
114
  #
@@ -122,7 +122,13 @@ class TestLab
122
122
  self.to_ephemeral
123
123
 
124
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))
125
+
126
+ ephemeral_arguments = Array.new
127
+ ephemeral_arguments << %W(-o #{self.lxc_clone.name} -n #{self.lxc.name} -d)
128
+ ephemeral_arguments << %W(--keep-data) if self.persist
129
+ ephemeral_arguments = ephemeral_arguments.flatten.compact
130
+
131
+ self.lxc_clone.start_ephemeral(ephemeral_arguments)
126
132
  end
127
133
 
128
134
  true
@@ -90,6 +90,7 @@ class TestLab
90
90
  build_lxc_config(self.lxc_clone.config)
91
91
  else
92
92
  self.lxc.stop
93
+ self.lxc.destroy(%(-f)) if self.persist
93
94
  end
94
95
 
95
96
  true
@@ -1,6 +1,6 @@
1
1
  class TestLab
2
2
  unless const_defined?(:VERSION)
3
3
  # TestLab Gem Version
4
- VERSION = "0.4.14"
4
+ VERSION = "0.4.15"
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.4.14
4
+ version: 0.4.15
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-06-04 00:00:00.000000000 Z
12
+ date: 2013-06-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: gli
@@ -280,18 +280,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
280
280
  - - ! '>='
281
281
  - !ruby/object:Gem::Version
282
282
  version: '0'
283
- segments:
284
- - 0
285
- hash: 3957733017410581282
286
283
  required_rubygems_version: !ruby/object:Gem::Requirement
287
284
  none: false
288
285
  requirements:
289
286
  - - ! '>='
290
287
  - !ruby/object:Gem::Version
291
288
  version: '0'
292
- segments:
293
- - 0
294
- hash: 3957733017410581282
295
289
  requirements: []
296
290
  rubyforge_project:
297
291
  rubygems_version: 1.8.25