11
11
it { is_expected . to contain_file ( '/var/lib/postgresql/13/main' ) }
12
12
13
13
it {
14
- expect ( subject ) . to contain_exec ( 'postgresql_reload ' ) . with ( 'command' => 'systemctl reload postgresql' )
14
+ expect ( subject ) . to contain_exec ( 'postgresql_reload_main ' ) . with ( 'command' => 'systemctl reload postgresql' )
15
15
}
16
16
17
17
it 'validates connection' do
18
- expect ( subject ) . to contain_postgresql_conn_validator ( 'validate_service_is_running ' )
18
+ expect ( subject ) . to contain_postgresql_conn_validator ( 'validate_service_is_running_instance_main ' )
19
19
end
20
20
end
21
21
@@ -61,14 +61,14 @@ class { 'postgresql::globals':
61
61
it { is_expected . to contain_class ( 'postgresql::server::passwd' ) }
62
62
63
63
it 'validates connection' do
64
- expect ( subject ) . to contain_postgresql_conn_validator ( 'validate_service_is_running ' )
64
+ expect ( subject ) . to contain_postgresql_conn_validator ( 'validate_service_is_running_instance_main ' )
65
65
end
66
66
67
67
it 'sets postgres password' do
68
- expect ( subject ) . to contain_exec ( 'set_postgres_postgrespw ' ) . with ( 'command' => '/usr/bin/psql -c "ALTER ROLE \"postgres\" PASSWORD ${NEWPASSWD_ESCAPED}"' ,
69
- 'user' => 'postgres' ,
70
- 'environment' => [ 'PGPASSWORD=new-p@s$word-to-set' , 'PGPORT=5432' , 'NEWPASSWD_ESCAPED=$$new-p@s$word-to-set$$' ] ,
71
- 'unless' => "/usr/bin/psql -h localhost -p 5432 -c 'select 1' > /dev/null" )
68
+ expect ( subject ) . to contain_exec ( 'set_postgres_postgrespw_main ' ) . with ( 'command' => '/usr/bin/psql -c "ALTER ROLE \"postgres\" PASSWORD ${NEWPASSWD_ESCAPED}"' ,
69
+ 'user' => 'postgres' ,
70
+ 'environment' => [ 'PGPASSWORD=new-p@s$word-to-set' , 'PGPORT=5432' , 'NEWPASSWD_ESCAPED=$$new-p@s$word-to-set$$' ] ,
71
+ 'unless' => "/usr/bin/psql -h localhost -p 5432 -c 'select 1' > /dev/null" )
72
72
end
73
73
end
74
74
@@ -85,14 +85,14 @@ class { 'postgresql::globals':
85
85
it { is_expected . to contain_class ( 'postgresql::server::passwd' ) }
86
86
87
87
it 'validates connection' do
88
- expect ( subject ) . to contain_postgresql_conn_validator ( 'validate_service_is_running ' )
88
+ expect ( subject ) . to contain_postgresql_conn_validator ( 'validate_service_is_running_instance_main ' )
89
89
end
90
90
91
91
it 'sets postgres password' do
92
- expect ( subject ) . to contain_exec ( 'set_postgres_postgrespw ' ) . with ( 'command' => [ '/usr/bin/psql -c "ALTER ROLE \"postgres\" PASSWORD ${NEWPASSWD_ESCAPED}"' ] ,
93
- 'user' => 'postgres' ,
94
- 'environment' => [ 'PGPASSWORD=new-p@s$word-to-set' , 'PGPORT=5432' , 'NEWPASSWD_ESCAPED=$$new-p@s$word-to-set$$' ] ,
95
- 'unless' => "/usr/bin/psql -h localhost -p 5432 -c 'select 1' > /dev/null" )
92
+ expect ( subject ) . to contain_exec ( 'set_postgres_postgrespw_main ' ) . with ( 'command' => [ '/usr/bin/psql -c "ALTER ROLE \"postgres\" PASSWORD ${NEWPASSWD_ESCAPED}"' ] ,
93
+ 'user' => 'postgres' ,
94
+ 'environment' => [ 'PGPASSWORD=new-p@s$word-to-set' , 'PGPORT=5432' , 'NEWPASSWD_ESCAPED=$$new-p@s$word-to-set$$' ] ,
95
+ 'unless' => "/usr/bin/psql -h localhost -p 5432 -c 'select 1' > /dev/null" )
96
96
end
97
97
end
98
98
@@ -103,7 +103,7 @@ class { 'postgresql::globals':
103
103
it { is_expected . to contain_class ( 'postgresql::server' ) }
104
104
105
105
it 'shouldnt validate connection' do
106
- expect ( subject ) . not_to contain_postgresql_conn_validator ( 'validate_service_is_running ' )
106
+ expect ( subject ) . not_to contain_postgresql_conn_validator ( 'validate_service_is_running_instance_main ' )
107
107
end
108
108
end
109
109
@@ -118,7 +118,7 @@ class { 'postgresql::globals':
118
118
}
119
119
120
120
it 'validates connection' do
121
- expect ( subject ) . to contain_postgresql_conn_validator ( 'validate_service_is_running ' )
121
+ expect ( subject ) . to contain_postgresql_conn_validator ( 'validate_service_is_running_instance_main ' )
122
122
end
123
123
end
124
124
@@ -135,7 +135,7 @@ class { 'postgresql::globals':
135
135
it { is_expected . to contain_postgresql__server__config_entry ( 'data_directory_for_instance_main' ) }
136
136
137
137
it 'validates connection' do
138
- expect ( subject ) . to contain_postgresql_conn_validator ( 'validate_service_is_running ' )
138
+ expect ( subject ) . to contain_postgresql_conn_validator ( 'validate_service_is_running_instance_main ' )
139
139
end
140
140
end
141
141
@@ -146,27 +146,27 @@ class { 'postgresql::globals':
146
146
it { is_expected . to contain_class ( 'postgresql::server' ) }
147
147
148
148
it {
149
- expect ( subject ) . to contain_exec ( 'postgresql_reload ' ) . with ( 'command' => '/bin/true' )
149
+ expect ( subject ) . to contain_exec ( 'postgresql_reload_main ' ) . with ( 'command' => '/bin/true' )
150
150
}
151
151
152
152
it 'validates connection' do
153
- expect ( subject ) . to contain_postgresql_conn_validator ( 'validate_service_is_running ' )
153
+ expect ( subject ) . to contain_postgresql_conn_validator ( 'validate_service_is_running_instance_main ' )
154
154
end
155
155
end
156
156
157
157
describe 'service_manage => true' do
158
158
let ( :params ) { { service_manage : true } }
159
159
160
- it { is_expected . to contain_service ( 'postgresqld ' ) }
160
+ it { is_expected . to contain_service ( 'postgresqld_instance_main ' ) }
161
161
end
162
162
163
163
describe 'service_manage => false' do
164
164
let ( :params ) { { service_manage : false } }
165
165
166
- it { is_expected . not_to contain_service ( 'postgresqld ' ) }
166
+ it { is_expected . not_to contain_service ( 'postgresqld_instance_main ' ) }
167
167
168
168
it 'shouldnt validate connection' do
169
- expect ( subject ) . not_to contain_postgresql_conn_validator ( 'validate_service_is_running ' )
169
+ expect ( subject ) . not_to contain_postgresql_conn_validator ( 'validate_service_is_running_instance_main ' )
170
170
end
171
171
end
172
172
@@ -182,7 +182,7 @@ class { 'postgresql::globals':
182
182
end
183
183
184
184
it 'stills enable the service' do
185
- expect ( subject ) . to contain_service ( 'postgresqld ' ) . with ( ensure : 'running' )
185
+ expect ( subject ) . to contain_service ( 'postgresqld_instance_main ' ) . with ( ensure : 'running' )
186
186
end
187
187
end
188
188
@@ -194,7 +194,7 @@ class { 'postgresql::globals':
194
194
end
195
195
196
196
it 'contains proper initdb exec' do
197
- expect ( subject ) . to contain_exec ( 'postgresql_initdb ' )
197
+ expect ( subject ) . to contain_exec ( 'postgresql_initdb_instance_main ' )
198
198
end
199
199
end
200
200
0 commit comments