aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabien COMBERNOUS <Dan33l@users.noreply.github.com>2019-09-09 17:25:11 +0200
committerGitHub <noreply@github.com>2019-09-09 17:25:11 +0200
commit81748ba786c6a55c4575a400c08de99716da8fbb (patch)
tree8cc5198a4e729299607e3a05533bf504054446e5
parent2900940d7c07b4ec7aeeb3f3977ba21d548737b0 (diff)
parent2fc602af79b0b18fef1fab4a34134741ff35e10f (diff)
downloadpuppet-ferm-81748ba786c6a55c4575a400c08de99716da8fbb.tar.gz
puppet-ferm-81748ba786c6a55c4575a400c08de99716da8fbb.tar.bz2
Merge pull request #59 from Dan33l/enable_acceptance
enable acceptance and drop EOL ubuntu1404
-rw-r--r--.sync.yml5
-rw-r--r--.travis.yml32
-rw-r--r--metadata.json1
-rw-r--r--spec/acceptance/ferm_spec.rb60
-rw-r--r--spec/spec_helper_acceptance.rb22
5 files changed, 119 insertions, 1 deletions
diff --git a/.sync.yml b/.sync.yml
index bdf750e..9be4265 100644
--- a/.sync.yml
+++ b/.sync.yml
@@ -1,4 +1,9 @@
---
.travis.yml:
+ docker_sets:
+ - set: centos7-64
+ - set: centos6-64
+ - set: ubuntu1604-64
+ - set: ubuntu1804-64
secure: "J7AG0AHVdEVql4c7cwJZCjbXFp5tehPnlS3REkUKu9s3Px+XRb+073W7hM2alfxB5Qo3mqyMdgyjIRMQyXXqfb54QmDG6Y1XfRIcNK/C6TL9JscC7rXN1gXJhrdZiQOtfXa3HFcWJkbsQrjnPbQ5y+
b5VdkzIthLkIa4IpQEYSQC5i88nDixF8dgApLGgC0CcmS+14iXZgJ2T89A7QiSbvhnIsszaIQucw91/Kled9mUT2cJlFrMXLfd3hycR/ftLJeBe6MvnlaflSqEWfz9UA7EW63JX13hhyNNaf26JsFyG7P7UiH6+dBGXX3xLPKeq032VysZzbmA1GFZYiGk0obAtqMlrfbcpsLceyg1FCku2/lv/6P9dkfjN0N0z7pgL0lGjjhN3lNwU997fIXq/tt3dxbXKFV2Ok16p/55VjV5i2U79bNTn6oZpqLzB6ZEc9WOb3DvBsLP5ooThSVtrZecTFZbjRFAT/Vd0nd/qIzdxEoaVVaSPOpaZf6v1Ojy3RMzSSOUdweDBNh0B+9p0tVDpiLhRYpAFbw1JH2X0dlPqtrKS+BNU8xwktfK5KGpvvfXdU+pWUKxP1MnzrmX5jDX3dIh7pkGRvaKSD5RTmufCVaR0neEBV3VERPPYLDKueGc3BgWtVqaEyZwuM5AMJJuWKkTIQsUPsXKbIqyP5c="
diff --git a/.travis.yml b/.travis.yml
index a987212..2b41c68 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -23,6 +23,38 @@ matrix:
- rvm: 2.4.4
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 5.0" CHECK=build DEPLOY_TO_FORGE=yes
+ - rvm: 2.5.3
+ bundler_args: --without development release
+ env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=centos6-64 BEAKER_HYPERVISOR=docker CHECK=beaker
+ services: docker
+ - rvm: 2.5.3
+ bundler_args: --without development release
+ env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=centos6-64 BEAKER_HYPERVISOR=docker CHECK=beaker
+ services: docker
+ - rvm: 2.5.3
+ bundler_args: --without development release
+ env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=centos7-64 BEAKER_HYPERVISOR=docker CHECK=beaker
+ services: docker
+ - rvm: 2.5.3
+ bundler_args: --without development release
+ env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=centos7-64 BEAKER_HYPERVISOR=docker CHECK=beaker
+ services: docker
+ - rvm: 2.5.3
+ bundler_args: --without development release
+ env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=ubuntu1604-64 BEAKER_HYPERVISOR=docker CHECK=beaker
+ services: docker
+ - rvm: 2.5.3
+ bundler_args: --without development release
+ env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=ubuntu1604-64 BEAKER_HYPERVISOR=docker CHECK=beaker
+ services: docker
+ - rvm: 2.5.3
+ bundler_args: --without development release
+ env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=ubuntu1804-64 BEAKER_HYPERVISOR=docker CHECK=beaker
+ services: docker
+ - rvm: 2.5.3
+ bundler_args: --without development release
+ env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=ubuntu1804-64 BEAKER_HYPERVISOR=docker CHECK=beaker
+ services: docker
branches:
only:
- master
diff --git a/metadata.json b/metadata.json
index 7cfb388..6d90a53 100644
--- a/metadata.json
+++ b/metadata.json
@@ -35,7 +35,6 @@
{
"operatingsystem": "Ubuntu",
"operatingsystemrelease": [
- "14.04",
"16.04",
"18.04"
]
diff --git a/spec/acceptance/ferm_spec.rb b/spec/acceptance/ferm_spec.rb
new file mode 100644
index 0000000..1b0f794
--- /dev/null
+++ b/spec/acceptance/ferm_spec.rb
@@ -0,0 +1,60 @@
+require 'spec_helper_acceptance'
+
+os_name = fact('os.name')
+os_release = fact('os.release.major')
+
+sut_os = "#{os_name}-#{os_release}"
+
+manage_initfile = case sut_os
+ when 'CentOS-6'
+ true
+ else
+ false
+ end
+
+describe 'ferm' do
+ context 'with basics settings' do
+ pp = %(
+ class { 'ferm':
+ manage_service => true,
+ manage_configfile => true,
+ manage_initfile => #{manage_initfile}, # CentOS-6 does not provide init script
+ forward_policy => 'DROP',
+ output_policy => 'DROP',
+ input_policy => 'DROP',
+ rules => {
+ 'allow acceptance_tests' => {
+ chain => 'INPUT',
+ policy => 'ACCEPT',
+ proto => tcp,
+ dport => 22,
+ },
+ },
+ ip_versions => ['ip'], #only ipv4 available with CI
+ }
+ )
+
+ it 'works with no error' do
+ apply_manifest(pp, catch_failures: true)
+ end
+ it 'works idempotently' do
+ apply_manifest(pp, catch_changes: true)
+ end
+
+ describe package('ferm') do
+ it { is_expected.to be_installed }
+ end
+
+ describe service('ferm') do
+ it { is_expected.to be_running }
+ end
+
+ describe command('iptables-save') do
+ its(:stdout) { is_expected.to match %r{.*filter.*:INPUT DROP.*:FORWARD DROP.*:OUTPUT DROP.*}m }
+ end
+
+ describe iptables do
+ it { is_expected.to have_rule('-A INPUT -p tcp -m comment --comment "allow acceptance_tests" -m tcp --dport 22 -j ACCEPT').with_table('filter').with_chain('INPUT') }
+ end
+ end
+end
diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb
new file mode 100644
index 0000000..50dadbe
--- /dev/null
+++ b/spec/spec_helper_acceptance.rb
@@ -0,0 +1,22 @@
+require 'beaker-rspec'
+require 'beaker-puppet'
+require 'beaker/puppet_install_helper'
+require 'beaker/module_install_helper'
+
+run_puppet_install_helper unless ENV['BEAKER_provision'] == 'no'
+install_module
+install_module_dependencies
+
+RSpec.configure do |c|
+ # Configure all nodes in nodeset
+ c.before :suite do
+ # ferm is into epel with RedHat like OSes
+ install_module_from_forge('stahnma-epel', '>= 1.3.1 < 2.0.0') if fact('os.family') == 'RedHat'
+
+ pp = %(
+ include epel
+ )
+
+ apply_manifest(pp, catch_failures: true) if fact('os.family') == 'RedHat'
+ end
+end