Added puppetlabs-firewall (required by puppetlabs-postgresql), updated the other modules.

This commit is contained in:
Ciaby 2014-07-11 14:51:15 -05:00
parent 5f4b7a3b72
commit dee66abcdd
137 changed files with 11118 additions and 419 deletions

View file

@ -23,4 +23,22 @@ describe 'postgresql::server::config_entry:', :unless => UNSUPPORTED_PLATFORMS.i
expect(r.stderr).to eq('')
end
end
it 'should correctly set a quotes-required string' do
pp = <<-EOS.unindent
class { 'postgresql::server': }
postgresql::server::config_entry { 'log_directory':
value => '/tmp/testfile',
}
EOS
apply_manifest(pp, :catch_failures => true)
psql('--command="show all" postgres') do |r|
r.stdout.should =~ /log_directory.+\/tmp\/testfile/
r.stderr.should be_empty
r.exit_code.should == 0
end
end
end

View file

@ -27,3 +27,28 @@ describe 'postgresql::server::database:', :unless => UNSUPPORTED_PLATFORMS.inclu
end
end
end
describe 'postgresql::server::database: alternate port', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
it 'should idempotently create a db on a non-default port that we can connect to' do
begin
pp = <<-EOS.unindent
$db = 'postgresql_test_db'
class { 'postgresql::server':
port => 5433,
}
postgresql::server::database { $db: }
EOS
apply_manifest(pp, :catch_failures => true)
apply_manifest(pp, :catch_changes => true)
psql('--command="select datname from pg_database" --port=5433 postgresql_test_db') do |r|
expect(r.stdout).to match(/postgresql_test_db/)
expect(r.stderr).to eq('')
end
ensure
psql('--command="drop database postgresql_test_db" --port=5433 postgres')
end
end
end

View file

@ -135,4 +135,30 @@ describe 'postgresql::server::db', :unless => UNSUPPORTED_PLATFORMS.include?(fac
psql('--command="drop database postgresql_test_db" postgres')
end
end
it 'should take a dbname parameter' do
begin
pp = <<-EOS.unindent
$db = 'postgresql_test_db'
$dbname = 'postgresql_testtest_db'
class { 'postgresql::server': }
postgresql::server::db { $db:
dbname => $dbname,
user => $db,
password => postgresql_password($db, $db),
}
EOS
apply_manifest(pp, :catch_failures => true)
apply_manifest(pp, :catch_changes => true)
psql('--command="select datname from pg_database" postgresql_testtest_db') do |r|
expect(r.stdout).to match(/postgresql_testtest_db/)
expect(r.stderr).to eq('')
end
ensure
psql('--command="drop database postgresql_testtest_db" postgres')
end
end
end

View file

@ -85,4 +85,32 @@ describe 'postgresql::server::role:', :unless => UNSUPPORTED_PLATFORMS.include?(
expect(r.stderr).to eq('')
end
end
it 'should idempotently create a user with noinherit' do
pp = <<-EOS.unindent
$user = "postgresql_test_noinherit"
$password = "postgresql_test_noinherit"
class { 'postgresql::server': }
# Since we are not testing pg_hba or any of that, make a local user for ident auth
user { $user:
ensure => present,
}
postgresql::server::role { $user:
password_hash => $password,
inherit => false,
}
EOS
apply_manifest(pp, :catch_failures => true)
apply_manifest(pp, :catch_changes => true)
# Check that the user has noinherit set
psql('--command="select rolname from pg_roles where not rolinherit" postgres', 'postgresql_test_noinherit') do |r|
expect(r.stdout).to match(/postgresql_test_noinherit/)
expect(r.stderr).to eq('')
end
end
end