beaker-docker 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/lib/beaker-docker/version.rb +1 -1
- data/lib/beaker/hypervisor/docker.rb +14 -3
- data/spec/beaker/hypervisor/docker_spec.rb +38 -6
- metadata +29 -29
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
MGNhYTQzMmMyODMyNGJjNzNiOTdhMzhmZmMyNGQyMjE3MGM0ZjdiMA==
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 11eea4355dd2129a958eced653b4ca23782a8f01
|
4
|
+
data.tar.gz: b15e68f0be5b05a836b3f79b834249dce514eb1a
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
ZDE4YmJkYmE2NDZkOGFlMDY3OTEwZjJiMTQxY2EzYmFmMjMxNWU0ZjZhMzIz
|
11
|
-
ZTIzNzhiYzgwOGE5YmVhYTZjY2VlNGZhNjZkYzNmMDk2ODQ0Y2Y=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
NGI0YWViODYwYWRmN2I3ZmUzYTU4MDE2NWJjODc1YTJhZTYxMjMwODNkODA2
|
14
|
-
NWViYzUyMThlOTdjMDJjMDkxODVhYmM5NjVhMWY4MGQwYzU5ZjE0N2ZlYTA5
|
15
|
-
YWY2NGMwNDIyNDhjZDIxOWI4ZDk3ZWZlNmY3NjNiZDUwYWQ2YjQ=
|
6
|
+
metadata.gz: 5915547ac7bdc813b70284be6f28297d71dc78eb0d76d3178578b1a30181a79c61b8a808929dab24e127fed92c8a4e530d5fd8d35d4964d485d5faeeca54d58e
|
7
|
+
data.tar.gz: 4eae6ae9722d25c943debfc99586af1b1d2dffe59da9b6949474b1212f25990085c7f2c1a6a4dd7e424944e49c5583270dbaa60da1477ede84dfef28cac12109
|
@@ -70,7 +70,6 @@ module Beaker
|
|
70
70
|
container_opts = {
|
71
71
|
'Image' => image_name,
|
72
72
|
'Hostname' => host.name,
|
73
|
-
'name' => host.name,
|
74
73
|
'HostConfig' => {
|
75
74
|
'PortBindings' => {
|
76
75
|
'22/tcp' => [{ 'HostPort' => rand.to_s[2..5], 'HostIp' => '0.0.0.0'}]
|
@@ -95,6 +94,10 @@ module Beaker
|
|
95
94
|
end
|
96
95
|
end
|
97
96
|
|
97
|
+
if host['docker_cap_add']
|
98
|
+
container_opts['HostConfig']['CapAdd'] = host['docker_cap_add']
|
99
|
+
end
|
100
|
+
|
98
101
|
if @options[:provision]
|
99
102
|
if host['docker_container_name']
|
100
103
|
container_opts['name'] = host['docker_container_name']
|
@@ -225,8 +228,8 @@ module Beaker
|
|
225
228
|
dockerfile = File.read(host['dockerfile'])
|
226
229
|
else
|
227
230
|
raise "requested Dockerfile #{host['dockerfile']} does not exist"
|
228
|
-
end
|
229
|
-
else
|
231
|
+
end
|
232
|
+
else
|
230
233
|
raise("Docker image undefined!") if (host['image']||= nil).to_s.empty?
|
231
234
|
|
232
235
|
# specify base image
|
@@ -274,6 +277,14 @@ module Beaker
|
|
274
277
|
RUN ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key
|
275
278
|
RUN sed -ri 's/^#?UsePAM .*/UsePAM no/' /etc/ssh/sshd_config
|
276
279
|
EOF
|
280
|
+
when /archlinux/
|
281
|
+
dockerfile += <<-EOF
|
282
|
+
RUN pacman -Sy
|
283
|
+
RUN pacman -S --noconfirm openssh #{Beaker::HostPrebuiltSteps::ARCHLINUX_PACKAGES.join(' ')}
|
284
|
+
RUN ssh-keygen -A
|
285
|
+
RUN sed -ri 's/^#?UsePAM .*/UsePAM no/' /etc/ssh/sshd_config
|
286
|
+
RUN systemctl enable sshd
|
287
|
+
EOF
|
277
288
|
else
|
278
289
|
# TODO add more platform steps here
|
279
290
|
raise "platform #{host['platform']} not yet supported on docker"
|
@@ -15,7 +15,8 @@ module Beaker
|
|
15
15
|
"cumulus-2.2-x86_64",
|
16
16
|
"fedora-22-x86_64",
|
17
17
|
"centos-7-x86_64",
|
18
|
-
"sles-12-x86_64"
|
18
|
+
"sles-12-x86_64",
|
19
|
+
"archlinux-2017.12.27-x86_64"
|
19
20
|
]
|
20
21
|
|
21
22
|
describe Docker do
|
@@ -181,7 +182,6 @@ module Beaker
|
|
181
182
|
expect( ::Docker::Container ).to receive(:create).with({
|
182
183
|
'Image' => image.id,
|
183
184
|
'Hostname' => host.name,
|
184
|
-
'name' => host.name,
|
185
185
|
'HostConfig' => {
|
186
186
|
'PortBindings' => {
|
187
187
|
'22/tcp' => [{ 'HostPort' => /\b\d{4}\b/, 'HostIp' => '0.0.0.0'}]
|
@@ -192,7 +192,7 @@ module Beaker
|
|
192
192
|
'Name' => 'always'
|
193
193
|
}
|
194
194
|
}
|
195
|
-
})
|
195
|
+
}).with(hash_excluding('name'))
|
196
196
|
end
|
197
197
|
|
198
198
|
docker.provision
|
@@ -211,7 +211,6 @@ module Beaker
|
|
211
211
|
expect( ::Docker::Container ).to receive(:create).with({
|
212
212
|
'Image' => image.id,
|
213
213
|
'Hostname' => host.name,
|
214
|
-
'name' => host.name,
|
215
214
|
'HostConfig' => {
|
216
215
|
'PortBindings' => {
|
217
216
|
'22/tcp' => [{ 'HostPort' => /\b\d{4}\b/, 'HostIp' => '0.0.0.0'}]
|
@@ -222,7 +221,7 @@ module Beaker
|
|
222
221
|
'Name' => 'always'
|
223
222
|
}
|
224
223
|
}
|
225
|
-
})
|
224
|
+
}).with(hash_excluding('name'))
|
226
225
|
end
|
227
226
|
|
228
227
|
docker.provision
|
@@ -284,7 +283,6 @@ module Beaker
|
|
284
283
|
expect( ::Docker::Container ).to receive(:create).with({
|
285
284
|
'Image' => image.id,
|
286
285
|
'Hostname' => host.name,
|
287
|
-
'name' => host.name,
|
288
286
|
'HostConfig' => {
|
289
287
|
'Binds' => [
|
290
288
|
'/source_folder:/mount_point',
|
@@ -308,6 +306,30 @@ module Beaker
|
|
308
306
|
docker.provision
|
309
307
|
end
|
310
308
|
|
309
|
+
it 'should create a container with capabilities added' do
|
310
|
+
hosts.each_with_index do |host, index|
|
311
|
+
host['docker_cap_add'] = ['NET_ADMIN', 'SYS_ADMIN']
|
312
|
+
|
313
|
+
expect( ::Docker::Container ).to receive(:create).with({
|
314
|
+
'Image' => image.id,
|
315
|
+
'Hostname' => host.name,
|
316
|
+
'HostConfig' => {
|
317
|
+
'PortBindings' => {
|
318
|
+
'22/tcp' => [{ 'HostPort' => /\b\d{4}\b/, 'HostIp' => '0.0.0.0'}]
|
319
|
+
},
|
320
|
+
'PublishAllPorts' => true,
|
321
|
+
'Privileged' => true,
|
322
|
+
'RestartPolicy' => {
|
323
|
+
'Name' => 'always'
|
324
|
+
},
|
325
|
+
'CapAdd' => ['NET_ADMIN', 'SYS_ADMIN']
|
326
|
+
}
|
327
|
+
})
|
328
|
+
end
|
329
|
+
|
330
|
+
docker.provision
|
331
|
+
end
|
332
|
+
|
311
333
|
it 'should start the container' do
|
312
334
|
expect( container ).to receive(:start)
|
313
335
|
|
@@ -529,6 +551,16 @@ module Beaker
|
|
529
551
|
end
|
530
552
|
end
|
531
553
|
|
554
|
+
it 'should use pacman on archlinux' do
|
555
|
+
FakeFS.deactivate!
|
556
|
+
dockerfile = docker.send(:dockerfile_for, {
|
557
|
+
'platform' => 'archlinux-current-x86_64',
|
558
|
+
'image' => 'foobar',
|
559
|
+
})
|
560
|
+
|
561
|
+
expect( dockerfile ).to be =~ /RUN pacman -S --noconfirm openssh/
|
562
|
+
end
|
563
|
+
|
532
564
|
it 'should use user dockerfile if specified' do
|
533
565
|
FakeFS.deactivate!
|
534
566
|
dockerfile = docker.send(:dockerfile_for, {
|
metadata
CHANGED
@@ -1,167 +1,167 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: beaker-docker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rishi Javia, Kevin Imber, Tony Vu
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '3.0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '3.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rspec-its
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: fakefs
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - ~>
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0.6'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - ~>
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0.6'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - ~>
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '10.1'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - ~>
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '10.1'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: simplecov
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: pry
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - ~>
|
87
|
+
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '0.10'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - ~>
|
94
|
+
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0.10'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: yard
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- -
|
101
|
+
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: '0'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- -
|
108
|
+
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: markdown
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- -
|
115
|
+
- - ">="
|
116
116
|
- !ruby/object:Gem::Version
|
117
117
|
version: '0'
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
|
-
- -
|
122
|
+
- - ">="
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: thin
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
|
-
- -
|
129
|
+
- - ">="
|
130
130
|
- !ruby/object:Gem::Version
|
131
131
|
version: '0'
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
|
-
- -
|
136
|
+
- - ">="
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: stringify-hash
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
|
-
- - ~>
|
143
|
+
- - "~>"
|
144
144
|
- !ruby/object:Gem::Version
|
145
145
|
version: 0.0.0
|
146
146
|
type: :runtime
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
|
-
- - ~>
|
150
|
+
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: 0.0.0
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: docker-api
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
|
-
- -
|
157
|
+
- - ">="
|
158
158
|
- !ruby/object:Gem::Version
|
159
159
|
version: '0'
|
160
160
|
type: :runtime
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
|
-
- -
|
164
|
+
- - ">="
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: '0'
|
167
167
|
description: For use for the Beaker acceptance testing tool
|
@@ -172,8 +172,8 @@ executables:
|
|
172
172
|
extensions: []
|
173
173
|
extra_rdoc_files: []
|
174
174
|
files:
|
175
|
-
- .gitignore
|
176
|
-
- .simplecov
|
175
|
+
- ".gitignore"
|
176
|
+
- ".simplecov"
|
177
177
|
- Gemfile
|
178
178
|
- LICENSE
|
179
179
|
- README.md
|
@@ -196,17 +196,17 @@ require_paths:
|
|
196
196
|
- lib
|
197
197
|
required_ruby_version: !ruby/object:Gem::Requirement
|
198
198
|
requirements:
|
199
|
-
- -
|
199
|
+
- - ">="
|
200
200
|
- !ruby/object:Gem::Version
|
201
201
|
version: '0'
|
202
202
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
203
203
|
requirements:
|
204
|
-
- -
|
204
|
+
- - ">="
|
205
205
|
- !ruby/object:Gem::Version
|
206
206
|
version: '0'
|
207
207
|
requirements: []
|
208
208
|
rubyforge_project:
|
209
|
-
rubygems_version: 2.
|
209
|
+
rubygems_version: 2.5.1
|
210
210
|
signing_key:
|
211
211
|
specification_version: 4
|
212
212
|
summary: Beaker DSL Extension Helpers!
|