From 7828cf3f73efa566d2c3e64a658f2593232a6038 Mon Sep 17 00:00:00 2001 From: Martin Jackson Date: Thu, 21 Aug 2014 21:58:11 -0500 Subject: [PATCH] Create acceptance test for pgdata --- spec/acceptance/alternative_pgdata_spec.rb | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 spec/acceptance/alternative_pgdata_spec.rb diff --git a/spec/acceptance/alternative_pgdata_spec.rb b/spec/acceptance/alternative_pgdata_spec.rb new file mode 100644 index 0000000..6fee9b2 --- /dev/null +++ b/spec/acceptance/alternative_pgdata_spec.rb @@ -0,0 +1,24 @@ +require 'spec_helper_acceptance' + +# These tests ensure that postgres can change itself to an alternative pgdata +# location properly. +describe 'postgres::server', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do + it 'on an alternative pgdata location' do + pp = <<-EOS + class { 'postgresql::server': data_directory => '/var/pgsql' } + EOS + + apply_manifest(pp, :catch_failures => true) + apply_manifest(pp, :catch_changes => true) + end + + it 'can connect with psql' do + psql('-D /var/pgsql --command="\l" postgres', 'postgres') do |r| + expect(r.stdout).to match(/List of databases/) + end + end + +end + + +