Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] add test to validate vault upgrade #124

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ matrix:
env: PUPPET_INSTALL_TYPE=agent BEAKER_set="ubuntu-16.04-x86_64-docker"
script: bundle exec rake acceptance
bundler_args: --without development
- sudo: required
services: docker
rvm: 2.4.2
env: PUPPET_INSTALL_TYPE=agent BEAKER_set="debian-9-x86_64-docker"
script: bundle exec rake acceptance
bundler_args: --without development
deploy:
provider: puppetforge
user: jsok
Expand Down
39 changes: 39 additions & 0 deletions spec/acceptance/class_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,5 +107,44 @@ class { '::vault':
describe port(8200) do
it { is_expected.to be_listening.on('127.0.0.1').with('tcp') }
end
describe command('vault version') do
its(:stdout) { is_expected.to match %r{v0\.10\.0} }
end
end

# we will test if we can update vault to another version
context 'updated vault version' do
it 'works idempotently with no errors' do
pp = <<-MANIFEST
class { 'vault':
version => '0.10.1',
storage => {
file => {
path => '/tmp',
}
},
listener => [{
tcp => {
address => '127.0.0.1:8200',
tls_disable => 1,
}
}]
}
MANIFEST
# Run it twice and test for idempotency
apply_manifest(pp, catch_failures: true)
apply_manifest(pp, catch_changes: true)
end
describe service('vault') do
it { is_expected.to be_enabled }
it { is_expected.to be_running }
end

describe port(8200) do
it { is_expected.to be_listening.on('127.0.0.1').with('tcp') }
end
describe command('vault version') do
its(:stdout) { is_expected.to match %r{v0\.10\.1} }
end
end
end
21 changes: 21 additions & 0 deletions spec/acceptance/nodesets/debian-9-x86_64-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
HOSTS:
debian-9-x64:
default_apply_opts:
order: random
strict_variables:
platform: debian-9-amd64
hypervisor : docker
# Need upstart to tests services
image: debian:9
docker_cmd: '["/sbin/init"]'
# This stops the image from being deleted on completion, speeding up the process.
docker_preserve_image: true
docker_image_commands:
- 'apt-get update && apt-get install -y cron locales-all net-tools wget systemd-sysv'
- 'rm -f /usr/sbin/policy-rc.d'
- 'systemctl mask [email protected] getty-static.service'
CONFIG:
type: foss
log_level: debug
docker_options:
ssl_verify_peer: false