@@ -19,10 +19,24 @@ def allow_standard_non_returning_calls
19
19
}
20
20
end
21
21
22
+ let ( :cfg ) do
23
+ {
24
+ 'params' => {
25
+ 'primary_host' => 'primary'
26
+ } ,
27
+ 'role-letter' => {
28
+ 'server' => {
29
+ 'A' => 'server_a' ,
30
+ 'B' => 'server_b'
31
+ }
32
+ }
33
+ }
34
+ end
22
35
let ( :certdata ) { { 'certname' => 'primary' , 'extensions' => { '1.3.6.1.4.1.34380.1.1.9813' => 'A' } } }
23
36
24
37
it 'runs successfully when no alt-names are specified' do
25
38
allow_standard_non_returning_calls
39
+ expect_task ( 'peadm::get_peadm_config' ) . always_return ( cfg )
26
40
expect_plan ( 'peadm::modify_certificate' ) . always_return ( 'mock' => 'mock' )
27
41
expect_task ( 'peadm::agent_install' )
28
42
. with_params ( { 'server' => 'primary' ,
@@ -33,8 +47,9 @@ def allow_standard_non_returning_calls
33
47
34
48
# {"install_flags"=>
35
49
# ["--puppet-service-ensure", "stopped",
36
- # "extension_requests :1.3.6.1.4.1.34380.1.3.13=pe_compiler", "extension_requests:1.3.6.1.4.1.34380.1.1.9813=A", "main:certname=compiler"], "server"=>"primary"}
50
+ # "extenion_requests :1.3.6.1.4.1.34380.1.3.13=pe_compiler", "extension_requests:1.3.6.1.4.1.34380.1.1.9813=A", "main:certname=compiler"], "server"=>"primary"}
37
51
52
+ expect_plan ( 'peadm::util::sync_global_hiera' )
38
53
expect ( run_plan ( 'peadm::add_compiler' , params ) ) . to be_ok
39
54
end
40
55
@@ -45,6 +60,7 @@ def allow_standard_non_returning_calls
45
60
46
61
it 'runs successfully when alt-names are specified' do
47
62
allow_standard_non_returning_calls
63
+ expect_task ( 'peadm::get_peadm_config' ) . always_return ( cfg )
48
64
expect_plan ( 'peadm::modify_certificate' ) . always_return ( 'mock' => 'mock' )
49
65
expect_task ( 'peadm::agent_install' )
50
66
. with_params ( { 'server' => 'primary' ,
@@ -53,7 +69,7 @@ def allow_standard_non_returning_calls
53
69
'--puppet-service-ensure' , 'stopped' ,
54
70
'main:certname=compiler'
55
71
] } )
56
-
72
+ expect_plan ( 'peadm::util::sync_global_hiera' )
57
73
expect ( run_plan ( 'peadm::add_compiler' , params2 ) ) . to be_ok
58
74
end
59
75
end
0 commit comments