Skip to content

Commit

Permalink
Merge pull request #437 from bastelfreak/tests
Browse files Browse the repository at this point in the history
Fix broken testmatrix due to gem updates
  • Loading branch information
solarkennedy committed Oct 2, 2018
2 parents b8da49a + c2e024e commit c1f2d75
Show file tree
Hide file tree
Showing 16 changed files with 1,477 additions and 1,538 deletions.
1 change: 1 addition & 0 deletions .rspec_parallel
@@ -0,0 +1 @@
--format progress
21 changes: 12 additions & 9 deletions .travis.yml
Expand Up @@ -9,42 +9,45 @@ matrix:
include:
- rvm: 2.1.9
env: PUPPET_VERSION="~> 4.0" CHECK=test PARALLEL_TEST_PROCESSORS=12
- rvm: 2.4.3
bundler_args: --without development
- rvm: 2.4.4
env: PUPPET_VERSION="~> 5.0" CHECK=test
- rvm: 2.5.0
bundler_args: --without development
- rvm: 2.5.1
env: PUPPET_VERSION="~> 5.0" CHECK=test
bundler_args: --without development
- rvm: 2.5.1
dist: trusty
env: BEAKER_PUPPET_COLLECTION=puppet5 PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_setfile=debian8-64{hypervisor=docker} CHECK=beaker
env: BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_setfile=debian8-64{hypervisor=docker} CHECK=beaker
services: docker
sudo: required
- rvm: 2.5.1
dist: trusty
env: BEAKER_PUPPET_COLLECTION=puppet5 PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_setfile=debian9-64{hypervisor=docker} CHECK=beaker
env: BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_setfile=debian9-64{hypervisor=docker} CHECK=beaker
services: docker
sudo: required
- rvm: 2.5.1
dist: trusty
env: BEAKER_PUPPET_COLLECTION=puppet5 PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_setfile=ubuntu1404-64{hypervisor=docker} CHECK=beaker
env: BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_setfile=ubuntu1404-64{hypervisor=docker} CHECK=beaker
services: docker
sudo: required
- rvm: 2.5.1
dist: trusty
env: BEAKER_PUPPET_COLLECTION=puppet5 PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_setfile=ubuntu1604-64{hypervisor=docker} CHECK=beaker
env: BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_setfile=ubuntu1604-64{hypervisor=docker} CHECK=beaker
services: docker
sudo: required
- rvm: 2.5.1
dist: trusty
env: BEAKER_PUPPET_COLLECTION=puppet5 PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_setfile=ubuntu1804-64{hypervisor=docker} CHECK=beaker
env: BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_setfile=ubuntu1804-64{hypervisor=docker} CHECK=beaker
services: docker
sudo: required
- rvm: 2.5.1
dist: trusty
env: BEAKER_PUPPET_COLLECTION=puppet5 PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_setfile=centos7-64{hypervisor=docker} CHECK=beaker
env: BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_setfile=centos7-64{hypervisor=docker} CHECK=beaker
services: docker
sudo: required
- rvm: 2.5.1
dist: trusty
env: BEAKER_PUPPET_COLLECTION=puppet5 PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_setfile=centos6-64{hypervisor=docker} CHECK=beaker
env: BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_setfile=centos6-64{hypervisor=docker} CHECK=beaker
services: docker
sudo: required
10 changes: 5 additions & 5 deletions Gemfile
Expand Up @@ -6,17 +6,15 @@ group :development do
gem "beaker-puppet_install_helper"
gem "beaker-module_install_helper"
gem "beaker-hostgenerator"
gem "beaker-docker"
gem "beaker-puppet"
gem "pry"
gem "serverspec"
gem "vagrant-wrapper"
gem "fog-openstack", "0.1.25" if RUBY_VERSION < '2.2.2'
end

group :test do
# Pin for 1.9.3 compatibility for now
gem "json", '~> 1.8.3'
gem "json_pure", '~> 1.8.3'

gem "rake"
gem "puppet", ENV['PUPPET_VERSION'] || '~> 5.0'
gem "puppet-lint"
Expand All @@ -28,8 +26,10 @@ group :test do
gem "puppet-syntax"
gem "puppetlabs_spec_helper"
gem "hiera"
gem "webmock", "~> 2.3.0"
gem "webmock", ">= 2.3.0"
gem "public_suffix"
gem 'rspec-puppet-facts'
gem "parallel_tests"
end

group :release do
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Expand Up @@ -37,7 +37,7 @@ desc "Run syntax, lint, and spec tests."
task :test => [
:syntax,
:lint,
:spec,
:parallel_spec,
]

begin
Expand Down
94 changes: 30 additions & 64 deletions manifests/params.pp
Expand Up @@ -36,25 +36,25 @@
$version = '0.7.4'
$watches = {}

case $::architecture {
case $facts['architecture'] {
'x86_64', 'x64', 'amd64': { $arch = 'amd64' }
'i386': { $arch = '386' }
'aarch64': { $arch = 'arm64' }
/^arm.*/: { $arch = 'arm' }
default: {
fail("Unsupported kernel architecture: ${::architecture}")
fail("Unsupported kernel architecture: ${facts['architecture']}")
}
}

$config_dir = $::osfamily ? {
$config_dir = $facts['os']['family'] ? {
'FreeBSD' => '/usr/local/etc/consul.d',
'windows' => 'c:/Consul/config',
default => '/etc/consul'
}

$os = downcase($::kernel)
$os = downcase($facts['kernel'])

case $::operatingsystem {
case $facts['os']['name'] {
'windows': {
$binary_group = 'Administrators'
$binary_mode = '0755'
Expand All @@ -70,70 +70,36 @@
}
}

if $::operatingsystem == 'Ubuntu' {
$shell = '/usr/sbin/nologin'
if versioncmp($::operatingsystemrelease, '8.04') < 1 {
$init_style = 'debian'
} elsif versioncmp($::operatingsystemrelease, '15.04') < 0 {
$init_style = 'upstart'
} else {
$init_style = 'systemd'
case $facts['os']['name'] {
'Ubuntu': {
$shell = '/usr/sbin/nologin'
}
} elsif $::osfamily == 'RedHat' {
$shell = '/sbin/nologin'
case $::operatingsystem {
'Fedora': {
if versioncmp($::operatingsystemrelease, '12') < 0 {
$init_style = 'init'
} else {
$init_style = 'systemd'
}
}
'Amazon': {
if versioncmp($::operatingsystemrelease, '2010') < 0{
$init_style = 'systemd'
} else {
$init_style = 'redhat'
}
}
default: {
if versioncmp($::operatingsystemrelease, '7.0') < 0 {
$init_style = 'redhat'
} else {
$init_style = 'systemd'
}
}
'RedHat': {
$shell = '/sbin/nologin'
}
} elsif $::operatingsystem == 'Debian' {
$shell = '/usr/sbin/nologin'
if versioncmp($::operatingsystemrelease, '8.0') < 0 {
$init_style = 'debian'
} else {
$init_style = 'systemd'
'Debian': {
$shell = '/usr/sbin/nologin'
}
} elsif $::operatingsystem == 'Archlinux' {
$shell = '/sbin/nologin'
$init_style = 'systemd'
} elsif $::operatingsystem == 'OpenSuSE' {
$shell = '/usr/sbin/nologin'
$init_style = 'systemd'
} elsif $::operatingsystem =~ /SLE[SD]/ {
$shell = '/usr/sbin/nologin'
if versioncmp($::operatingsystemrelease, '12.0') < 0 {
$init_style = 'sles'
} else {
$init_style = 'systemd'
'Archlinux': {
$shell = '/sbin/nologin'
}
} elsif $::operatingsystem == 'Darwin' {
$shell = undef
$init_style = 'launchd'
} elsif $::operatingsystem == 'FreeBSD' {
$init_style = 'freebsd'
$shell = '/usr/sbin/nologin'
} elsif $::operatingsystem == 'windows' {
'OpenSuSE': {
$shell = '/usr/sbin/nologin'
}
/SLE[SD]/: {
$shell = '/usr/sbin/nologin'
}
default: {
$shell = undef
}
}

if $facts['operatingsystem'] == 'windows' {
$init_style = 'unmanaged'
$shell = undef
} else {
fail('Cannot determine init_style, unsupported OS')
$init_style = $facts['service_provider'] ? {
undef => 'systemd',
default => $facts['service_provider']
}
}
}
28 changes: 14 additions & 14 deletions metadata.json
Expand Up @@ -46,33 +46,33 @@
{
"operatingsystem": "RedHat",
"operatingsystemrelease": [
"5.0",
"6.0",
"7.0"
"5",
"6",
"7"
]
},
{
"operatingsystem": "CentOS",
"operatingsystemrelease": [
"5.0",
"6.0",
"7.0"
"5",
"6",
"7"
]
},
{
"operatingsystem": "Scientific Linux",
"operatingsystem": "Scientific",
"operatingsystemrelease": [
"5.0",
"6.0",
"7.0"
"5",
"6",
"7"
]
},
{
"operatingsystem": "Oracle Linux",
"operatingsystem": "OracleLinux",
"operatingsystemrelease": [
"5.0",
"6.0",
"7.0"
"5",
"6",
"7"
]
},
{
Expand Down
1 change: 0 additions & 1 deletion spec/classes/coverage_spec.rb

This file was deleted.

0 comments on commit c1f2d75

Please sign in to comment.