Skip to content

Commit

Permalink
Updates Beaker tests for Vault (#77)
Browse files Browse the repository at this point in the history
* Updates example spec for beaker (invalid syntax)
* Changes module install to install archive module
* Adds new Travis acceptance jobs
* Updates example in README (invalid syntax)
* Updates Gemfile
  • Loading branch information
petems authored and jsok committed Jul 10, 2017
1 parent 8841573 commit ad160cc
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 43 deletions.
18 changes: 18 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,24 @@ matrix:
env: PUPPET_GEM_VERSION="~> 3.8.0" LEGACY=yes
- rvm: 2.1.9
env: PUPPET_GEM_VERSION="~> 4.9" DEPLOY_CANDIDATE=yes
- sudo: required
services: docker
rvm: '2.3.3'
env: PUPPET_INSTALL_VERSION="1.10.4" PUPPET_INSTALL_TYPE=agent BEAKER_set="centos-6-x86_64-docker"
script: bundle exec rake acceptance
bundler_args: --without development
- sudo: required
services: docker
rvm: '2.3.3'
env: PUPPET_INSTALL_VERSION="1.10.4" PUPPET_INSTALL_TYPE=agent BEAKER_set="centos-7-x86_64-docker"
script: bundle exec rake acceptance
bundler_args: --without development
- sudo: required
services: docker
rvm: '2.3.3'
env: PUPPET_INSTALL_VERSION="1.10.4" PUPPET_INSTALL_TYPE=agent BEAKER_set="ubuntu-14.04-x86_64-docker"
script: bundle exec rake acceptance
bundler_args: --without development
- rvm: 2.4.0
env: PUPPET_GEM_VERSION="~> 4" FUTURE=yes
allow_failures:
Expand Down
51 changes: 32 additions & 19 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,41 @@
source "https://rubygems.org"

RUBY_2_OR_NEWER = RUBY_VERSION >= '2.0.0'
source ENV['GEM_SOURCE'] || "https://rubygems.org"

group :test do
gem "rake", '~> 11'
gem "puppet", ENV['PUPPET_GEM_VERSION'] || '~> 4.9'
gem "rspec", '~> 3.5'
gem "rspec-puppet"
gem "puppetlabs_spec_helper"
gem "metadata-json-lint"
gem "rspec-puppet-facts"
gem "json_pure"
gem "parallel_tests", RUBY_2_OR_NEWER ? '~> 2' : '2.9.0'
gem 'puppetlabs_spec_helper', '2.2.0', :require => false
gem 'rspec-puppet', :require => false, :git => 'https://github.com/rodjek/rspec-puppet.git'
gem 'rspec-puppet-facts', :require => false
gem 'rspec-puppet-utils', :require => false
gem 'puppet-lint-absolute_classname-check', :require => false
gem 'puppet-lint-leading_zero-check', :require => false
gem 'puppet-lint-trailing_comma-check', :require => false
gem 'puppet-lint-version_comparison-check', :require => false
gem 'puppet-lint-classes_and_types_beginning_with_digits-check', :require => false
gem 'puppet-lint-unquoted_string-check', :require => false
gem 'puppet-lint-variable_contains_upcase', :require => false
gem 'metadata-json-lint', :require => false
gem 'puppet-strings', '1.1.0', :require => false
gem 'puppet_facts', :require => false
gem 'rubocop-rspec', '~> 1.6', :require => false if RUBY_VERSION >= '2.3.0'
gem 'json_pure', '<= 2.0.1', :require => false if RUBY_VERSION < '2.0.0'
gem 'safe_yaml', '~> 1.0.4', :require => false
gem 'listen', '<= 3.0.6', :require => false
gem 'puppet-syntax', :require => false, git: 'https://github.com/gds-operations/puppet-syntax.git'
gem 'pry'
gem 'rb-readline'
end

group :development do
gem "travis"
gem "travis-lint"
gem "vagrant-wrapper"
gem "puppet-blacksmith"
gem "guard-rake"
gem 'puppet-blacksmith'
gem 'travis'
end

group :system_tests do
gem "beaker"
gem "beaker-rspec"
gem "beaker", '2.41.0', :require => false
gem "beaker-rspec", '5.6.0', :require => false
gem 'beaker-puppet_install_helper', :require => false
end

ENV['PUPPET_GEM_VERSION'].nil? ? puppetversion = '~> 4.9' : puppetversion = ENV['PUPPET_GEM_VERSION'].to_s
gem 'puppet', puppetversion, :require => false, :groups => [:test]

# vim: syntax=ruby
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,14 @@ By default, with no parameters the module will configure vault with some sensibl
```puppet
class { '::vault':
backend => {
'file' => {
'path' => '/tmp',
file => {
path => '/tmp',
}
},
listener => {
'tcp' => {
'address' => '127.0.0.1:8200',
'tls_disable' => 0,
tcp => {
address => '127.0.0.1:8200',
tls_disable => 0,
}
}
}
Expand Down
12 changes: 6 additions & 6 deletions spec/acceptance/class_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
pp = <<-EOS
class { '::vault':
backend => {
'file' => {
'path' => '/tmp',
file => {
path => '/tmp',
}
},
listener' => {
'tcp' => {
'address' => '127.0.0.1:8200',
'tls_disable' => 1,
listener => {
tcp => {
address => '127.0.0.1:8200',
tls_disable => 1,
}
}
}
Expand Down
17 changes: 4 additions & 13 deletions spec/spec_helper_acceptance.rb
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
require 'beaker-rspec/spec_helper'
require 'beaker-rspec/helpers/serverspec'
require 'beaker-rspec'
require 'beaker/puppet_install_helper'

unless ENV['BEAKER_provision'] == 'no'
hosts.each do |host|
# Install Puppet
if host.is_pe?
install_pe
else
install_puppet
end
end
end
run_puppet_install_helper unless ENV['BEAKER_provision'] == 'no'

RSpec.configure do |c|
# Project root
Expand All @@ -25,7 +16,7 @@
puppet_module_install(:source => proj_root, :module_name => 'vault')
hosts.each do |host|
on host, puppet('module', 'install', 'puppetlabs-stdlib'), { :acceptable_exit_codes => [0,1] }
on host, puppet('module', 'install', 'nanliu-staging'), { :acceptable_exit_codes => [0,1] }
on host, puppet('module', 'install', 'puppet-archive'), { :acceptable_exit_codes => [0,1] }
end
end
end

0 comments on commit ad160cc

Please sign in to comment.