Merge some tests to make travis faster (less permutations)

This commit is contained in:
Marcus Young 2017-04-28 15:02:17 -05:00
parent da9c643213
commit aafb5a1ae0
6 changed files with 18 additions and 72 deletions

View file

@ -29,12 +29,6 @@ platforms:
run_command: /sbin/init
suites:
- name: default
provisioner:
state_top:
base:
'*':
- vault
- name: dev_server_systemd
excludes:
- amazonlinux
@ -53,7 +47,7 @@ suites:
vault:
service:
type: systemd
- name: dev_server_upstart
- name: dev_server_upstart_s3
includes:
- amazonlinux
provisioner:
@ -71,24 +65,6 @@ suites:
vault:
service:
type: upstart
- name: server_backend_s3
includes:
- amazonlinux
provisioner:
state_top:
base:
'*':
- vault
- vault.server
pillars:
top.sls:
base:
'*':
- vault
vault.sls:
vault:
backend:
type: s3
bucket: com-saltstack-vault
service:
type: upstart

View file

@ -1,6 +0,0 @@
describe command('/usr/local/bin/vault -version') do
its(:exit_status) { should eq 0 }
its(:stderr) { should be_empty }
its(:stdout) { should match(/^Vault v[0-9\.]+ \('[0-9a-f]+'\)/) }
end

View file

@ -1,3 +1,9 @@
describe command('/usr/local/bin/vault -version') do
its(:exit_status) { should eq 0 }
its(:stderr) { should be_empty }
its(:stdout) { should match(/^Vault v[0-9\.]+ \('[0-9a-f]+'\)/) }
end
describe file('/etc/vault/config/server.hcl') do
it { should be_a_file }
expected =<<-EOF

View file

@ -1,6 +1,16 @@
describe command('/usr/local/bin/vault -version') do
its(:exit_status) { should eq 0 }
its(:stderr) { should be_empty }
its(:stdout) { should match(/^Vault v[0-9\.]+ \('[0-9a-f]+'\)/) }
end
describe file('/etc/vault/config/server.hcl') do
it { should be_a_file }
expected = <<-EOF
backend "s3" {
bucket = "com-saltstack-vault"
}
listener "tcp" {
address = "0.0.0.0:8200"
tls_disable = 0

View file

@ -1,36 +0,0 @@
describe file('/etc/vault/config/server.hcl') do
it { should be_a_file }
its(:content) { should match /bucket = "com-saltstack-vault"/ }
end
describe file('/etc/init/vault.conf') do
it { should be_a_file }
its(:content) { should_not match /syslog/ }
end
if os[:family] == 'amazon'
# serverspec assumes 'service' resource to be
# init.d for rhel-based os. have to just check
# that it is running, that means that it started
# with the instance
describe command('sudo initctl list | grep vault | grep -v grep') do
its(:stdout) { should match(/vault start\/running/) }
its(:stderr) { should be_empty }
end
describe processes("vault") do
its('users') { should eq ['root'] }
end
else
describe service('vault') do
it { should be_enabled }
it { should be_running }
end
end
describe file('/var/log/vault.log') do
it { should be_a_file }
its(:content) { should match(/WARNING: Dev mode is enabled!/) }
end

View file

@ -65,12 +65,8 @@ generate self signed SSL certs:
vault:
service.running:
- enable: True
{%- if vault.self_signed_cert.enabled or vault.dev_mode %}
- require:
{%- if vault.self_signed_cert.enabled %}
- cmd: generate self signed SSL certs
{% endif -%}
{%- if vault.dev_mode %}
- file: /etc/vault/config/server.hcl
{% endif -%}
{% endif -%}