1
1
require 'spec_helper_acceptance'
2
2
3
- if fact ( 'osfamily ' ) == 'windows'
3
+ if fact ( 'operatingsystem ' ) == 'windows'
4
4
docker_args = 'docker_ee => true'
5
5
default_image = 'microsoft/nanoserver'
6
6
default_image_tag = '10.0.14393.2189'
7
7
second_image = 'hello-world'
8
8
default_digest = 'sha256:204c41542c0927ac0296802e44c56b886b47e99cf8220fb49d46951bd5fc1742'
9
9
default_dockerfile = 'C:/Users/Administrator/AppData/Local/Temp/Dockerfile'
10
10
dockerfile_test = 'C:/Windows/Dockerfile_test.txt'
11
- #The default args are set because:
12
- #restart => 'always' - there is no service created to manage containers
11
+ #The default args are set because:
12
+ #restart => 'always' - there is no service created to manage containers
13
13
#net => 'nat' - docker uses bridged by default when running a container. When installing docker on windows the default network is NAT.
14
14
default_docker_run_arg = "restart => 'always', net => 'nat',"
15
15
default_run_command = "ping 127.0.0.1 -t"
18
18
default_docker_exec_command = 'cmd /c "echo test > c:\windows\temp\test_file.txt"'
19
19
docker_mount_path = 'C:/Users/Administrator/AppData/Local/Temp'
20
20
storage_driver = "windowsfilter"
21
- elsif fact ( 'osfamily ' ) == 'RedHat'
21
+ elsif fact ( 'operatingsystem ' ) == 'RedHat'
22
22
docker_args = "repo_opt => '--enablerepo=localmirror-extras'"
23
23
default_image = 'alpine'
24
24
second_image = 'busybox'
47
47
default_docker_exec_lr_command = '/bin/sh -c "touch /root/test_file.txt; while true; do echo hello world; sleep 1; done"'
48
48
default_docker_exec_command = 'touch /root/test_file.txt'
49
49
docker_mount_path = "/root"
50
- storage_driver = "overlay2"
50
+ if fact ( 'operatingsystem' ) == 'Ubuntu'
51
+ storage_driver = "overlay2"
52
+ elsif fact ( 'operatingsystem' ) == 'Debian' && fact ( 'os.release.major' ) == '9'
53
+ storage_driver = "overlay2"
54
+ elsif fact ( 'operatingsystem' ) == 'Debian' && fact ( 'os.release.major' ) == '8'
55
+ storage_driver = "aufs"
56
+ end
51
57
end
52
58
53
59
describe 'the Puppet Docker module' do
@@ -87,7 +93,7 @@ class { 'docker': #{docker_args} }
87
93
end
88
94
89
95
it 'should be start a docker process' do
90
- if fact ( 'osfamily' ) == 'windows'
96
+ if fact ( 'osfamily' ) == 'windows'
91
97
shell ( 'powershell Get-Process -Name dockerd' ) do |r |
92
98
expect ( r . stdout ) . to match ( /ProcessName/ )
93
99
end
@@ -163,7 +169,7 @@ class {'docker':
163
169
storage_driver => "#{ storage_driver } ",
164
170
}
165
171
EOS
166
-
172
+
167
173
apply_manifest ( @pp , :catch_failures => true )
168
174
sleep 15
169
175
end
@@ -172,8 +178,8 @@ class {'docker':
172
178
shell ( "#{ docker_command } info -f \" {{ .Driver}}\" " ) do |r |
173
179
expect ( r . stdout ) . to match ( /#{ storage_driver } / )
174
180
end
175
- end
176
- end
181
+ end
182
+ end
177
183
178
184
context 'passing a TCP address to bind to' do
179
185
before ( :all ) do
@@ -223,7 +229,7 @@ class { 'docker':
223
229
end
224
230
225
231
it 'should show docker listening on the specified unix socket' do
226
- if fact ( 'osfamily' ) != 'windows'
232
+ if fact ( 'osfamily' ) != 'windows'
227
233
shell ( 'ps aux | grep docker' ) do |r |
228
234
expect ( r . stdout ) . to match ( /unix:\/ \/ \/ var\/ run\/ docker.sock/ )
229
235
end
@@ -799,7 +805,7 @@ class { 'docker': #{docker_args} }
799
805
apply_manifest ( pp , :catch_changes => true ) unless fact ( 'selinux' ) == 'true'
800
806
801
807
end
802
-
808
+
803
809
it 'should restart a unhealthy container' do
804
810
pp5 = <<-EOS
805
811
docker::run { 'container_3_7_3':
0 commit comments