File tree Expand file tree Collapse file tree 1 file changed +14
-15
lines changed Expand file tree Collapse file tree 1 file changed +14
-15
lines changed Original file line number Diff line number Diff line change 4646 class { 'docker': #{ docker_args } ,
4747 docker_users => ['user1']
4848 }
49- "
49+ "
5050 end
5151
5252 it 'the docker daemon' do
@@ -56,26 +56,25 @@ class { 'docker': #{docker_args},
5656 end
5757 end
5858
59- context 'Checking root_dir value' do
60- docker_args = docker_args + 'root_dir =>' + '"' + root_dir + '"'
59+ context 'When root_dir is set' do
6160 let ( :pp ) do
62- "class { 'docker': #{ docker_args } }"
61+ "class { 'docker': #{ docker_args } , root_dir => \" #{ root_dir } \" }"
6362 end
6463
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
64+ let ( :shell_command ) do
65+ if os [ :family ] == 'windows'
66+ 'cat C:/ProgramData/docker/config/daemon.json'
67+ else
68+ 'systemctl status docker'
69+ end
70+ end
7171
72+ it 'works' do
7273 apply_manifest ( pp , catch_failures : true )
73- if os [ :family ] == 'windows'
74- run_shell ( "cat #{ file_path } " ) do | r |
74+ run_shell ( shell_command ) do | r |
75+ if os [ :family ] == 'windows'
7576 expect ( r . stdout ) . to match ( %r{\" data-root\" : \" #{ root_dir } \" } )
76- end
77- else
78- run_shell ( 'systemctl status docker' ) do |r |
77+ else
7978 expect ( r . stdout ) . to match ( %r{--data-root #{ root_dir } } )
8079 end
8180 end
You can’t perform that action at this time.
0 commit comments