|
23 | 23 | 'label' => ['com.example.foo="bar"', 'bar=baz'],
|
24 | 24 | 'mounts' => ['type=bind,src=/tmp/a,dst=/tmp/a', 'type=bind,src=/tmp/b,dst=/tmp/b,readonly'],
|
25 | 25 | 'networks' => ['overlay'],
|
| 26 | + 'command' => 'echo hello world', |
26 | 27 | } }
|
27 | 28 | it { is_expected.to compile.with_all_deps }
|
28 | 29 | it { should contain_exec('test_service docker service create').with_command(/docker service create/) }
|
29 | 30 | it { should contain_exec('test_service docker service create').with_command(/--env MY_ENV=1/) }
|
30 | 31 | it { should contain_exec('test_service docker service create').with_command(/--label bar=baz/) }
|
31 | 32 | it { should contain_exec('test_service docker service create').with_command(/--mount type=bind,src=\/tmp\/b,dst=\/tmp\/b,readonly/) }
|
32 | 33 | it { should contain_exec('test_service docker service create').with_command(/--network overlay/) }
|
| 34 | + it { should contain_exec('test_service docker service create').with_command(/echo hello world/) } |
33 | 35 |
|
34 | 36 | context 'multiple services declaration' do
|
35 | 37 | let(:pre_condition) {
|
36 | 38 | "
|
37 | 39 | docker::services { 'test_service_2':
|
38 | 40 | service_name => 'foo_2',
|
39 | 41 | image => 'foo:bar',
|
| 42 | + command => ['echo', 'hello', 'world'], |
40 | 43 | }
|
41 | 44 | "
|
42 | 45 | }
|
43 | 46 | it { should contain_exec('test_service docker service create').with_command(/docker service create/) }
|
44 | 47 | it { should contain_exec('test_service_2 docker service create').with_command(/docker service create/) }
|
| 48 | + it { should contain_exec('test_service_2 docker service create').with_command(/echo hello world/) } |
45 | 49 | end
|
46 | 50 |
|
47 | 51 | context 'multiple publish ports and multiple networks' do
|
|
60 | 64 | it { should contain_exec('test_service_3 docker service create').with_command(/--network foo_1/) }
|
61 | 65 | it { should contain_exec('test_service_3 docker service create').with_command(/--network foo_2/) }
|
62 | 66 | end
|
| 67 | + |
63 | 68 | end
|
64 | 69 |
|
65 | 70 | context 'with ensure => present and service update' do
|
|
0 commit comments