mirror of
https://github.com/saltstack-formulas/postgres-formula.git
synced 2025-04-16 17:50:27 +00:00
Merge pull request #36 from seegno/feature/kitchen-salt
Add kitchen-salt testing
This commit is contained in:
commit
3357e1c705
6 changed files with 96 additions and 0 deletions
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
.kitchen/
|
||||
*.swp
|
||||
*.swo
|
26
.kitchen.yml
Normal file
26
.kitchen.yml
Normal file
|
@ -0,0 +1,26 @@
|
|||
---
|
||||
driver:
|
||||
name: vagrant
|
||||
network:
|
||||
- ["private_network", { ip: "192.168.33.33" }]
|
||||
|
||||
provisioner:
|
||||
name: salt_solo
|
||||
formula: postgres
|
||||
pillars-from-files:
|
||||
postgres.sls: pillar.example
|
||||
pillars:
|
||||
top.sls:
|
||||
base:
|
||||
"*":
|
||||
- postgres
|
||||
state_top:
|
||||
base:
|
||||
"*":
|
||||
- postgres
|
||||
|
||||
platforms:
|
||||
- name: ubuntu-14.04
|
||||
|
||||
suites:
|
||||
- name: default
|
5
Gemfile
Normal file
5
Gemfile
Normal file
|
@ -0,0 +1,5 @@
|
|||
source "https://rubygems.org"
|
||||
|
||||
gem "test-kitchen", "> 1.2.0"
|
||||
gem "kitchen-vagrant"
|
||||
gem "kitchen-salt"
|
26
Gemfile.lock
Normal file
26
Gemfile.lock
Normal file
|
@ -0,0 +1,26 @@
|
|||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
kitchen-salt (0.0.19)
|
||||
kitchen-vagrant (0.15.0)
|
||||
test-kitchen (~> 1.0)
|
||||
mixlib-shellout (2.0.1)
|
||||
net-scp (1.2.1)
|
||||
net-ssh (>= 2.6.5)
|
||||
net-ssh (2.9.2)
|
||||
safe_yaml (1.0.4)
|
||||
test-kitchen (1.3.1)
|
||||
mixlib-shellout (>= 1.2, < 3.0)
|
||||
net-scp (~> 1.1)
|
||||
net-ssh (~> 2.7)
|
||||
safe_yaml (~> 1.0)
|
||||
thor (~> 0.18)
|
||||
thor (0.19.1)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
kitchen-salt
|
||||
kitchen-vagrant
|
||||
test-kitchen (> 1.2.0)
|
26
README.rst
26
README.rst
|
@ -22,3 +22,29 @@ Installs the postgresql package.
|
|||
-------------------
|
||||
|
||||
Installs the postgresql python module
|
||||
|
||||
Testing
|
||||
=======
|
||||
|
||||
Testing is done wit kitchen-salt
|
||||
|
||||
``kitchen converge``
|
||||
--------------------
|
||||
|
||||
Runs the postgres main state
|
||||
|
||||
``kitchen verify``
|
||||
------------------
|
||||
|
||||
Runs serverspec tests on the actual instance
|
||||
|
||||
``kitchen test``
|
||||
----------------
|
||||
|
||||
Builds and runs test from scratch
|
||||
|
||||
``kitchen login``
|
||||
-----------------
|
||||
|
||||
Gives you ssh to the vagrant machine for manual testing
|
||||
|
||||
|
|
10
test/integration/default/serverspec/postgres_spec.rb
Normal file
10
test/integration/default/serverspec/postgres_spec.rb
Normal file
|
@ -0,0 +1,10 @@
|
|||
require "serverspec"
|
||||
|
||||
describe service("postgres") do
|
||||
it { should be_enabled }
|
||||
it { should be_running }
|
||||
end
|
||||
|
||||
describe port("5432") do
|
||||
it { should be_listening }
|
||||
end
|
Loading…
Add table
Reference in a new issue