|
9 | 9 | raise 'Could not retrieve ip address for Windows box' if result.exit_code != 0
|
10 | 10 | ip = result.stdout.split("\n")[0].split(':')[1].strip
|
11 | 11 | @windows_ip = ip
|
12 |
| - docker_arg = "docker_ee => true, extra_parameters => '\"insecure-registries\": [ \"#{@windows_ip}:5000\" ]'" |
| 12 | + docker_args = "docker_ee => true, extra_parameters => '\"insecure-registries\": [ \"#{@windows_ip}:5000\" ]', root_dir => 'C:/Users/Administrator/AppData/Local/Temp' |
| 13 | +" |
13 | 14 | docker_registry_image = 'stefanscherer/registry-windows'
|
14 | 15 | docker_network = 'nat'
|
15 | 16 | registry_host = @windows_ip
|
16 | 17 | config_file = '/cygdrive/c/Users/Administrator/.docker/config.json'
|
17 |
| - root_dir = 'C:/Users/Administrator/AppData/Local/Temp' |
18 | 18 | server_strip = "#{registry_host}_#{registry_port}"
|
19 | 19 | bad_server_strip = "#{registry_host}_5001"
|
20 | 20 | broken = true
|
|
35 | 35 | root_dir = '/root'
|
36 | 36 | end
|
37 | 37 |
|
| 38 | + |
38 | 39 | describe 'docker' do
|
39 | 40 | package_name = 'docker-ce'
|
40 | 41 | service_name = 'docker'
|
|
43 | 44 | context 'When adding system user', win_broken: broken do
|
44 | 45 | let(:pp) do
|
45 | 46 | "
|
46 |
| - class { 'docker': #{docker_arg} |
| 47 | + class { 'docker': #{docker_args} |
47 | 48 | docker_users => ['user1']
|
48 | 49 | }
|
49 | 50 | "
|
50 | 51 | end
|
51 | 52 |
|
| 53 | + context 'Checking root_dir value' do |
| 54 | + let(:pp) do |
| 55 | + "class { 'docker': #{docker_args}}" |
| 56 | + end |
| 57 | + |
| 58 | + it 'is good' do |
| 59 | + apply_manifest(pp, catch_failures: true) |
| 60 | + run_shell('cat C:/ProgramData/docker/config/daemon.json') do |r| |
| 61 | + expect(r.stdout).to match(%r{data-root}) |
| 62 | + end |
| 63 | + end |
| 64 | + end |
| 65 | + |
52 | 66 | it 'the docker daemon' do
|
53 | 67 | apply_manifest(pp, catch_failures: true) do |r|
|
54 | 68 | expect(r.stdout).not_to match(%r{docker-systemd-reload-before-service})
|
@@ -177,7 +191,7 @@ class { 'docker':
|
177 | 191 |
|
178 | 192 | it 'is able to run registry' do
|
179 | 193 | pp = <<-MANIFEST
|
180 |
| - class { 'docker': #{docker_arg}} |
| 194 | + class { 'docker': #{docker_args}} |
181 | 195 | docker::run { 'registry':
|
182 | 196 | image => '#{docker_registry_image}',
|
183 | 197 | pull_on_start => true,
|
|
0 commit comments