From fc3fd5dd6f63d156309efadc612ef10c09e52d03 Mon Sep 17 00:00:00 2001 From: Eric Renfro Date: Mon, 6 Feb 2017 00:53:17 -0500 Subject: [PATCH] kitchen-qemu, inspec, removed yum cookbook --- .kitchen.docker.yml | 21 +++++ .kitchen.yml | 15 ++-- Berksfile | 3 +- Gemfile | 8 ++ chefignore | 94 ++++++++++++++++++++++ metadata.rb | 11 +-- test/integration/default/inspec/default.rb | 7 ++ 7 files changed, 146 insertions(+), 13 deletions(-) create mode 100644 .kitchen.docker.yml create mode 100644 Gemfile create mode 100644 test/integration/default/inspec/default.rb diff --git a/.kitchen.docker.yml b/.kitchen.docker.yml new file mode 100644 index 0000000..20b1694 --- /dev/null +++ b/.kitchen.docker.yml @@ -0,0 +1,21 @@ +--- +driver: + name: docker + +provisioner: + name: chef_zero + +platforms: + - name: centos-7.2 + driver_config: + image: centos:7.2.1511 + platform: rhel + require_chef_omnibus: 12.16.42 + use_sudo: false + hostname: integration.test.test + +suites: + - name: default + run_list: + - recipe[yum-zabbix::default] + attributes: diff --git a/.kitchen.yml b/.kitchen.yml index 20b1694..eee6f15 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -1,21 +1,24 @@ --- driver: - name: docker + name: qemu + +verifier: + name: inspec provisioner: name: chef_zero platforms: - - name: centos-7.2 + - name: centos-7.3 driver_config: - image: centos:7.2.1511 + image: centos-7.3-chef.qcow2 platform: rhel - require_chef_omnibus: 12.16.42 - use_sudo: false - hostname: integration.test.test + vm_hostname: integration.centos.test + require_chef_omnibus: false suites: - name: default run_list: - recipe[yum-zabbix::default] attributes: + diff --git a/Berksfile b/Berksfile index db75d7b..e9cf30e 100644 --- a/Berksfile +++ b/Berksfile @@ -2,6 +2,5 @@ source "https://supermarket.chef.io" metadata -cookbook "yum", "~> 3.10.0" -cookbook "yum-epel", "~> 0.6.6" +cookbook "yum-epel", ">= 2.1.1" diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..72ebc9b --- /dev/null +++ b/Gemfile @@ -0,0 +1,8 @@ +source 'https://rubygems.org' + +group ":integration" do + gem "chefspec", '>= 3.1' + gem "berkshelf", '>= 5.2.0' + gem 'kitchen-qemu' +end + diff --git a/chefignore b/chefignore index 7be3c6d..e56b2d9 100644 --- a/chefignore +++ b/chefignore @@ -1 +1,95 @@ +# Put files/directories that should be ignored in this file when uploading +# or sharing to the community site. +# Lines that start with '# ' are comments. + +# OS generated files # +###################### +.DS_Store +Icon? +nohup.out +ehthumbs.db +Thumbs.db + +# SASS # +######## +.sass-cache + +# EDITORS # +########### +\#* +.#* +*~ +*.sw[a-z] +*.bak +REVISION +TAGS* +tmtags +*_flymake.* +*_flymake +*.tmproj +.project +.settings +mkmf.log + +## COMPILED ## +############## +a.out +*.o +*.pyc +*.so +*.com +*.class +*.dll +*.exe +*/rdoc/ + +# Testing # +########### +.watchr +.rspec +spec/* +spec/fixtures/* +test/* +features/* +Guardfile +Procfile + +# SCM # +####### +.git +*/.git +.gitignore +.gitmodules +.gitconfig +.gitattributes +.svn +*/.bzr/* +*/.hg/* +*/.svn/* + +# Berkshelf # +############# +cookbooks/* +tmp .kitchen + +# Cookbooks # +############# +CONTRIBUTING +CHANGELOG* + +# Strainer # +############ +Colanderfile +Strainerfile +.colander +.strainer + +# Vagrant # +########### +.vagrant +Vagrantfile + +# Travis # +########## +.travis.yml diff --git a/metadata.rb b/metadata.rb index 8ecb21f..271e135 100644 --- a/metadata.rb +++ b/metadata.rb @@ -2,16 +2,17 @@ name 'yum-zabbix' maintainer 'Eric Renfro' maintainer_email 'psi-jack@linux-help.org' license 'Apache 2.0' -description 'Installs and configures the NUX Community Desktop Yum Repository' +description 'Installs and configures the Zabbix Yum Repository' long_description '' -version '0.1.3' +version '1.0.0' issues_url 'https://git.linux-help.org/Linux-Help/cookbook-yum-zabbix/issues' source_url 'https://git.linux-help.org/Linux-Help/cookbook-yum-zabbix' %w{ centos redhat oracle scientific }.each do |os| - supports os, '>= 5.0.0' + supports os, '>= 6.0.0' end -depends 'yum', '>= 3.2' -depends 'yum-epel', '>= 0.0.0' +depends 'yum-epel', '>= 2.1.1' + +chef_version '>= 12.1' diff --git a/test/integration/default/inspec/default.rb b/test/integration/default/inspec/default.rb new file mode 100644 index 0000000..5114ab5 --- /dev/null +++ b/test/integration/default/inspec/default.rb @@ -0,0 +1,7 @@ +title "YUM Zabbix Repository" + +describe yum.repo('zabbix') do + it { should exist } + it { should be_enabled } +end +