Upgrade php from 5.4.* to 5.5.*

This commit is contained in:
Benoît Burnichon
2015-03-17 10:09:07 +01:00
parent e32816a8e0
commit 7ad443a88b
2027 changed files with 72 additions and 88 deletions

View File

@@ -0,0 +1,76 @@
require "#{File.join(File.dirname(__FILE__),'..','spec_helper.rb')}"
describe 'php' do
let(:title) { 'php' }
let(:node) { 'rspec.example42.com' }
let(:facts) { { :ipaddress => '10.42.42.42' } }
describe 'Test standard installation' do
it { should contain_package('php').with_ensure('present') }
it { should contain_file('php.conf').with_ensure('present') }
end
describe 'Test installation of a specific version' do
let(:params) { {:version => '1.0.42' } }
it { should contain_package('php').with_ensure('1.0.42') }
end
describe 'Test decommissioning - absent' do
let(:params) { {:absent => true, :monitor => true } }
it 'should remove Package[php]' do should contain_package('php').with_ensure('absent') end
it 'should remove php configuration file' do should contain_file('php.conf').with_ensure('absent') end
end
describe 'Test customizations - template' do
let(:params) { {:template => "php/spec.erb" , :options => { 'opt_a' => 'value_a' } } }
it 'should generate a valid template' do
content = catalogue.resource('file', 'php.conf').send(:parameters)[:content]
content.should match "fqdn: rspec.example42.com"
end
it 'should generate a template that uses custom options' do
content = catalogue.resource('file', 'php.conf').send(:parameters)[:content]
content.should match "value_a"
end
end
describe 'Test customizations - source' do
let(:params) { {:source => "puppet://modules/php/spec" , :source_dir => "puppet://modules/php/dir/spec" , :source_dir_purge => true } }
it 'should request a valid source ' do
content = catalogue.resource('file', 'php.conf').send(:parameters)[:source]
content.should == "puppet://modules/php/spec"
end
it 'should request a valid source dir' do
content = catalogue.resource('file', 'php.dir').send(:parameters)[:source]
content.should == "puppet://modules/php/dir/spec"
end
it 'should purge source dir if source_dir_purge is true' do
content = catalogue.resource('file', 'php.dir').send(:parameters)[:purge]
content.should == true
end
end
describe 'Test customizations - custom class' do
let(:params) { {:my_class => "php::spec" } }
it 'should automatically include a custom class' do
content = catalogue.resource('file', 'php.conf').send(:parameters)[:content]
content.should match "fqdn: rspec.example42.com"
end
end
describe 'Test Puppi Integration' do
let(:params) { {:puppi => true, :puppi_helper => "myhelper"} }
it 'should generate a puppi::ze define' do
content = catalogue.resource('puppi::ze', 'php').send(:parameters)[:helper]
content.should == "myhelper"
end
end
end

View File

@@ -0,0 +1,38 @@
require "#{File.join(File.dirname(__FILE__),'..','spec_helper.rb')}"
describe 'php::module' do
let(:title) { 'php::module' }
let(:node) { 'rspec.example42.com' }
let(:facts) { { 'operatingsystem' => 'Ubuntu' } }
describe 'Test standard installation' do
let(:params) { { 'name' => 'ps', } }
it 'should create a package with the default OS prefix' do
should contain_package('PhpModule_ps').with_name('php5-ps')
end
it 'should notify the default service' do
should contain_package('PhpModule_ps').with_notify('Service[apache2]')
end
end
describe 'Test custom params' do
let(:params) { { 'name' => 'ps', 'module_prefix' => 'my-' , 'service_autorestart' => false } }
it 'should create a package with custom prefix' do
should contain_package('PhpModule_ps').with(
'ensure' => 'present',
'name' => 'my-ps'
)
should contain_package('PhpModule_ps').without('notify')
end
end
describe 'Test uninstallation' do
let(:params) { { 'name' => 'ps', 'absent' => 'true' } }
it 'should remove the package' do
should contain_package('PhpModule_ps').with_ensure('absent')
end
end
end

View File

@@ -0,0 +1,49 @@
require "#{File.join(File.dirname(__FILE__),'..','spec_helper.rb')}"
describe 'php::pear::module' do
let(:title) { 'php::pear::module' }
let(:node) { 'rspec.example42.com' }
let(:facts) { { 'operatingsystem' => 'Ubuntu' } }
describe 'Test standard installation' do
let(:params) { { 'name' => 'Crypt-CHAP', } }
it 'should install pear module with default OS package' do
should contain_package('pear-Crypt-CHAP').with_name('php-Crypt-CHAP')
end
it 'should notify the default service' do
should contain_package('pear-Crypt-CHAP').with_notify('Service[apache2]')
end
end
describe 'Test custom params' do
let(:params) { { 'name' => 'Crypt-CHAP', 'module_prefix' => 'my-' , 'service_autorestart' => false } }
it 'should create a package with custom prefix' do
should contain_package('pear-Crypt-CHAP').with(
'ensure' => 'present',
'name' => 'my-Crypt-CHAP'
)
should contain_package('pear-Crypt-CHAP').without('notify')
end
end
describe 'Test uninstallation' do
let(:params) { { 'name' => 'Crypt-CHAP', 'ensure' => 'absent' } }
it 'should remove the package' do
should contain_package('pear-Crypt-CHAP').with_ensure('absent')
end
end
describe 'Test installation via exec' do
let(:params) { { 'name' => 'Crypt-CHAP', 'use_package' => 'false' } }
it 'should install pear module with exec commands' do
should contain_exec('pear-Crypt-CHAP').with(
'command' => 'pear -d preferred_state=stable install pear.php.net/Crypt-CHAP',
'unless' => 'pear info pear.php.net/Crypt-CHAP'
)
end
end
end

View File

@@ -0,0 +1 @@
require 'puppetlabs_spec_helper/module_spec_helper'