|
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_args = "docker_ee => true, extra_parameters => '\"insecure-registries\": [ \"#{@windows_ip}:5000\" ]', root_dir => 'C:/Users/Administrator/AppData/Local/Temp' |
13 |
| -" |
| 12 | + docker_args = "docker_ee => true, extra_parameters => '\"insecure-registries\": [ \"#{@windows_ip}:5000\" ]'" |
| 13 | + root_dir = 'C:/Users/Administrator/AppData/Local/Temp' |
14 | 14 | docker_registry_image = 'stefanscherer/registry-windows'
|
15 | 15 | docker_network = 'nat'
|
16 | 16 | registry_host = @windows_ip
|
|
43 | 43 | context 'When adding system user', win_broken: broken do
|
44 | 44 | let(:pp) do
|
45 | 45 | "
|
46 |
| - class { 'docker': #{docker_args} |
| 46 | + class { 'docker': #{docker_args}, |
47 | 47 | docker_users => ['user1']
|
48 | 48 | }
|
49 | 49 | "
|
50 | 50 | end
|
51 | 51 |
|
52 |
| - context 'Checking root_dir value' do |
53 |
| - let(:pp) do |
54 |
| - "class { 'docker': #{docker_args}}" |
| 52 | + it 'the docker daemon' do |
| 53 | + apply_manifest(pp, catch_failures: true) do |r| |
| 54 | + expect(r.stdout).not_to match(%r{docker-systemd-reload-before-service}) |
55 | 55 | end
|
| 56 | + end |
| 57 | + end |
56 | 58 |
|
57 |
| - it 'is good' do |
58 |
| - apply_manifest(pp, catch_failures: true) |
59 |
| - run_shell('cat C:/ProgramData/docker/config/daemon.json') do |r| |
60 |
| - expect(r.stdout).to match(%r{data-root}) |
61 |
| - end |
62 |
| - end |
| 59 | + context 'Checking root_dir value' do |
| 60 | + docker_args = docker_args + ',root_dir =>' + '"' + root_dir + '"' |
| 61 | + let(:pp) do |
| 62 | + "class { 'docker': #{docker_args}}" |
63 | 63 | end
|
64 | 64 |
|
65 |
| - it 'the docker daemon' do |
66 |
| - apply_manifest(pp, catch_failures: true) do |r| |
67 |
| - expect(r.stdout).not_to match(%r{docker-systemd-reload-before-service}) |
| 65 | + it 'is good' do |
| 66 | + file_path = if os[:family] == 'windows' |
| 67 | + 'C:/ProgramData/docker/config/daemon.json' |
| 68 | + else |
| 69 | + '/etc/docker/daemon.json' |
| 70 | + end |
| 71 | + |
| 72 | + apply_manifest(pp, catch_failures: true) |
| 73 | + if os[:family] == 'windows' |
| 74 | + run_shell("cat #{file_path}") do |r| |
| 75 | + expect(r.stdout).to match(%r{\"data-root\": \"#{root_dir}\"}) |
| 76 | + end |
| 77 | + else |
| 78 | + run_shell('systemctl status docker') do |r| |
| 79 | + expect(r.stdout).to match(%r{--data-root #{root_dir}}) |
| 80 | + end |
68 | 81 | end
|
69 | 82 | end
|
70 | 83 | end
|
|
0 commit comments