File: puppetlabs-postgresql_spec.rb

package info (click to toggle)
puppet-module-puppetlabs-postgresql 10.5.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 940 kB
  • sloc: ruby: 731; sh: 66; makefile: 2
file content (52 lines) | stat: -rw-r--r-- 1,376 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
require 'spec_helper'

describe "postgresql is not installed" do
  describe package('postgresql-common') do
    it { should_not be_installed }
  end
  describe service('postgresql') do
    it { should_not be_running }
  end
end

describe "postgresql::client class applies successfully" do
  describe command("puppet apply --logdest /var/log/puppet-apply.log --test -e 'include postgresql::client'") do
    its(:exit_status) { should eq 2 }
  end
end

describe "postgresql-client-common is installed" do
  describe package('postgresql-client-common') do
    it { should be_installed }
  end
end

describe "postgresql::server class applies successfully" do
  describe command("puppet apply --logdest /var/log/puppet-apply.log --test -e 'include postgresql::server'") do
    its(:exit_status) { should eq 2 }
  end
end

describe "postgresql-common is installed" do
  describe package('postgresql-common') do
    it { should be_installed }
  end
end

describe "postgresql service is started" do
  # allow time for the service to start
  before(:all) do
    sleep 5
  end
  describe service('postgresql') do
    it { should be_enabled }
    it { should be_running }
  end
end

describe "postgresql is responsive" do
  describe command("pg_isready -h localhost -p 5432") do
    its(:exit_status) { should eq 0 }
    its(:stdout) { should include "accepting connections" }
  end
end