module-postgresql/spec/acceptance/alternative_port_spec.rb

29 lines
671 B
Ruby
Raw Normal View History

2014-07-09 22:37:29 +02:00
require 'spec_helper_acceptance'
# These tests ensure that postgres can change itself to an alternative port
# properly.
describe 'postgres::server', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
it 'on an alternative port' do
pp = <<-EOS
class { 'postgresql::server': port => '55433' }
2014-07-09 22:37:29 +02:00
EOS
apply_manifest(pp, :catch_failures => true)
apply_manifest(pp, :catch_changes => true)
end
describe port(55433) do
2014-07-09 22:37:29 +02:00
it { is_expected.to be_listening }
end
it 'can connect with psql' do
psql('-p 55433 --command="\l" postgres', 'postgres') do |r|
2014-07-09 22:37:29 +02:00
expect(r.stdout).to match(/List of databases/)
end
end
end