Skip to content
This repository was archived by the owner on Jan 24, 2019. It is now read-only.

Commit bc2a6f5

Browse files
committed
Add spec acceptance
1 parent f682038 commit bc2a6f5

File tree

9 files changed

+58
-4
lines changed

9 files changed

+58
-4
lines changed

.travis.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@
22
set -ev
33
rake lint
44
rake syntax
5+
# we can't ssh to localhost
6+
#rspec spec/acceptance

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ matrix:
77
fast_finish: true
88
env:
99
matrix:
10-
- PUPPET_GEM_VERSION="~> 3.7.0"
1110
notifications:
1211
email: false
1312
irc:

Gemfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ group :development, :test do
1515
gem 'puppet-lint-leading_zero-check'
1616
gem 'puppet-lint-variable_contains_upcase'
1717
gem 'puppet-lint-numericvariable'
18+
19+
gem 'rspec', :require => false
20+
gem 'beaker-rspec', :require => false
21+
gem 'beaker-puppet_install_helper', :require => false
1822
end
1923

2024
if puppetversion = ENV['PUPPET_GEM_VERSION']

manifests/lockdown_whitelist.pp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@
5252
) {
5353
include ::firewalld::configuration
5454

55-
if $users != [] {
56-
# TODO: assert there's one (and only one of) {username, userid}
57-
}
55+
# if $users != [] {
56+
# # TODO: assert there's one (and only one of) {username, userid}
57+
# }
5858

5959
file {
6060
'/etc/firewalld/lockdown-whitelist.xml':
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
require 'spec_helper_acceptance'
2+
3+
describe 'firewalld class' do
4+
context 'simple firewall' do
5+
it 'should work with no errors' do
6+
pp= <<-EOS
7+
firewalld::zone { 'usata':
8+
description => 'Mine',
9+
rich_rules => [{
10+
family => 'ipv4',
11+
source => { address => '192.168.1.1', invert => false},
12+
service => 'dns',
13+
action => { action_type => 'accept', }
14+
}],
15+
services => ['ssh', 'dhcpv6-client', 'dns', 'https', 'kerberos', 'http', 'kpasswd', 'ldap', 'ldaps', 'ntp'],
16+
}
17+
class { 'firewalld::configuration':
18+
default_zone => 'usata',
19+
}
20+
EOS
21+
22+
# Run it twice and test for idempotency
23+
apply_manifest(pp, :catch_failures => true)
24+
apply_manifest(pp, :catch_changes => true)
25+
end
26+
end
27+
end
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
HOSTS:
2+
test:
3+
platform: el-7-x86_64
4+
roles:
5+
- master
6+
hypervisor : none
7+
ip: 127.0.0.1
8+
CONFIG:
9+
type: foss
10+
set_env: false

spec/spec.opts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
--format
2+
s
3+
--colour
4+
--loadby
5+
mtime
6+
--backtrace

spec/spec_helper.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
require 'puppetlabs_spec_helper/module_spec_helper'
2+
#require 'shared_examples'

spec/spec_helper_acceptance.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
require 'beaker-rspec'
2+
require 'beaker/puppet_install_helper'
3+
4+
run_puppet_install_helper

0 commit comments

Comments
 (0)