diff --git a/.travis.yml b/.travis.yml index b610946..53f00f3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,3 +23,4 @@ matrix: dist: trusty bundler_args: script: bundle exec rake validate +# disabled acceptances testing due to travis limitations diff --git a/Gemfile b/Gemfile index be325d9..93c71a5 100644 --- a/Gemfile +++ b/Gemfile @@ -7,11 +7,10 @@ gem 'puppet-lint', '>= 0.3.2' gem 'facter', '>= 1.7.0' group :system_tests do - gem 'beaker', :require => false - gem 'beaker-rspec', :require => false - gem 'beaker_spec_helper', :require => false - gem 'beaker-puppet_install_helper', :require => false - gem 'serverspec', :require => false + gem 'beaker', '~>3.13', :require => false + gem 'beaker-rspec', '> 5', :require => false + gem 'beaker_spec_helper', :require => false + gem 'serverspec', :require => false gem 'rspec', '< 3.2', :require => false if RUBY_VERSION =~ /^1\.8/ gem 'rspec-puppet', :require => false gem 'metadata-json-lint', :require => false diff --git a/Rakefile b/Rakefile index 0596969..1ece62a 100644 --- a/Rakefile +++ b/Rakefile @@ -1,8 +1,11 @@ -require 'rubygems' require 'puppetlabs_spec_helper/rake_tasks' require 'puppet-lint/tasks/puppet-lint' require 'metadata-json-lint/rake_task' PuppetLint.configuration.send('disable_80chars') +PuppetLint.configuration.send('disable_140chars') +PuppetLint.configuration.send('disable_documentation') +PuppetLint.configuration.send('disable_arrow_on_right_operand_line') +PuppetLint.configuration.send('disable_class_inherits_from_params_class') PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp"] desc "Validate manifests, templates, and ruby files" @@ -17,5 +20,3 @@ task :validate do sh "erb -P -x -T '-' #{template} | ruby -c" end end -PuppetLint.configuration.send('disable_class_inherits_from_params_class') -PuppetLint.configuration.send('disable_documentation') diff --git a/manifests/init.pp b/manifests/init.pp index bb95f25..9f9009a 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -34,14 +34,16 @@ name => $resolvconf::params::glibcheaders, } - $fact_eyp_resolvconf_maxns = getvar('::eyp_resolvconf_maxns') + # Error: Evaluation Error: Comparison of: Integer > String, is not possible. Caused by 'A Numeric is not comparable to non Numeric' - if ( ($fact_eyp_resolvconf_maxns != undef) and ($resolverlistsize > $fact_eyp_resolvconf_maxns) ) - { - notify { 'resolvconf limits': - message => "more resolvers configured (${resolverlistsize}) that system's limit (${fact_eyp_resolvconf_maxns})" - } - } + # $fact_eyp_resolvconf_maxns = getvar('::eyp_resolvconf_maxns') + # + # if ( ($fact_eyp_resolvconf_maxns != undef) and ($resolverlistsize > $fact_eyp_resolvconf_maxns) ) + # { + # notify { 'resolvconf limits': + # message => "more resolvers configured (${resolverlistsize}) that system's limit (${fact_eyp_resolvconf_maxns})" + # } + # } if ($disableimmutable) { diff --git a/spec/acceptance/nodesets/centos5-docker.yml b/spec/acceptance/nodesets/centos5-docker.yml index 821f5a6..7fdc608 100644 --- a/spec/acceptance/nodesets/centos5-docker.yml +++ b/spec/acceptance/nodesets/centos5-docker.yml @@ -10,7 +10,11 @@ HOSTS: docker_cmd: '["/sbin/init"]' docker_image_commands: - 'rm -rf /var/run/network/*' + - 'yum clean all' - 'yum install -y gcc make crontabs tar wget java-1.7.0-openjdk java-1.7.0-openjdk-devel' + - 'wget https://yum.puppetlabs.com/RPM-GPG-KEY-puppetlabs -O /tmp/RPM-GPG-KEY-puppetlabs' + - 'rpm --import /tmp/RPM-GPG-KEY-puppetlabs' + - 'rpm --replacepkgs -ivh http://yum.puppetlabs.com/puppetlabs-release-el-5.noarch.rpm' CONFIG: type: foss log_level: debug diff --git a/spec/acceptance/nodesets/centos7-docker.yml b/spec/acceptance/nodesets/centos7-docker.yml index e99b37c..12c44a6 100644 --- a/spec/acceptance/nodesets/centos7-docker.yml +++ b/spec/acceptance/nodesets/centos7-docker.yml @@ -10,7 +10,7 @@ HOSTS: docker_cmd: '["/usr/sbin/init"]' docker_image_commands: - 'rm -rf /var/run/network/*' - - 'yum install -y gcc make crontabs tar wget iproute java-1.7.0-openjdk java-1.7.0-openjdk-devel' + - 'yum install -y openssl openssl-devel gcc make crontabs tar wget iproute java-1.7.0-openjdk java-1.7.0-openjdk-devel' CONFIG: type: foss log_level: debug diff --git a/spec/acceptance/nodesets/ubuntu16-docker.yml b/spec/acceptance/nodesets/ubuntu16-docker.yml new file mode 100644 index 0000000..67a3f61 --- /dev/null +++ b/spec/acceptance/nodesets/ubuntu16-docker.yml @@ -0,0 +1,15 @@ +HOSTS: + ubuntu-1604-x64: + default_apply_opts: + order: random + strict_variables: + platform: ubuntu-16.04-amd64 + hypervisor : docker + image: ubuntu:16.04 + docker_cmd: '["/sbin/init"]' + docker_preserve_image: true + docker_image_commands: + - 'apt-get install net-tools gcc make tar wget -y' +CONFIG: + type: foss + log_level: debug diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb index 01a0bae..dd05d93 100644 --- a/spec/spec_helper_acceptance.rb +++ b/spec/spec_helper_acceptance.rb @@ -1,32 +1,10 @@ require 'beaker-rspec' -require 'beaker_spec_helper' -include BeakerSpecHelper - -hosts.each do |host| - - if host['platform'] =~ /^ubuntu-(15.04|15.10)-/ - on host, "wget -O /tmp/puppet.deb http://apt.puppetlabs.com/puppetlabs-release-pc1-trusty.deb" - on host, "dpkg -i --force-all /tmp/puppet.deb" - on host, "apt-get update" - host.install_package('puppet-agent') - else - install_puppet_agent_on host, {} - end - - # Install git so that we can install modules from github - if host['platform'] =~ /^el-5-/ - # git is only available on EPEL for el-5 - install_package host, 'epel-release' - end - install_package host, 'git' - - on host, "puppet cert generate $(facter fqdn)" -end +install_puppet_agent_on hosts, {} RSpec.configure do |c| - # Project root - proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..')) + module_root = File.expand_path(File.join(File.dirname(__FILE__), '..')) + module_name = module_root.split('-').last # Readable test descriptions c.formatter = :documentation @@ -34,10 +12,10 @@ # Configure all nodes in nodeset c.before :suite do # Install module and dependencies - puppet_module_install(:source => proj_root, :module_name => 'resolvconf') + puppet_module_install(:source => module_root, :module_name => module_name) hosts.each do |host| - # dependencies on host, puppet('module', 'install', 'puppetlabs-stdlib'), { :acceptable_exit_codes => [0,1] } + on host, puppet('module', 'install', 'puppetlabs-concat'), { :acceptable_exit_codes => [0,1] } on host, puppet('module', 'install', 'eyp-eyplib'), { :acceptable_exit_codes => [0,1] } end end