File tree 1 file changed +24
-15
lines changed 1 file changed +24
-15
lines changed Original file line number Diff line number Diff line change 27
27
}
28
28
}
29
29
end
30
+ let ( :pre_condition ) do
31
+ <<-PRE_COND
32
+ define puppet_enterprise::deprecated_parameter() {}
33
+
34
+ include pe_databases
35
+ PRE_COND
36
+ end
30
37
31
38
on_supported_os . each do |os , os_facts |
32
39
context "on #{ os } " do
33
- let ( :pre_condition ) do
34
- <<-PRE_COND
35
- define puppet_enterprise::deprecated_parameter() {}
36
-
37
- include pe_databases
38
- PRE_COND
39
- end
40
40
let ( :facts ) { os_facts }
41
41
42
42
it { is_expected . to compile }
43
43
end
44
44
end
45
45
46
46
context 'with default parameters' do
47
- let ( :pre_condition ) do
48
- <<-PRE_COND
49
- define puppet_enterprise::deprecated_parameter() {}
50
-
51
- include pe_databases
52
- PRE_COND
53
- end
54
-
55
47
it {
56
48
tables_hash . each do |name , val |
57
49
is_expected . to contain_pe_databases__collect ( name ) . with (
@@ -103,4 +95,21 @@ class {'pe_databases': facts_tables_repack_timer => 'Tue *-*-* 04:20:00'}
103
95
)
104
96
}
105
97
end
98
+
99
+ context 'when customizing log parameters' do
100
+ # Load the rspec hieradata. This data sets repack_log_level: 'INFO' and enable_echo: false
101
+ let ( :hiera_config ) { 'hiera-rspec.yaml' }
102
+
103
+ it {
104
+ # The command should have --elevel INFO and not contain --echo according to the hieradata
105
+ is_expected . to contain_pe_databases__collect ( 'facts' ) . with (
106
+ command : "#{ repack_cmd } --elevel INFO #{ tables_hash [ :facts ] [ :database ] } " ,
107
+ )
108
+
109
+ # The service file should have --elevel INFO and not contain --echo according to the hieradata
110
+ is_expected . to contain_file ( '/etc/systemd/system/pe_databases-facts.service' ) . with_content (
111
+ %r{ExecStart=#{ repack_cmd } --elevel INFO #{ tables_hash [ :facts ] [ :database ] } #{ tables_hash [ :facts ] [ :tables ] } } ,
112
+ )
113
+ }
114
+ end
106
115
end
You can’t perform that action at this time.
0 commit comments