Skip to content

Commit 58ac122

Browse files
committed
test(inspec): replace serverspec with inspec tests
1 parent c64d9e4 commit 58ac122

File tree

5 files changed

+41
-23
lines changed

5 files changed

+41
-23
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
control 'Postgres command' do
2+
title 'should match desired lines'
3+
4+
describe command(%q{su - postgres -c 'psql -qtc "\l+ db2"'}) do
5+
its(:stdout) { should match(/db2.*remoteUser.*UTF8.*en_US\.UTF-8.*en_US\.UTF-8.*my_space/) }
6+
end
7+
end
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
control 'Postgres configuration' do
2+
title 'should include the directory'
3+
4+
describe file('/srv/my_tablespace') do
5+
it { should be_directory }
6+
it { should be_owned_by 'postgres' }
7+
it { should be_grouped_into 'postgres' }
8+
its('mode') { should cmp '0700' }
9+
end
10+
end
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
control 'Postgres service' do
2+
impact 0.5
3+
title 'should be running and enabled'
4+
5+
describe service('postgresql') do
6+
it { should be_enabled }
7+
it { should be_running }
8+
end
9+
10+
describe port(5432) do
11+
it { should be_listening }
12+
end
13+
end

test/integration/default/inspec.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: postgres
2+
title: Postgres Formula
3+
maintainer: Your Name
4+
license: Apache-2.0
5+
summary: Verify that the postgres formula is setup and configured correctly
6+
supports:
7+
- os-name: debian
8+
- os-name: ubuntu
9+
- os-name: centos
10+
- os-name: fedora
11+
- os-name: opensuse

test/integration/default/serverspec/postgres_spec.rb

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)