From 11094fd932d8e6847994078505c267fd1f7222f8 Mon Sep 17 00:00:00 2001 From: Alessandro Franceschi Date: Tue, 24 Sep 2024 19:46:38 +0200 Subject: [PATCH] pdk convert + tests --- .puppet-lint.rc | 2 -- .sync.yml | 8 ++++++++ CHANGELOG.md | 11 +++++++++++ data/common.yaml | 1 + hiera.yaml | 21 ++++++++++++++++++++ manifests/check.pp | 2 +- manifests/configure.pp | 2 +- manifests/deploy.pp | 2 +- manifests/initialize.pp | 2 +- manifests/project.pp | 2 +- manifests/project/archive.pp | 2 +- manifests/project/builder.pp | 2 +- manifests/project/dir.pp | 2 +- manifests/project/files.pp | 2 +- manifests/project/git.pp | 2 +- manifests/project/hg.pp | 2 +- manifests/project/maven.pp | 2 +- manifests/project/mysql.pp | 2 +- manifests/project/service.pp | 2 +- manifests/project/svn.pp | 2 +- manifests/project/tar.pp | 2 +- manifests/project/war.pp | 2 +- manifests/project/y4maven.pp | 2 +- manifests/project/yum.pp | 2 +- manifests/report.pp | 2 +- manifests/rollback.pp | 2 +- spec/classes/dependencies_spec.rb | 13 +++++++++++++ spec/classes/extras_spec.rb | 13 +++++++++++++ spec/classes/helpers_spec.rb | 13 +++++++++++++ spec/classes/mcollective/client_spec.rb | 13 +++++++++++++ spec/classes/mcollective/server_spec.rb | 13 +++++++++++++ spec/classes/one_spec.rb | 13 +++++++++++++ spec/classes/params_spec.rb | 13 +++++++++++++ spec/classes/puppi_spec.rb | 18 +++++++---------- spec/classes/skel_spec.rb | 13 +++++++++++++ spec/classes/two_spec.rb | 13 +++++++++++++ spec/defines/check_spec.rb | 18 +++++++++++++++++ spec/defines/configure_spec.rb | 18 +++++++++++++++++ spec/defines/deploy_spec.rb | 18 +++++++++++++++++ spec/defines/helper_spec.rb | 18 +++++++++++++++++ spec/defines/info/instance_spec.rb | 18 +++++++++++++++++ spec/defines/info/module_spec.rb | 18 +++++++++++++++++ spec/defines/info/readme_spec.rb | 18 +++++++++++++++++ spec/defines/info_spec.rb | 18 +++++++++++++++++ spec/defines/initialize_spec.rb | 18 +++++++++++++++++ spec/defines/install_packages_spec.rb | 18 +++++++++++++++++ spec/defines/log_spec.rb | 18 +++++++++++++++++ spec/defines/netinstall_spec.rb | 18 +++++++++++++++++ spec/defines/project/archive_spec.rb | 18 +++++++++++++++++ spec/defines/project/builder_spec.rb | 18 +++++++++++++++++ spec/defines/project/dir_spec.rb | 18 +++++++++++++++++ spec/defines/project/files_spec.rb | 18 +++++++++++++++++ spec/defines/project/git_spec.rb | 18 +++++++++++++++++ spec/defines/project/hg_spec.rb | 18 +++++++++++++++++ spec/defines/project/maven_spec.rb | 18 +++++++++++++++++ spec/defines/project/mysql_spec.rb | 18 +++++++++++++++++ spec/defines/project/service_spec.rb | 18 +++++++++++++++++ spec/defines/project/svn_spec.rb | 18 +++++++++++++++++ spec/defines/project/tar_spec.rb | 18 +++++++++++++++++ spec/defines/project/war_spec.rb | 18 +++++++++++++++++ spec/defines/project/y4maven_spec.rb | 18 +++++++++++++++++ spec/defines/project/yum_spec.rb | 18 +++++++++++++++++ spec/defines/project_spec.rb | 18 +++++++++++++++++ spec/defines/puppi_check_spec.rb | 26 ------------------------- spec/defines/puppi_deploy_spec.rb | 25 ------------------------ spec/defines/puppi_helper_spec.rb | 20 ------------------- spec/defines/puppi_info_spec.rb | 24 ----------------------- spec/defines/puppi_initialize_spec.rb | 25 ------------------------ spec/defines/puppi_log_spec.rb | 22 --------------------- spec/defines/puppi_project_spec.rb | 25 ------------------------ spec/defines/puppi_report_spec.rb | 25 ------------------------ spec/defines/puppi_rollback_spec.rb | 25 ------------------------ spec/defines/puppi_run_spec.rb | 17 ---------------- spec/defines/puppi_todo_spec.rb | 24 ----------------------- spec/defines/puppi_ze_spec.rb | 20 ------------------- spec/defines/report_spec.rb | 18 +++++++++++++++++ spec/defines/rollback_spec.rb | 18 +++++++++++++++++ spec/defines/run_spec.rb | 18 +++++++++++++++++ spec/defines/runscript_spec.rb | 18 +++++++++++++++++ spec/defines/todo_spec.rb | 18 +++++++++++++++++ spec/defines/ze_spec.rb | 18 +++++++++++++++++ 81 files changed, 780 insertions(+), 312 deletions(-) create mode 100644 .sync.yml create mode 100644 CHANGELOG.md create mode 100644 data/common.yaml create mode 100644 hiera.yaml create mode 100644 spec/classes/dependencies_spec.rb create mode 100644 spec/classes/extras_spec.rb create mode 100644 spec/classes/helpers_spec.rb create mode 100644 spec/classes/mcollective/client_spec.rb create mode 100644 spec/classes/mcollective/server_spec.rb create mode 100644 spec/classes/one_spec.rb create mode 100644 spec/classes/params_spec.rb create mode 100644 spec/classes/skel_spec.rb create mode 100644 spec/classes/two_spec.rb create mode 100644 spec/defines/check_spec.rb create mode 100644 spec/defines/configure_spec.rb create mode 100644 spec/defines/deploy_spec.rb create mode 100644 spec/defines/helper_spec.rb create mode 100644 spec/defines/info/instance_spec.rb create mode 100644 spec/defines/info/module_spec.rb create mode 100644 spec/defines/info/readme_spec.rb create mode 100644 spec/defines/info_spec.rb create mode 100644 spec/defines/initialize_spec.rb create mode 100644 spec/defines/install_packages_spec.rb create mode 100644 spec/defines/log_spec.rb create mode 100644 spec/defines/netinstall_spec.rb create mode 100644 spec/defines/project/archive_spec.rb create mode 100644 spec/defines/project/builder_spec.rb create mode 100644 spec/defines/project/dir_spec.rb create mode 100644 spec/defines/project/files_spec.rb create mode 100644 spec/defines/project/git_spec.rb create mode 100644 spec/defines/project/hg_spec.rb create mode 100644 spec/defines/project/maven_spec.rb create mode 100644 spec/defines/project/mysql_spec.rb create mode 100644 spec/defines/project/service_spec.rb create mode 100644 spec/defines/project/svn_spec.rb create mode 100644 spec/defines/project/tar_spec.rb create mode 100644 spec/defines/project/war_spec.rb create mode 100644 spec/defines/project/y4maven_spec.rb create mode 100644 spec/defines/project/yum_spec.rb create mode 100644 spec/defines/project_spec.rb delete mode 100644 spec/defines/puppi_check_spec.rb delete mode 100644 spec/defines/puppi_deploy_spec.rb delete mode 100644 spec/defines/puppi_helper_spec.rb delete mode 100644 spec/defines/puppi_info_spec.rb delete mode 100644 spec/defines/puppi_initialize_spec.rb delete mode 100644 spec/defines/puppi_log_spec.rb delete mode 100644 spec/defines/puppi_project_spec.rb delete mode 100644 spec/defines/puppi_report_spec.rb delete mode 100644 spec/defines/puppi_rollback_spec.rb delete mode 100644 spec/defines/puppi_run_spec.rb delete mode 100644 spec/defines/puppi_todo_spec.rb delete mode 100644 spec/defines/puppi_ze_spec.rb create mode 100644 spec/defines/report_spec.rb create mode 100644 spec/defines/rollback_spec.rb create mode 100644 spec/defines/run_spec.rb create mode 100644 spec/defines/runscript_spec.rb create mode 100644 spec/defines/todo_spec.rb create mode 100644 spec/defines/ze_spec.rb diff --git a/.puppet-lint.rc b/.puppet-lint.rc index 15a070c..cc96ece 100644 --- a/.puppet-lint.rc +++ b/.puppet-lint.rc @@ -1,3 +1 @@ --relative ---no-parameter_documentation ---no-params_empty_string \ No newline at end of file diff --git a/.sync.yml b/.sync.yml new file mode 100644 index 0000000..8c2c98e --- /dev/null +++ b/.sync.yml @@ -0,0 +1,8 @@ +# This file can be used to customize the files managed by PDK. +# +# See https://github.com/puppetlabs/pdk-templates/blob/main/README.md +# for more information. +# +# See https://github.com/puppetlabs/pdk-templates/blob/main/config_defaults.yml +# for the default values. +--- {} diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..9e5c7de --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,11 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +## Release 3.0.0 + +**Features** + +**Bugfixes** + +**Known Issues** diff --git a/data/common.yaml b/data/common.yaml new file mode 100644 index 0000000..2fbf0ff --- /dev/null +++ b/data/common.yaml @@ -0,0 +1 @@ +--- {} diff --git a/hiera.yaml b/hiera.yaml new file mode 100644 index 0000000..545fff3 --- /dev/null +++ b/hiera.yaml @@ -0,0 +1,21 @@ +--- +version: 5 + +defaults: # Used for any hierarchy level that omits these keys. + datadir: data # This path is relative to hiera.yaml's directory. + data_hash: yaml_data # Use the built-in YAML backend. + +hierarchy: + - name: "osfamily/major release" + paths: + # Used to distinguish between Debian and Ubuntu + - "os/%{facts.os.name}/%{facts.os.release.major}.yaml" + - "os/%{facts.os.family}/%{facts.os.release.major}.yaml" + # Used for Solaris + - "os/%{facts.os.family}/%{facts.kernelrelease}.yaml" + - name: "osfamily" + paths: + - "os/%{facts.os.name}.yaml" + - "os/%{facts.os.family}.yaml" + - name: 'common' + path: 'common.yaml' diff --git a/manifests/check.pp b/manifests/check.pp index 5ae3661..a127ead 100644 --- a/manifests/check.pp +++ b/manifests/check.pp @@ -18,7 +18,7 @@ String $hostwide = 'no', Variant[String,Integer] $priority = '50', String $project = 'default', - Boolean $enable = true, + Variant[Boolean,String] $enable = true, ) { require puppi require puppi::params diff --git a/manifests/configure.pp b/manifests/configure.pp index fd95f6c..77f48d4 100644 --- a/manifests/configure.pp +++ b/manifests/configure.pp @@ -19,7 +19,7 @@ String $arguments = '', Variant[String,Integer] $priority = '50', String $user = 'root', - Boolean $enable = true, + Variant[Boolean,String] $enable = true, ) { require puppi require puppi::params diff --git a/manifests/deploy.pp b/manifests/deploy.pp index 9e43f50..a7d45e5 100644 --- a/manifests/deploy.pp +++ b/manifests/deploy.pp @@ -19,7 +19,7 @@ String $arguments = '', Variant[String,Integer] $priority = '50', String $user = 'root', - Boolean $enable = true, + Variant[Boolean,String] $enable = true, ) { require puppi require puppi::params diff --git a/manifests/initialize.pp b/manifests/initialize.pp index 9fbd5c7..75e4406 100644 --- a/manifests/initialize.pp +++ b/manifests/initialize.pp @@ -17,7 +17,7 @@ String $arguments = '', Variant[String,Integer] $priority = '50', String $user = 'root', - Boolean $enable = true, + Variant[Boolean,String] $enable = true, ) { require puppi require puppi::params diff --git a/manifests/project.pp b/manifests/project.pp index 11fd869..a7638da 100644 --- a/manifests/project.pp +++ b/manifests/project.pp @@ -19,7 +19,7 @@ Optional[String] $source_baseurl = undef, String $document_root = '', Optional[String] $config_root = undef, - Boolean $enable = true, + Variant[Boolean,String] $enable = true, ) { require puppi::params diff --git a/manifests/project/archive.pp b/manifests/project/archive.pp index 73f7346..b7f4e1c 100644 --- a/manifests/project/archive.pp +++ b/manifests/project/archive.pp @@ -124,7 +124,7 @@ Boolean $run_checks = true, Boolean $always_deploy = true, Boolean $auto_deploy = false, - Boolean $enable = true, + Variant[Boolean,String] $enable = true, ) { require puppi require puppi::params diff --git a/manifests/project/builder.pp b/manifests/project/builder.pp index 544b3a4..4867b69 100644 --- a/manifests/project/builder.pp +++ b/manifests/project/builder.pp @@ -150,7 +150,7 @@ Boolean $run_checks = true, Boolean $always_deploy = true, Boolean $auto_deploy = false, - Boolean $enable = true, + Variant[Boolean,String] $enable = true, ) { require puppi require puppi::params diff --git a/manifests/project/dir.pp b/manifests/project/dir.pp index c23bc46..a840d7d 100644 --- a/manifests/project/dir.pp +++ b/manifests/project/dir.pp @@ -123,7 +123,7 @@ Boolean $run_checks = true, Boolean $skip_predeploy = false, Boolean $auto_deploy = false, - Boolean $enable = true, + Variant[Boolean,String] $enable = true, ) { require puppi require puppi::params diff --git a/manifests/project/files.pp b/manifests/project/files.pp index 52b017f..6722b33 100644 --- a/manifests/project/files.pp +++ b/manifests/project/files.pp @@ -140,7 +140,7 @@ Variant[String,Integer] $backup_retention = '5', Boolean $run_checks = true, Boolean $auto_deploy = false, - Boolean $enable = true, + Variant[Boolean,String] $enable = true, ) { require puppi require puppi::params diff --git a/manifests/project/git.pp b/manifests/project/git.pp index 74635d1..8a3fc70 100755 --- a/manifests/project/git.pp +++ b/manifests/project/git.pp @@ -151,7 +151,7 @@ Variant[String,Integer] $backup_retention = '5', Boolean $run_checks = true, Boolean $auto_deploy = false, - Boolean $enable = true, + Variant[Boolean,String] $enable = true, ) { require puppi require puppi::params diff --git a/manifests/project/hg.pp b/manifests/project/hg.pp index 4b7df6c..35a3af6 100644 --- a/manifests/project/hg.pp +++ b/manifests/project/hg.pp @@ -145,7 +145,7 @@ Variant[String,Integer] $backup_retention = '5', Boolean $run_checks = true, Boolean $auto_deploy = false, - Boolean $enable = true, + Variant[Boolean,String] $enable = true, ) { require puppi require puppi::params diff --git a/manifests/project/maven.pp b/manifests/project/maven.pp index 24a8a43..db760b1 100644 --- a/manifests/project/maven.pp +++ b/manifests/project/maven.pp @@ -215,7 +215,7 @@ Boolean $always_deploy = true, Boolean $check_deploy = true, Boolean $auto_deploy = false, - Boolean $enable = true, + Variant[Boolean,String] $enable = true, ) { require puppi require puppi::params diff --git a/manifests/project/mysql.pp b/manifests/project/mysql.pp index 138ad7d..16450ad 100644 --- a/manifests/project/mysql.pp +++ b/manifests/project/mysql.pp @@ -124,7 +124,7 @@ Boolean $run_checks = true, Boolean $always_deploy = true, Boolean $auto_deploy = false, - Boolean $enable = true, + Variant[Boolean,String] $enable = true, ) { require puppi require puppi::params diff --git a/manifests/project/service.pp b/manifests/project/service.pp index f9ed05a..793bd37 100644 --- a/manifests/project/service.pp +++ b/manifests/project/service.pp @@ -91,7 +91,7 @@ String $report_email = '', Boolean $run_checks = true, Boolean $auto_deploy = false, - Boolean $enable = true, + Variant[Boolean,String] $enable = true, ) { require puppi require puppi::params diff --git a/manifests/project/svn.pp b/manifests/project/svn.pp index 059f54c..af30df3 100644 --- a/manifests/project/svn.pp +++ b/manifests/project/svn.pp @@ -169,7 +169,7 @@ Variant[String,Integer] $backup_retention = '5', Boolean $run_checks = true, Boolean $auto_deploy = false, - Boolean $enable = true, + Variant[Boolean,String] $enable = true, ) { require puppi require puppi::params diff --git a/manifests/project/tar.pp b/manifests/project/tar.pp index 10b83cb..8cc32a2 100644 --- a/manifests/project/tar.pp +++ b/manifests/project/tar.pp @@ -137,7 +137,7 @@ Boolean $always_deploy = true, Boolean $auto_deploy = false, Boolean $verify_ssl = true, - Boolean $enable = true, + Variant[Boolean,String] $enable = true, ) { require puppi require puppi::params diff --git a/manifests/project/war.pp b/manifests/project/war.pp index 0d5d109..6888be5 100644 --- a/manifests/project/war.pp +++ b/manifests/project/war.pp @@ -139,7 +139,7 @@ Boolean $always_deploy = true, Boolean $check_deploy = true, Boolean $auto_deploy = false, - Boolean $enable = true, + Variant[Boolean,String] $enable = true, ) { require puppi require puppi::params diff --git a/manifests/project/y4maven.pp b/manifests/project/y4maven.pp index 8c92fa9..fec9278 100644 --- a/manifests/project/y4maven.pp +++ b/manifests/project/y4maven.pp @@ -201,7 +201,7 @@ Boolean $always_deploy = true, Boolean $check_deploy = true, Boolean $auto_deploy = false, - Boolean $enable = true, + Variant[Boolean,String] $enable = true, ) { require puppi require puppi::params diff --git a/manifests/project/yum.pp b/manifests/project/yum.pp index 8ff155d..bbfc6c8 100644 --- a/manifests/project/yum.pp +++ b/manifests/project/yum.pp @@ -103,7 +103,7 @@ Boolean $checks_required = false, Boolean $always_deploy = true, Boolean $auto_deploy = false, - Boolean $enable = true, + Variant[Boolean,String] $enable = true, ) { require puppi require puppi::params diff --git a/manifests/report.pp b/manifests/report.pp index 31d86c3..17f4f12 100644 --- a/manifests/report.pp +++ b/manifests/report.pp @@ -17,7 +17,7 @@ String $arguments = '', Variant[String,Integer] $priority = '50', String $user = 'root', - Boolean $enable = true, + Variant[Boolean,String] $enable = true, ) { require puppi::params diff --git a/manifests/rollback.pp b/manifests/rollback.pp index 15ad6e4..780f91c 100644 --- a/manifests/rollback.pp +++ b/manifests/rollback.pp @@ -17,7 +17,7 @@ String $arguments = '', Variant[String,Integer] $priority = '50', String $user = 'root', - Boolean $enable = true, + Variant[Boolean,String] $enable = true, ) { require puppi require puppi::params diff --git a/spec/classes/dependencies_spec.rb b/spec/classes/dependencies_spec.rb new file mode 100644 index 0000000..0e0b0e9 --- /dev/null +++ b/spec/classes/dependencies_spec.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'puppi::dependencies' do + on_supported_os.each do |os, os_facts| + context "on #{os}" do + let(:facts) { os_facts } + + it { is_expected.to compile.with_all_deps } + end + end +end diff --git a/spec/classes/extras_spec.rb b/spec/classes/extras_spec.rb new file mode 100644 index 0000000..c386a0b --- /dev/null +++ b/spec/classes/extras_spec.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'puppi::extras' do + on_supported_os.each do |os, os_facts| + context "on #{os}" do + let(:facts) { os_facts } + + it { is_expected.to compile.with_all_deps } + end + end +end diff --git a/spec/classes/helpers_spec.rb b/spec/classes/helpers_spec.rb new file mode 100644 index 0000000..5918cef --- /dev/null +++ b/spec/classes/helpers_spec.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'puppi::helpers' do + on_supported_os.each do |os, os_facts| + context "on #{os}" do + let(:facts) { os_facts } + + it { is_expected.to compile.with_all_deps } + end + end +end diff --git a/spec/classes/mcollective/client_spec.rb b/spec/classes/mcollective/client_spec.rb new file mode 100644 index 0000000..59a6f64 --- /dev/null +++ b/spec/classes/mcollective/client_spec.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'puppi::mcollective::client' do + on_supported_os.each do |os, os_facts| + context "on #{os}" do + let(:facts) { os_facts } + + it { is_expected.to compile.with_all_deps } + end + end +end diff --git a/spec/classes/mcollective/server_spec.rb b/spec/classes/mcollective/server_spec.rb new file mode 100644 index 0000000..2c0b3d7 --- /dev/null +++ b/spec/classes/mcollective/server_spec.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'puppi::mcollective::server' do + on_supported_os.each do |os, os_facts| + context "on #{os}" do + let(:facts) { os_facts } + + it { is_expected.to compile.with_all_deps } + end + end +end diff --git a/spec/classes/one_spec.rb b/spec/classes/one_spec.rb new file mode 100644 index 0000000..29a6225 --- /dev/null +++ b/spec/classes/one_spec.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'puppi::one' do + on_supported_os.each do |os, os_facts| + context "on #{os}" do + let(:facts) { os_facts } + + it { is_expected.to compile.with_all_deps } + end + end +end diff --git a/spec/classes/params_spec.rb b/spec/classes/params_spec.rb new file mode 100644 index 0000000..64a9ea6 --- /dev/null +++ b/spec/classes/params_spec.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'puppi::params' do + on_supported_os.each do |os, os_facts| + context "on #{os}" do + let(:facts) { os_facts } + + it { is_expected.to compile.with_all_deps } + end + end +end diff --git a/spec/classes/puppi_spec.rb b/spec/classes/puppi_spec.rb index 903f593..e049524 100644 --- a/spec/classes/puppi_spec.rb +++ b/spec/classes/puppi_spec.rb @@ -1,17 +1,13 @@ +# frozen_string_literal: true + require 'spec_helper' describe 'puppi' do + on_supported_os.each do |os, os_facts| + context "on #{os}" do + let(:facts) { os_facts } - let(:node) { 'rspec.example42.com' } - let(:node) { 'rspec.example42.com' } - let(:facts) { { :ipaddress => '10.42.42.42' } } - - describe 'Test standard installation' do - it { should contain_file('puppi').with_ensure('present') } - it { should contain_file('puppi.conf').with_ensure('present') } - it { should contain_file('puppi.scripts').with_ensure('present') } - it { should contain_file('puppi_basedir').with_ensure('directory') } - it { should contain_file('puppi_datadir').with_ensure('directory') } + it { is_expected.to compile.with_all_deps } + end end - end diff --git a/spec/classes/skel_spec.rb b/spec/classes/skel_spec.rb new file mode 100644 index 0000000..d96180a --- /dev/null +++ b/spec/classes/skel_spec.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'puppi::skel' do + on_supported_os.each do |os, os_facts| + context "on #{os}" do + let(:facts) { os_facts } + + it { is_expected.to compile.with_all_deps } + end + end +end diff --git a/spec/classes/two_spec.rb b/spec/classes/two_spec.rb new file mode 100644 index 0000000..1a824c9 --- /dev/null +++ b/spec/classes/two_spec.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'puppi::two' do + on_supported_os.each do |os, os_facts| + context "on #{os}" do + let(:facts) { os_facts } + + it { is_expected.to compile.with_all_deps } + end + end +end diff --git a/spec/defines/check_spec.rb b/spec/defines/check_spec.rb new file mode 100644 index 0000000..4478e6d --- /dev/null +++ b/spec/defines/check_spec.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'puppi::check' do + let(:title) { 'namevar' } + let(:params) do + {} + end + + on_supported_os.each do |os, os_facts| + context "on #{os}" do + let(:facts) { os_facts } + + it { is_expected.to compile } + end + end +end diff --git a/spec/defines/configure_spec.rb b/spec/defines/configure_spec.rb new file mode 100644 index 0000000..fbac888 --- /dev/null +++ b/spec/defines/configure_spec.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'puppi::configure' do + let(:title) { 'namevar' } + let(:params) do + {} + end + + on_supported_os.each do |os, os_facts| + context "on #{os}" do + let(:facts) { os_facts } + + it { is_expected.to compile } + end + end +end diff --git a/spec/defines/deploy_spec.rb b/spec/defines/deploy_spec.rb new file mode 100644 index 0000000..da68180 --- /dev/null +++ b/spec/defines/deploy_spec.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'puppi::deploy' do + let(:title) { 'namevar' } + let(:params) do + {} + end + + on_supported_os.each do |os, os_facts| + context "on #{os}" do + let(:facts) { os_facts } + + it { is_expected.to compile } + end + end +end diff --git a/spec/defines/helper_spec.rb b/spec/defines/helper_spec.rb new file mode 100644 index 0000000..024457e --- /dev/null +++ b/spec/defines/helper_spec.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'puppi::helper' do + let(:title) { 'namevar' } + let(:params) do + {} + end + + on_supported_os.each do |os, os_facts| + context "on #{os}" do + let(:facts) { os_facts } + + it { is_expected.to compile } + end + end +end diff --git a/spec/defines/info/instance_spec.rb b/spec/defines/info/instance_spec.rb new file mode 100644 index 0000000..acf626a --- /dev/null +++ b/spec/defines/info/instance_spec.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'puppi::info::instance' do + let(:title) { 'namevar' } + let(:params) do + {} + end + + on_supported_os.each do |os, os_facts| + context "on #{os}" do + let(:facts) { os_facts } + + it { is_expected.to compile } + end + end +end diff --git a/spec/defines/info/module_spec.rb b/spec/defines/info/module_spec.rb new file mode 100644 index 0000000..d67447d --- /dev/null +++ b/spec/defines/info/module_spec.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'puppi::info::module' do + let(:title) { 'namevar' } + let(:params) do + {} + end + + on_supported_os.each do |os, os_facts| + context "on #{os}" do + let(:facts) { os_facts } + + it { is_expected.to compile } + end + end +end diff --git a/spec/defines/info/readme_spec.rb b/spec/defines/info/readme_spec.rb new file mode 100644 index 0000000..b8088e0 --- /dev/null +++ b/spec/defines/info/readme_spec.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'puppi::info::readme' do + let(:title) { 'namevar' } + let(:params) do + {} + end + + on_supported_os.each do |os, os_facts| + context "on #{os}" do + let(:facts) { os_facts } + + it { is_expected.to compile } + end + end +end diff --git a/spec/defines/info_spec.rb b/spec/defines/info_spec.rb new file mode 100644 index 0000000..9f1f923 --- /dev/null +++ b/spec/defines/info_spec.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'puppi::info' do + let(:title) { 'namevar' } + let(:params) do + {} + end + + on_supported_os.each do |os, os_facts| + context "on #{os}" do + let(:facts) { os_facts } + + it { is_expected.to compile } + end + end +end diff --git a/spec/defines/initialize_spec.rb b/spec/defines/initialize_spec.rb new file mode 100644 index 0000000..e6e983b --- /dev/null +++ b/spec/defines/initialize_spec.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'puppi::initialize' do + let(:title) { 'namevar' } + let(:params) do + {} + end + + on_supported_os.each do |os, os_facts| + context "on #{os}" do + let(:facts) { os_facts } + + it { is_expected.to compile } + end + end +end diff --git a/spec/defines/install_packages_spec.rb b/spec/defines/install_packages_spec.rb new file mode 100644 index 0000000..deb2939 --- /dev/null +++ b/spec/defines/install_packages_spec.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'puppi::install_packages' do + let(:title) { 'namevar' } + let(:params) do + {} + end + + on_supported_os.each do |os, os_facts| + context "on #{os}" do + let(:facts) { os_facts } + + it { is_expected.to compile } + end + end +end diff --git a/spec/defines/log_spec.rb b/spec/defines/log_spec.rb new file mode 100644 index 0000000..295f8e5 --- /dev/null +++ b/spec/defines/log_spec.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'puppi::log' do + let(:title) { 'namevar' } + let(:params) do + {} + end + + on_supported_os.each do |os, os_facts| + context "on #{os}" do + let(:facts) { os_facts } + + it { is_expected.to compile } + end + end +end diff --git a/spec/defines/netinstall_spec.rb b/spec/defines/netinstall_spec.rb new file mode 100644 index 0000000..7730112 --- /dev/null +++ b/spec/defines/netinstall_spec.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'puppi::netinstall' do + let(:title) { 'namevar' } + let(:params) do + {} + end + + on_supported_os.each do |os, os_facts| + context "on #{os}" do + let(:facts) { os_facts } + + it { is_expected.to compile } + end + end +end diff --git a/spec/defines/project/archive_spec.rb b/spec/defines/project/archive_spec.rb new file mode 100644 index 0000000..a8e5b63 --- /dev/null +++ b/spec/defines/project/archive_spec.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'puppi::project::archive' do + let(:title) { 'namevar' } + let(:params) do + {} + end + + on_supported_os.each do |os, os_facts| + context "on #{os}" do + let(:facts) { os_facts } + + it { is_expected.to compile } + end + end +end diff --git a/spec/defines/project/builder_spec.rb b/spec/defines/project/builder_spec.rb new file mode 100644 index 0000000..aa6cf19 --- /dev/null +++ b/spec/defines/project/builder_spec.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'puppi::project::builder' do + let(:title) { 'namevar' } + let(:params) do + {} + end + + on_supported_os.each do |os, os_facts| + context "on #{os}" do + let(:facts) { os_facts } + + it { is_expected.to compile } + end + end +end diff --git a/spec/defines/project/dir_spec.rb b/spec/defines/project/dir_spec.rb new file mode 100644 index 0000000..8a84651 --- /dev/null +++ b/spec/defines/project/dir_spec.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'puppi::project::dir' do + let(:title) { 'namevar' } + let(:params) do + {} + end + + on_supported_os.each do |os, os_facts| + context "on #{os}" do + let(:facts) { os_facts } + + it { is_expected.to compile } + end + end +end diff --git a/spec/defines/project/files_spec.rb b/spec/defines/project/files_spec.rb new file mode 100644 index 0000000..5483032 --- /dev/null +++ b/spec/defines/project/files_spec.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'puppi::project::files' do + let(:title) { 'namevar' } + let(:params) do + {} + end + + on_supported_os.each do |os, os_facts| + context "on #{os}" do + let(:facts) { os_facts } + + it { is_expected.to compile } + end + end +end diff --git a/spec/defines/project/git_spec.rb b/spec/defines/project/git_spec.rb new file mode 100644 index 0000000..96f5595 --- /dev/null +++ b/spec/defines/project/git_spec.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'puppi::project::git' do + let(:title) { 'namevar' } + let(:params) do + {} + end + + on_supported_os.each do |os, os_facts| + context "on #{os}" do + let(:facts) { os_facts } + + it { is_expected.to compile } + end + end +end diff --git a/spec/defines/project/hg_spec.rb b/spec/defines/project/hg_spec.rb new file mode 100644 index 0000000..6a285ca --- /dev/null +++ b/spec/defines/project/hg_spec.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'puppi::project::hg' do + let(:title) { 'namevar' } + let(:params) do + {} + end + + on_supported_os.each do |os, os_facts| + context "on #{os}" do + let(:facts) { os_facts } + + it { is_expected.to compile } + end + end +end diff --git a/spec/defines/project/maven_spec.rb b/spec/defines/project/maven_spec.rb new file mode 100644 index 0000000..b13e8de --- /dev/null +++ b/spec/defines/project/maven_spec.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'puppi::project::maven' do + let(:title) { 'namevar' } + let(:params) do + {} + end + + on_supported_os.each do |os, os_facts| + context "on #{os}" do + let(:facts) { os_facts } + + it { is_expected.to compile } + end + end +end diff --git a/spec/defines/project/mysql_spec.rb b/spec/defines/project/mysql_spec.rb new file mode 100644 index 0000000..c3be39b --- /dev/null +++ b/spec/defines/project/mysql_spec.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'puppi::project::mysql' do + let(:title) { 'namevar' } + let(:params) do + {} + end + + on_supported_os.each do |os, os_facts| + context "on #{os}" do + let(:facts) { os_facts } + + it { is_expected.to compile } + end + end +end diff --git a/spec/defines/project/service_spec.rb b/spec/defines/project/service_spec.rb new file mode 100644 index 0000000..ed7163f --- /dev/null +++ b/spec/defines/project/service_spec.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'puppi::project::service' do + let(:title) { 'namevar' } + let(:params) do + {} + end + + on_supported_os.each do |os, os_facts| + context "on #{os}" do + let(:facts) { os_facts } + + it { is_expected.to compile } + end + end +end diff --git a/spec/defines/project/svn_spec.rb b/spec/defines/project/svn_spec.rb new file mode 100644 index 0000000..52d9d05 --- /dev/null +++ b/spec/defines/project/svn_spec.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'puppi::project::svn' do + let(:title) { 'namevar' } + let(:params) do + {} + end + + on_supported_os.each do |os, os_facts| + context "on #{os}" do + let(:facts) { os_facts } + + it { is_expected.to compile } + end + end +end diff --git a/spec/defines/project/tar_spec.rb b/spec/defines/project/tar_spec.rb new file mode 100644 index 0000000..56e504a --- /dev/null +++ b/spec/defines/project/tar_spec.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'puppi::project::tar' do + let(:title) { 'namevar' } + let(:params) do + {} + end + + on_supported_os.each do |os, os_facts| + context "on #{os}" do + let(:facts) { os_facts } + + it { is_expected.to compile } + end + end +end diff --git a/spec/defines/project/war_spec.rb b/spec/defines/project/war_spec.rb new file mode 100644 index 0000000..c8a85a3 --- /dev/null +++ b/spec/defines/project/war_spec.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'puppi::project::war' do + let(:title) { 'namevar' } + let(:params) do + {} + end + + on_supported_os.each do |os, os_facts| + context "on #{os}" do + let(:facts) { os_facts } + + it { is_expected.to compile } + end + end +end diff --git a/spec/defines/project/y4maven_spec.rb b/spec/defines/project/y4maven_spec.rb new file mode 100644 index 0000000..3c271d1 --- /dev/null +++ b/spec/defines/project/y4maven_spec.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'puppi::project::y4maven' do + let(:title) { 'namevar' } + let(:params) do + {} + end + + on_supported_os.each do |os, os_facts| + context "on #{os}" do + let(:facts) { os_facts } + + it { is_expected.to compile } + end + end +end diff --git a/spec/defines/project/yum_spec.rb b/spec/defines/project/yum_spec.rb new file mode 100644 index 0000000..dbbe7c7 --- /dev/null +++ b/spec/defines/project/yum_spec.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'puppi::project::yum' do + let(:title) { 'namevar' } + let(:params) do + {} + end + + on_supported_os.each do |os, os_facts| + context "on #{os}" do + let(:facts) { os_facts } + + it { is_expected.to compile } + end + end +end diff --git a/spec/defines/project_spec.rb b/spec/defines/project_spec.rb new file mode 100644 index 0000000..7b5110c --- /dev/null +++ b/spec/defines/project_spec.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'puppi::project' do + let(:title) { 'namevar' } + let(:params) do + {} + end + + on_supported_os.each do |os, os_facts| + context "on #{os}" do + let(:facts) { os_facts } + + it { is_expected.to compile } + end + end +end diff --git a/spec/defines/puppi_check_spec.rb b/spec/defines/puppi_check_spec.rb deleted file mode 100644 index 749fbd9..0000000 --- a/spec/defines/puppi_check_spec.rb +++ /dev/null @@ -1,26 +0,0 @@ -require 'spec_helper' - -describe 'puppi::check' do - - let(:title) { 'puppi::check' } - let(:node) { 'rspec.example42.com' } - let(:facts) { { :arch => 'i386' } } - let(:params) { - { 'enable' => 'true', - 'name' => 'get', - 'command' => 'echo', - 'priority' => '50', - 'project' => 'myapp', - } - } - - describe 'Test puppi check step file creation' do - it 'should create a puppi::check step file' do - should contain_file('Puppi_check_myapp_50_get').with_ensure('present') - end - it 'should populate correctly the puppi::check step file' do - should contain_file('Puppi_check_myapp_50_get').with_content(/\/usr\/lib64\/nagios\/plugins\/echo/) - end - end - -end diff --git a/spec/defines/puppi_deploy_spec.rb b/spec/defines/puppi_deploy_spec.rb deleted file mode 100644 index 2563b0c..0000000 --- a/spec/defines/puppi_deploy_spec.rb +++ /dev/null @@ -1,25 +0,0 @@ -require 'spec_helper' - -describe 'puppi::deploy' do - - let(:title) { 'puppi::deploy' } - let(:node) { 'rspec.example42.com' } - let(:params) { - { 'enable' => 'true', - 'name' => 'get', - 'command' => 'echo', - 'priority' => '50', - 'project' => 'myapp', - } - } - - describe 'Test puppi deploy step file creation' do - it 'should create a puppi::deploy step file' do - should contain_file('/etc/puppi/projects/myapp/deploy/50-get').with_ensure('present') - end - it 'should populate correctly the puppi::deploy step file' do - should contain_file('/etc/puppi/projects/myapp/deploy/50-get').with_content("su - root -c \"export project=myapp && /etc/puppi/scripts/echo \"\n") - end - end - -end diff --git a/spec/defines/puppi_helper_spec.rb b/spec/defines/puppi_helper_spec.rb deleted file mode 100644 index 2fc08b9..0000000 --- a/spec/defines/puppi_helper_spec.rb +++ /dev/null @@ -1,20 +0,0 @@ -require 'spec_helper' - -describe 'puppi::helper' do - - let(:title) { 'spec' } - let(:node) { 'rspec.example42.com' } - let(:params) { - { 'template' => 'puppi/helpers/standard.yml.erb' } - } - - describe 'Test puppi helper file creation' do - it 'should create a puppi helper file' do - should contain_file('puppi_helper_spec').with_ensure('present') - end - it 'should populate correctly the helper file' do - should contain_file('puppi_helper_spec').with_content(/info/) - end - end - -end diff --git a/spec/defines/puppi_info_spec.rb b/spec/defines/puppi_info_spec.rb deleted file mode 100644 index 10ea20e..0000000 --- a/spec/defines/puppi_info_spec.rb +++ /dev/null @@ -1,24 +0,0 @@ -require 'spec_helper' - -describe 'puppi::info' do - - let(:title) { 'puppi::info' } - let(:node) { 'rspec.example42.com' } - let(:params) { - { 'name' => 'sample', - 'description' => 'Sample Info', - 'templatefile' => 'puppi/info.erb', - 'run' => 'myownscript', - } - } - - describe 'Test puppi info step file creation' do - it 'should create a puppi::info step file' do - should contain_file('/etc/puppi/info/sample').with_ensure('present') - end - it 'should populate correctly the puppi::info step file' do - should contain_file('/etc/puppi/info/sample').with_content(/myownscript/) - end - end - -end diff --git a/spec/defines/puppi_initialize_spec.rb b/spec/defines/puppi_initialize_spec.rb deleted file mode 100644 index f314880..0000000 --- a/spec/defines/puppi_initialize_spec.rb +++ /dev/null @@ -1,25 +0,0 @@ -require 'spec_helper' - -describe 'puppi::initialize' do - - let(:title) { 'puppi::initialize' } - let(:node) { 'rspec.example42.com' } - let(:params) { - { 'enable' => 'true', - 'name' => 'get', - 'command' => 'echo', - 'priority' => '50', - 'project' => 'myapp', - } - } - - describe 'Test puppi initialize step file creation' do - it 'should create a puppi::initialize step file' do - should contain_file('/etc/puppi/projects/myapp/initialize/50-get').with_ensure('present') - end - it 'should populate correctly the puppi::initialize step file' do - should contain_file('/etc/puppi/projects/myapp/initialize/50-get').with_content("su - root -c \"export project=myapp && /etc/puppi/scripts/echo \"\n") - end - end - -end diff --git a/spec/defines/puppi_log_spec.rb b/spec/defines/puppi_log_spec.rb deleted file mode 100644 index e67188c..0000000 --- a/spec/defines/puppi_log_spec.rb +++ /dev/null @@ -1,22 +0,0 @@ -require 'spec_helper' - -describe 'puppi::log' do - - let(:title) { 'mylog' } - let(:node) { 'rspec.example42.com' } - let(:params) { - { 'log' => '/var/log/mylog.log', - 'description' => 'My Log', - } - } - - describe 'Test puppi log file creation' do - it 'should create a puppi::log file' do - should contain_file('/etc/puppi/logs/mylog').with_ensure('present') - end - it 'should populate correctly the puppi::log step file' do - should contain_file('/etc/puppi/logs/mylog').with_content(/mylog.log/) - end - end - -end diff --git a/spec/defines/puppi_project_spec.rb b/spec/defines/puppi_project_spec.rb deleted file mode 100644 index b37cb80..0000000 --- a/spec/defines/puppi_project_spec.rb +++ /dev/null @@ -1,25 +0,0 @@ -require 'spec_helper' - -describe 'puppi::report' do - - let(:title) { 'puppi::report' } - let(:node) { 'rspec.example42.com' } - let(:params) { - { 'enable' => 'true', - 'name' => 'get', - 'command' => 'echo', - 'priority' => '50', - 'project' => 'myapp', - } - } - - describe 'Test puppi report step file creation' do - it 'should create a puppi::report step file' do - should contain_file('/etc/puppi/projects/myapp/report/50-get').with_ensure('present') - end - it 'should populate correctly the puppi::report step file' do - should contain_file('/etc/puppi/projects/myapp/report/50-get').with_content("su - root -c \"export project=myapp && /etc/puppi/scripts/echo \"\n") - end - end - -end diff --git a/spec/defines/puppi_report_spec.rb b/spec/defines/puppi_report_spec.rb deleted file mode 100644 index b37cb80..0000000 --- a/spec/defines/puppi_report_spec.rb +++ /dev/null @@ -1,25 +0,0 @@ -require 'spec_helper' - -describe 'puppi::report' do - - let(:title) { 'puppi::report' } - let(:node) { 'rspec.example42.com' } - let(:params) { - { 'enable' => 'true', - 'name' => 'get', - 'command' => 'echo', - 'priority' => '50', - 'project' => 'myapp', - } - } - - describe 'Test puppi report step file creation' do - it 'should create a puppi::report step file' do - should contain_file('/etc/puppi/projects/myapp/report/50-get').with_ensure('present') - end - it 'should populate correctly the puppi::report step file' do - should contain_file('/etc/puppi/projects/myapp/report/50-get').with_content("su - root -c \"export project=myapp && /etc/puppi/scripts/echo \"\n") - end - end - -end diff --git a/spec/defines/puppi_rollback_spec.rb b/spec/defines/puppi_rollback_spec.rb deleted file mode 100644 index c67e5c4..0000000 --- a/spec/defines/puppi_rollback_spec.rb +++ /dev/null @@ -1,25 +0,0 @@ -require 'spec_helper' - -describe 'puppi::rollback' do - - let(:title) { 'puppi::rollback' } - let(:node) { 'rspec.example42.com' } - let(:params) { - { 'enable' => 'true', - 'name' => 'get', - 'command' => 'echo', - 'priority' => '50', - 'project' => 'myapp', - } - } - - describe 'Test puppi rollback step file creation' do - it 'should create a puppi::rollback step file' do - should contain_file('/etc/puppi/projects/myapp/rollback/50-get').with_ensure('present') - end - it 'should populate correctly the puppi::rollback step file' do - should contain_file('/etc/puppi/projects/myapp/rollback/50-get').with_content("su - root -c \"export project=myapp && /etc/puppi/scripts/echo \"\n") - end - end - -end diff --git a/spec/defines/puppi_run_spec.rb b/spec/defines/puppi_run_spec.rb deleted file mode 100644 index 40aa274..0000000 --- a/spec/defines/puppi_run_spec.rb +++ /dev/null @@ -1,17 +0,0 @@ -require 'spec_helper' - -describe 'puppi::run' do - - let(:title) { 'myapp' } - let(:node) { 'rspec.example42.com' } - let(:params) { - { - 'project' => 'myapp', - } - } - - describe 'Test puppi run exe creation' do - it { should contain_exec('Run_Puppi_myapp').with_command(/puppi deploy myapp/) } - end - -end diff --git a/spec/defines/puppi_todo_spec.rb b/spec/defines/puppi_todo_spec.rb deleted file mode 100644 index 249e151..0000000 --- a/spec/defines/puppi_todo_spec.rb +++ /dev/null @@ -1,24 +0,0 @@ -require 'spec_helper' - -describe 'puppi::todo' do - - let(:title) { 'mytodo' } - let(:node) { 'rspec.example42.com' } - let(:params) { - { 'notes' => 'Test Notes', - 'description' => 'Test Description', - 'check_command' => 'check_test', - 'run' => 'test', - } - } - - describe 'Test puppi todo file creation' do - it 'should create a puppi::todo file' do - should contain_file('/etc/puppi/todo/mytodo').with_ensure('present') - end - it 'should populate correctly the puppi::todo step file' do - should contain_file('/etc/puppi/todo/mytodo').with_content(/check_test/) - end - end - -end diff --git a/spec/defines/puppi_ze_spec.rb b/spec/defines/puppi_ze_spec.rb deleted file mode 100644 index e941b9a..0000000 --- a/spec/defines/puppi_ze_spec.rb +++ /dev/null @@ -1,20 +0,0 @@ -require 'spec_helper' - -describe 'puppi::ze' do - - let(:title) { 'sample' } - let(:node) { 'rspec.example42.com' } - let(:params) { - { 'helper' => 'mytest', - 'variables' => { 'var1' => 'get', 'var2' => 'got' }, - 'name' => 'sample', - } - } - - describe 'Test puppi ze data file creation' do - it 'should create a puppi::ze step file' do - should contain_file('puppize_sample').with_ensure('present') - end - end - -end diff --git a/spec/defines/report_spec.rb b/spec/defines/report_spec.rb new file mode 100644 index 0000000..de9f16b --- /dev/null +++ b/spec/defines/report_spec.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'puppi::report' do + let(:title) { 'namevar' } + let(:params) do + {} + end + + on_supported_os.each do |os, os_facts| + context "on #{os}" do + let(:facts) { os_facts } + + it { is_expected.to compile } + end + end +end diff --git a/spec/defines/rollback_spec.rb b/spec/defines/rollback_spec.rb new file mode 100644 index 0000000..bf90e75 --- /dev/null +++ b/spec/defines/rollback_spec.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'puppi::rollback' do + let(:title) { 'namevar' } + let(:params) do + {} + end + + on_supported_os.each do |os, os_facts| + context "on #{os}" do + let(:facts) { os_facts } + + it { is_expected.to compile } + end + end +end diff --git a/spec/defines/run_spec.rb b/spec/defines/run_spec.rb new file mode 100644 index 0000000..e5104e4 --- /dev/null +++ b/spec/defines/run_spec.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'puppi::run' do + let(:title) { 'namevar' } + let(:params) do + {} + end + + on_supported_os.each do |os, os_facts| + context "on #{os}" do + let(:facts) { os_facts } + + it { is_expected.to compile } + end + end +end diff --git a/spec/defines/runscript_spec.rb b/spec/defines/runscript_spec.rb new file mode 100644 index 0000000..cc44c10 --- /dev/null +++ b/spec/defines/runscript_spec.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'puppi::runscript' do + let(:title) { 'namevar' } + let(:params) do + {} + end + + on_supported_os.each do |os, os_facts| + context "on #{os}" do + let(:facts) { os_facts } + + it { is_expected.to compile } + end + end +end diff --git a/spec/defines/todo_spec.rb b/spec/defines/todo_spec.rb new file mode 100644 index 0000000..5984063 --- /dev/null +++ b/spec/defines/todo_spec.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'puppi::todo' do + let(:title) { 'namevar' } + let(:params) do + {} + end + + on_supported_os.each do |os, os_facts| + context "on #{os}" do + let(:facts) { os_facts } + + it { is_expected.to compile } + end + end +end diff --git a/spec/defines/ze_spec.rb b/spec/defines/ze_spec.rb new file mode 100644 index 0000000..768f521 --- /dev/null +++ b/spec/defines/ze_spec.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'puppi::ze' do + let(:title) { 'namevar' } + let(:params) do + {} + end + + on_supported_os.each do |os, os_facts| + context "on #{os}" do + let(:facts) { os_facts } + + it { is_expected.to compile } + end + end +end