linux_container 1.2 → 1.3
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.
- checksums.yaml +8 -8
- data/CHANGELOG +1 -0
- data/lib/linux_container.rb +3 -1
- data/linux_container.gemspec +1 -1
- data/test/test_all.rb +14 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZTJjMTU1MTEyNDM2MDNiMDU1Njg0YmZiYTE1NjI5NjQ0ODI2OGY2NA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
M2VmMTFlZWE3OTYwNGM5OGRhZTQ3NjgxMzM0ZmE4YTA5OWEyNTU0NA==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NGVhZGNkMTc4MWU5YTk1ZmY4NWFmMzJmNGU4NGU4YTVkYjI3NmI3YjYyYTA5
|
10
|
+
NzU2ZWFiZTY0MGFjMDM1ZTYwN2QyNzBhMzM5ZDc4Y2YxNWI5NGI5MzgzNzUw
|
11
|
+
MWFiOGI2NGNhMjM0NTdkODA3MmM4MjA5ZTViNjc5OTViOGQ0OWE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
N2M1YjQ0MTliMDk5NzJkM2FiYmUyZDVmNWVhNDQ1ODdjOWU0Njg2NDNmNjQz
|
14
|
+
NmU0YTllYTYzMmRhMjc3NTA4N2ZkYzA5NzY1NDJkODNmZWEyNDM2YzUyNzE4
|
15
|
+
Mjk1YTI0MGE0ZmZiYTQxN2FlMWY0YWQwYmYyMmM0MGI2NWVmMTE=
|
data/CHANGELOG
CHANGED
data/lib/linux_container.rb
CHANGED
@@ -46,11 +46,13 @@ class LinuxContainer
|
|
46
46
|
end
|
47
47
|
|
48
48
|
def start_ephemeral(config={})
|
49
|
-
argshash = {'orig' => name, 'user' => username
|
49
|
+
argshash = {'orig' => name, 'user' => username}.merge!(config)
|
50
50
|
args = []
|
51
51
|
if self.class.version == '0.8' # ubuntu quantal and older
|
52
|
+
argshash['union-type'] ||= 'aufs'
|
52
53
|
args.push '-U', argshash.delete('union-type')
|
53
54
|
else # ubuntu raring and newer
|
55
|
+
argshash['union-type'] ||= 'overlayfs'
|
54
56
|
args << '-d'
|
55
57
|
end
|
56
58
|
args.push *argshash.map {|k, v| "--#{k}=#{v}" }
|
data/linux_container.gemspec
CHANGED
data/test/test_all.rb
CHANGED
@@ -3,10 +3,10 @@ at_exit do
|
|
3
3
|
File.unlink($sshkey) rescue nil
|
4
4
|
($ec.destroy '-f' if $ec) rescue nil
|
5
5
|
($c2.destroy '-f' if $c2) rescue nil
|
6
|
-
$c.destroy '-f'
|
6
|
+
$c.destroy '-f' if $c
|
7
7
|
end
|
8
8
|
|
9
|
-
require 'minitest/
|
9
|
+
require 'minitest/unit'
|
10
10
|
require "#{File.dirname(__FILE__)}/../lib/linux_container"
|
11
11
|
|
12
12
|
class TestLinuxContainer < MiniTest::Unit::TestCase
|
@@ -56,6 +56,18 @@ class TestLinuxContainer < MiniTest::Unit::TestCase
|
|
56
56
|
assert($ec.wait_for { !running? }, 'wait_for !running?')
|
57
57
|
assert($ec.wait_for { !File.exists?($ec.dir) }, 'wait_for directory deletion')
|
58
58
|
end
|
59
|
+
|
60
|
+
def test_ephemeral_overlayfs
|
61
|
+
assert($ec = $c.start_ephemeral('union-type' => 'overlayfs'))
|
62
|
+
assert($ec.wait_for { running? }, 'wait_for running?')
|
63
|
+
assert_match /type overlayfs/, `mount`.lines.grep(/#{$ec.name}/).first
|
64
|
+
$ec.stop
|
65
|
+
assert($ec.wait_for { !running? }, 'wait_for !running?')
|
66
|
+
end
|
67
|
+
|
68
|
+
|
69
|
+
|
59
70
|
end
|
60
71
|
|
61
72
|
TestLinuxContainer.startup
|
73
|
+
MiniTest::Unit.new.run ARGV
|