Skip to content

Commit 7fb35f5

Browse files
author
Morgan Haskel
committed
Merge pull request puppetlabs#412 from apenney/fix-tests-1404
Fix tests 1404
2 parents 7fb959e + 4c85eee commit 7fb35f5

File tree

4 files changed

+22
-5
lines changed

4 files changed

+22
-5
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
HOSTS:
2+
ubuntu-server-1404-x64:
3+
roles:
4+
- master
5+
platform: ubuntu-14.04-64
6+
box: puppetlabs/ubuntu-14.04-64-nocm
7+
hypervisor : vagrant
8+
CONFIG:
9+
type: foss

spec/acceptance/server/config_entry_spec.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ class { 'postgresql::server': }
2828
pp = <<-EOS.unindent
2929
class { 'postgresql::server': }
3030
31-
postgresql::server::config_entry { 'listen_addresses':
32-
value => '0.0.0.0',
31+
postgresql::server::config_entry { 'log_directory':
32+
value => '/tmp/testfile',
3333
}
3434
EOS
3535

3636
apply_manifest(pp, :catch_failures => true)
3737

3838
psql('--command="show all" postgres') do |r|
39-
r.stdout.should =~ /listen_adresses.+0\.0\.0\.0/
39+
r.stdout.should =~ /log_directory.+\/tmp\/testfile/
4040
r.stderr.should be_empty
4141
r.exit_code.should == 0
4242
end

spec/acceptance/server_spec.rb

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
require 'spec_helper_acceptance'
22

3+
# Hack around the fact that so far only Ubuntu 14.04 seems to have moved this
4+
# file. Can revisit if everyone else gets clever.
5+
if fact('operatingsystem') == 'Ubuntu' && fact('operatingsystemrelease') == '14.04'
6+
pghba_file = '/etc/postgresql/9.3/main/pg_hba.conf'
7+
else
8+
pghba_file = '/var/lib/pgsql/data/pg_hba.conf'
9+
end
10+
311
describe 'server:', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
412
after :all do
513
# Cleanup after tests have ran
@@ -19,7 +27,7 @@ class { 'postgresql::server': }
1927
it { should be_listening }
2028
end
2129

22-
describe file('/var/lib/pgsql/data/pg_hba.conf') do
30+
describe file(pghba_file) do
2331
it { should be_file }
2432
it { should be_owned_by 'postgres' }
2533
it { should be_grouped_into 'postgres' }

spec/spec_helper_acceptance.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ def psql(psql_cmd, user = 'postgres', exit_codes = [0], &block)
4040
else
4141
install_puppet
4242
end
43-
on hosts, "mkdir -p #{host['distmoduledir']}"
4443
hosts.each do |host|
44+
shell("mkdir -p #{host['distmoduledir']}")
4545
if ! host.is_pe?
4646
# Augeas is only used in one place, for Redhat.
4747
if fact('osfamily') == 'RedHat'

0 commit comments

Comments
 (0)