Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9346485
overridden_settings_spec.rb
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
overridden_settings_spec.rb
View Options
# frozen_string_literal: true
require
'spec_helper_acceptance'
# These tests are designed to ensure that the module, when ran overrides,
# sets up everything correctly and allows us to connect to Postgres.
describe
'postgresql::server'
do
let
(
:pp
)
do
<<-
MANIFEST
class { 'postgresql::server':
roles => {
'testusername' => {
password_hash => postgresql::postgresql_password('testusername', 'supersecret'),
createdb => true,
},
},
config_entries => {
max_connections => 21,
},
pg_hba_rules => {
'from_remote_host' => {
type => 'host',
database => 'mydb',
user => 'myuser',
auth_method => 'md5',
address => '192.0.2.100/32',
},
},
}
postgresql::server::database { 'testusername':
owner => 'testusername',
}
MANIFEST
end
it
'with additional hiera entries'
do
idempotent_apply
(
pp
)
expect
(
port
(
5432
))
.
to
be_listening
expect
(
psql
(
'--command="\l" postgres'
,
'postgres'
)
.
stdout
)
.
to
match
(
%r{List of databases}
)
expect
(
run_shell
(
'PGPASSWORD=supersecret psql -U testusername -h localhost --command="\l"'
)
.
stdout
)
.
to
match
'List of databases'
end
end
File Metadata
Details
Attached
Mime Type
text/x-ruby
Expires
Fri, Jul 4, 4:06 PM (2 w, 21 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3347230
Attached To
rSPPG PostgreSQL puppet module
Event Timeline
Log In to Comment