From a45641398d6d8be5f81179f652bdbe8142810d24 Mon Sep 17 00:00:00 2001 From: michael Date: Fri, 8 Mar 2013 14:02:24 -0800 Subject: [PATCH] Create an integration tests for the plugin type demonstrating the user creation problem --- .gitignore | 1 + tests/Vagrantfile | 17 +++++++++++++++++ tests/init.pp | 4 ++++ tests/plugin.pp | 27 +++++++++++++++++++++++++++ 4 files changed, 49 insertions(+) create mode 100644 tests/Vagrantfile create mode 100644 tests/plugin.pp diff --git a/.gitignore b/.gitignore index 18d463e..4d75cdd 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ .project .librarian/ .tmp/ +.vagrant doc/ spec/fixtures/ pkg/ diff --git a/tests/Vagrantfile b/tests/Vagrantfile new file mode 100644 index 0000000..d399b78 --- /dev/null +++ b/tests/Vagrantfile @@ -0,0 +1,17 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +Vagrant::Config.run do |config| + config.vm.box = "centos63-64" + + config.vm.box_url = "http://developer.nrel.gov/downloads/vagrant-boxes/CentOS-6.3-x86_64-v20130101.box" + + # Forward a port from the guest to the host, which allows for outside + # computers to access the VM, whereas host only networking does not. + # config.vm.forward_port 8181, 8181 + +# config.vm.provision :puppet, :module_path => "../..", :manifests_path => ".", :manifest_file => "init.pp"#, :options => ["--debug", "--verbose"] + config.vm.provision :puppet, :module_path => "../..", :manifests_path => ".", :manifest_file => "plugin.pp"#, :options => ["--debug", "--verbose"] +# config.vm.provision :puppet, :module_path => "../..", :manifests_path => ".", :manifest_file => "uninstall.pp"#, :options => ["--debug", "--verbose"] + +end diff --git a/tests/init.pp b/tests/init.pp index fa54f27..601e595 100644 --- a/tests/init.pp +++ b/tests/init.pp @@ -1,3 +1,7 @@ +package {'java-1.6.0-openjdk-devel': + ensure => present, +} + class { 'jenkins': jenkins_port => '8181', } diff --git a/tests/plugin.pp b/tests/plugin.pp new file mode 100644 index 0000000..223c786 --- /dev/null +++ b/tests/plugin.pp @@ -0,0 +1,27 @@ +package {'java-1.6.0-openjdk-devel': + ensure => present, +} + +class { 'jenkins': + jenkins_port => '8181', +} + +jenkins::plugin {'token-macro':} + +Exec { + path => [ + '/usr/local/bin', + '/usr/local/sbin', + '/opt/local/bin', + '/opt/local/sbin', + '/usr/bin', + '/usr/sbin', + '/bin', + '/sbin',], +} + + +exec {'bash -c \'[[ ~jenkins == "/var/lib/jenkins" ]]\'': + require => [Class['jenkins'], Jenkins::Plugin['token-macro']], +} +