|
32 | 32 |
|
33 | 33 | it { is_expected.to contain_postgresql__server__role('test') } |
34 | 34 | it 'should have create role for "test" user with password as ****' do |
35 | | - is_expected.to contain_postgresql_psql('CREATE ROLE test ENCRYPTED PASSWORD ****').with({ |
| 35 | + is_expected.to contain_postgresql_psql('test: CREATE ROLE test ENCRYPTED PASSWORD ****').with({ |
36 | 36 | 'command' => "CREATE ROLE \"test\" ENCRYPTED PASSWORD '$NEWPGPASSWD' NOCREATEROLE NOCREATEDB LOGIN NOSUPERUSER CONNECTION LIMIT -1", |
37 | 37 | 'environment' => "NEWPGPASSWD=new-pa$s", |
38 | 38 | 'unless' => "SELECT 1 FROM pg_roles WHERE rolname = 'test'", |
39 | 39 | 'port' => "5432", |
40 | 40 | }) |
41 | 41 | end |
42 | 42 | it 'should have alter role for "test" user with password as ****' do |
43 | | - is_expected.to contain_postgresql_psql('ALTER ROLE test ENCRYPTED PASSWORD ****').with({ |
| 43 | + is_expected.to contain_postgresql_psql('test: ALTER ROLE test ENCRYPTED PASSWORD ****').with({ |
44 | 44 | 'command' => "ALTER ROLE \"test\" ENCRYPTED PASSWORD '$NEWPGPASSWD'", |
45 | 45 | 'environment' => "NEWPGPASSWD=new-pa$s", |
46 | 46 | 'unless' => "SELECT 1 FROM pg_shadow WHERE usename = 'test' AND passwd = 'md5b6f7fcbbabb4befde4588a26c1cfd2fa'", |
|
61 | 61 |
|
62 | 62 | it { is_expected.to contain_postgresql__server__role('test') } |
63 | 63 | it 'should have create role for "test" user with password as ****' do |
64 | | - is_expected.to contain_postgresql_psql('CREATE ROLE test ENCRYPTED PASSWORD ****').with({ |
| 64 | + is_expected.to contain_postgresql_psql('test: CREATE ROLE test ENCRYPTED PASSWORD ****').with({ |
65 | 65 | 'command' => "CREATE ROLE \"test\" NOCREATEROLE NOCREATEDB LOGIN NOSUPERUSER CONNECTION LIMIT -1", |
66 | 66 | 'environment' => [], |
67 | 67 | 'unless' => "SELECT 1 FROM pg_roles WHERE rolname = 'test'", |
|
87 | 87 |
|
88 | 88 | it { is_expected.to contain_postgresql__server__role('test') } |
89 | 89 | it 'should have create role for "test" user with password as ****' do |
90 | | - is_expected.to contain_postgresql_psql('CREATE ROLE test ENCRYPTED PASSWORD ****').with({ |
| 90 | + is_expected.to contain_postgresql_psql('test: CREATE ROLE test ENCRYPTED PASSWORD ****').with({ |
91 | 91 | 'command' => "CREATE ROLE \"test\" ENCRYPTED PASSWORD '$NEWPGPASSWD' NOCREATEROLE NOCREATEDB LOGIN NOSUPERUSER CONNECTION LIMIT -1", |
92 | 92 | 'environment' => "NEWPGPASSWD=new-pa$s", |
93 | 93 | 'unless' => "SELECT 1 FROM pg_roles WHERE rolname = 'test'", |
|
100 | 100 | }) |
101 | 101 | end |
102 | 102 | it 'should have alter role for "test" user with password as ****' do |
103 | | - is_expected.to contain_postgresql_psql('ALTER ROLE test ENCRYPTED PASSWORD ****').with({ |
| 103 | + is_expected.to contain_postgresql_psql('test: ALTER ROLE test ENCRYPTED PASSWORD ****').with({ |
104 | 104 | 'command' => "ALTER ROLE \"test\" ENCRYPTED PASSWORD '$NEWPGPASSWD'", |
105 | 105 | 'environment' => "NEWPGPASSWD=new-pa$s", |
106 | 106 | 'unless' => "SELECT 1 FROM pg_shadow WHERE usename = 'test' AND passwd = 'md5b6f7fcbbabb4befde4588a26c1cfd2fa'", |
|
132 | 132 |
|
133 | 133 | it { is_expected.to contain_postgresql__server__role('test') } |
134 | 134 | it 'should have create role for "test" user with password as ****' do |
135 | | - is_expected.to contain_postgresql_psql('CREATE ROLE test ENCRYPTED PASSWORD ****').with({ |
| 135 | + is_expected.to contain_postgresql_psql('test: CREATE ROLE test ENCRYPTED PASSWORD ****').with({ |
136 | 136 | 'command' => "CREATE ROLE \"test\" ENCRYPTED PASSWORD '$NEWPGPASSWD' NOCREATEROLE NOCREATEDB LOGIN NOSUPERUSER CONNECTION LIMIT -1", |
137 | 137 | 'environment' => "NEWPGPASSWD=new-pa$s", |
138 | 138 | 'unless' => "SELECT 1 FROM pg_roles WHERE rolname = 'test'", |
|
144 | 144 | }) |
145 | 145 | end |
146 | 146 | it 'should have alter role for "test" user with password as ****' do |
147 | | - is_expected.to contain_postgresql_psql('ALTER ROLE test ENCRYPTED PASSWORD ****').with({ |
| 147 | + is_expected.to contain_postgresql_psql('test: ALTER ROLE test ENCRYPTED PASSWORD ****').with({ |
148 | 148 | 'command' => "ALTER ROLE \"test\" ENCRYPTED PASSWORD '$NEWPGPASSWD'", |
149 | 149 | 'environment' => "NEWPGPASSWD=new-pa$s", |
150 | 150 | 'unless' => "SELECT 1 FROM pg_shadow WHERE usename = 'test' AND passwd = 'md5b6f7fcbbabb4befde4588a26c1cfd2fa'", |
|
171 | 171 |
|
172 | 172 | it { is_expected.to contain_postgresql__server__role('test') } |
173 | 173 | it 'should have create role for "test" user with password as ****' do |
174 | | - is_expected.to contain_postgresql_psql('CREATE USER test ENCRYPTED PASSWORD ****').with({ |
| 174 | + is_expected.to contain_postgresql_psql('test: CREATE USER test ENCRYPTED PASSWORD ****').with({ |
175 | 175 | 'command' => "CREATE USER \"test\" PASSWORD '$NEWPGPASSWD' NOCREATEUSER NOCREATEDB CONNECTION LIMIT UNLIMITED", |
176 | 176 | 'environment' => "NEWPGPASSWD=new-pa$s", |
177 | 177 | 'unless' => "SELECT 1 FROM pg_user_info WHERE usename = 'test'", |
178 | 178 | 'port' => "5432", |
179 | 179 | }) |
180 | 180 | end |
181 | 181 | it 'should have alter role for "test" user with password as ****' do |
182 | | - is_expected.to contain_postgresql_psql('ALTER USER test ENCRYPTED PASSWORD ****').with({ |
| 182 | + is_expected.to contain_postgresql_psql('test: ALTER USER test ENCRYPTED PASSWORD ****').with({ |
183 | 183 | 'command' => "ALTER USER \"test\" PASSWORD '$NEWPGPASSWD'", |
184 | 184 | 'environment' => "NEWPGPASSWD=new-pa$s", |
185 | 185 | 'unless' => "SELECT 1 FROM pg_user WHERE usename = 'test' AND passwd = 'md5b6f7fcbbabb4befde4588a26c1cfd2fa'", |
|
200 | 200 |
|
201 | 201 | it { is_expected.to contain_postgresql__server__role('test') } |
202 | 202 | it 'should have create role for "test" user with password as ****' do |
203 | | - is_expected.to contain_postgresql_psql('CREATE USER test ENCRYPTED PASSWORD ****').with({ |
| 203 | + is_expected.to contain_postgresql_psql('test: CREATE USER test ENCRYPTED PASSWORD ****').with({ |
204 | 204 | 'command' => "CREATE USER \"test\" PASSWORD DISABLE NOCREATEUSER NOCREATEDB CONNECTION LIMIT UNLIMITED", |
205 | 205 | 'environment' => [], |
206 | 206 | 'unless' => "SELECT 1 FROM pg_user_info WHERE usename = 'test'", |
|
226 | 226 |
|
227 | 227 | it { is_expected.to contain_postgresql__server__role('test') } |
228 | 228 | it 'should have create role for "test" user with password as ****' do |
229 | | - is_expected.to contain_postgresql_psql('CREATE USER test ENCRYPTED PASSWORD ****').with({ |
| 229 | + is_expected.to contain_postgresql_psql('test: CREATE USER test ENCRYPTED PASSWORD ****').with({ |
230 | 230 | 'command' => "CREATE USER \"test\" PASSWORD '$NEWPGPASSWD' NOCREATEUSER NOCREATEDB CONNECTION LIMIT UNLIMITED", |
231 | 231 | 'environment' => "NEWPGPASSWD=new-pa$s", |
232 | 232 | 'unless' => "SELECT 1 FROM pg_user_info WHERE usename = 'test'", |
|
239 | 239 | }) |
240 | 240 | end |
241 | 241 | it 'should have alter role for "test" user with password as ****' do |
242 | | - is_expected.to contain_postgresql_psql('ALTER USER test ENCRYPTED PASSWORD ****').with({ |
| 242 | + is_expected.to contain_postgresql_psql('test: ALTER USER test ENCRYPTED PASSWORD ****').with({ |
243 | 243 | 'command' => "ALTER USER \"test\" PASSWORD '$NEWPGPASSWD'", |
244 | 244 | 'environment' => "NEWPGPASSWD=new-pa$s", |
245 | 245 | 'unless' => "SELECT 1 FROM pg_user WHERE usename = 'test' AND passwd = 'md5b6f7fcbbabb4befde4588a26c1cfd2fa'", |
|
271 | 271 |
|
272 | 272 | it { is_expected.to contain_postgresql__server__role('test') } |
273 | 273 | it 'should have create role for "test" user with password as ****' do |
274 | | - is_expected.to contain_postgresql_psql('CREATE USER test ENCRYPTED PASSWORD ****').with({ |
| 274 | + is_expected.to contain_postgresql_psql('test: CREATE USER test ENCRYPTED PASSWORD ****').with({ |
275 | 275 | 'command' => "CREATE USER \"test\" PASSWORD '$NEWPGPASSWD' NOCREATEUSER NOCREATEDB CONNECTION LIMIT UNLIMITED", |
276 | 276 | 'environment' => "NEWPGPASSWD=new-pa$s", |
277 | 277 | 'unless' => "SELECT 1 FROM pg_user_info WHERE usename = 'test'", |
|
283 | 283 | }) |
284 | 284 | end |
285 | 285 | it 'should have alter role for "test" user with password as ****' do |
286 | | - is_expected.to contain_postgresql_psql('ALTER USER test ENCRYPTED PASSWORD ****').with({ |
| 286 | + is_expected.to contain_postgresql_psql('test: ALTER USER test ENCRYPTED PASSWORD ****').with({ |
287 | 287 | 'command' => "ALTER USER \"test\" PASSWORD '$NEWPGPASSWD'", |
288 | 288 | 'environment' => "NEWPGPASSWD=new-pa$s", |
289 | 289 | 'unless' => "SELECT 1 FROM pg_user WHERE usename = 'test' AND passwd = 'md5b6f7fcbbabb4befde4588a26c1cfd2fa'", |
|
0 commit comments