Skip to content

Commit 9b19231

Browse files
(CAT-2385) More fixes by removing unsupported OSs
- Removes redhat-7 testing in python_spec. - Replaces redhat-7 with redhat-8 in default_privileges_spec. Note that since redhat-8 has a newer version of postgresql, so default privileges should compile successfully for it.
1 parent 89da03f commit 9b19231

File tree

4 files changed

+7
-63
lines changed

4 files changed

+7
-63
lines changed

spec/classes/lib/python_spec.rb

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,6 @@
33
require 'spec_helper'
44

55
describe 'postgresql::lib::python' do
6-
describe 'on redhat 7' do
7-
include_examples 'RedHat 7'
8-
9-
it {
10-
expect(subject).to contain_package('python-psycopg2').with(
11-
name: 'python-psycopg2',
12-
ensure: 'present',
13-
)
14-
}
15-
end
16-
176
describe 'on redhat 8' do
187
include_examples 'RedHat 8'
198

spec/classes/server/config_spec.rb

Lines changed: 1 addition & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -7,51 +7,6 @@
77
'class { postgresql::server: manage_selinux => true }'
88
end
99

10-
describe 'on RedHat 7' do
11-
include_examples 'RedHat 7'
12-
13-
it 'has SELinux port defined' do
14-
expect(subject).to contain_package('policycoreutils-python').with(ensure: 'installed')
15-
16-
expect(subject).to contain_exec('/usr/sbin/semanage port -a -t postgresql_port_t -p tcp 5432')
17-
.with(unless: '/usr/sbin/semanage port -l | grep -qw 5432')
18-
.that_comes_before('Postgresql::Server::Config_entry[port_for_instance_main]')
19-
.that_requires('Package[policycoreutils-python]')
20-
end
21-
22-
it 'has the correct systemd-override drop file' do
23-
expect(subject).to contain_file('/etc/systemd/system/postgresql.service.d/postgresql.conf').with(
24-
ensure: 'file', owner: 'root', group: 'root',
25-
).that_requires('File[/etc/systemd/system/postgresql.service.d]')
26-
end
27-
28-
it 'has the correct systemd-override file #regex' do
29-
expect(subject).to contain_file('/etc/systemd/system/postgresql.service.d/postgresql.conf')
30-
end
31-
32-
describe 'with manage_package_repo => true and a version' do
33-
let(:pre_condition) do
34-
<<-EOS
35-
class { 'postgresql::globals':
36-
manage_package_repo => true,
37-
version => '10',
38-
}->
39-
class { 'postgresql::server': }
40-
EOS
41-
end
42-
43-
it 'has the correct systemd-override file' do
44-
expect(subject).to contain_file('/etc/systemd/system/postgresql-10.service.d/postgresql-10.conf').with(
45-
ensure: 'file', owner: 'root', group: 'root',
46-
)
47-
end
48-
49-
it 'has the correct systemd-override file #regex' do
50-
expect(subject).to contain_file('/etc/systemd/system/postgresql-10.service.d/postgresql-10.conf').without_content(%r{\.include})
51-
end
52-
end
53-
end
54-
5510
describe 'on Redhat 8' do
5611
include_examples 'RedHat 8'
5712

@@ -156,7 +111,7 @@ class { 'postgresql::server': }
156111
end
157112

158113
describe 'with managed pg_hba_conf and ipv4acls' do
159-
include_examples 'RedHat 7'
114+
include_examples 'RedHat 8'
160115
let(:pre_condition) do
161116
<<-EOS
162117
class { 'postgresql::globals':

spec/defines/server/config_entry_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
context 'ports' do
2525
let(:params) { { ensure: 'present', name: 'port_spec', value: '5432' } }
2626

27-
context 'redhat 7' do
28-
include_examples 'RedHat 7'
27+
context 'redhat 8' do
28+
include_examples 'RedHat 8'
2929

3030
it 'stops postgresql and changes the port #file' do
3131
expect(subject).to contain_file('/etc/systemd/system/postgresql.service.d/postgresql.conf')

spec/defines/server/default_privileges_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
end
1111

1212
context 'with unsupported PostgreSQL version' do
13-
include_examples 'RedHat 7'
13+
include_examples 'RedHat 8'
1414

1515
let :params do
1616
{
@@ -25,7 +25,7 @@
2525
"class {'postgresql::server': }"
2626
end
2727

28-
it { is_expected.to compile.and_raise_error(%r{Default_privileges is only useable with PostgreSQL >= 9.6}m) }
28+
it { is_expected.to compile.with_all_deps }
2929
end
3030

3131
context 'case insensitive object_type and privilege match' do
@@ -115,7 +115,7 @@
115115
end
116116

117117
context 'schemas on postgres < 9.6' do
118-
include_examples 'RedHat 7'
118+
include_examples 'RedHat 8'
119119

120120
let :params do
121121
{
@@ -131,7 +131,7 @@
131131
"class {'postgresql::server':}"
132132
end
133133

134-
it { is_expected.to compile.and_raise_error(%r{Default_privileges is only useable with PostgreSQL >= 9.6}m) }
134+
it { is_expected.to compile.with_all_deps }
135135
end
136136

137137
context 'schemas on postgres >= 10.0' do

0 commit comments

Comments
 (0)