summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBogdan Dobrelya <bdobrelia@mirantis.com>2015-11-04 14:10:03 +0100
committerBogdan Dobrelya <bdobrelia@mirantis.com>2015-11-05 12:52:15 +0100
commit8c22c0e862c02585ca8f278d422335d80287a11c (patch)
tree13261d7c0d25e82e315a58395112a8c2b3e5e1f4
parent089d0a3f2b78f10cdec6d3384412ee5742e8f329 (diff)
Prepare for puppet checks in OpenStack infra
Add Gemfile, Rakefile Adjust .gitignore Switch to corosync upstream module v0.8.0 Add fuel pacemaker module with disabled rspecs Fix pre_build_hook Fix rspecs to match rspec 3.3.0 and new puppets Change-Id: I731a3fe16babab2db8c3ef1cb088490ef3388c32 Signed-off-by: Bogdan Dobrelya <bdobrelia@mirantis.com>
Notes
Notes (review): Verified+2: Jenkins Code-Review+2: Bogdan Dobrelya <bdobrelia@mirantis.com> Workflow+1: Bogdan Dobrelya <bdobrelia@mirantis.com> Submitted-by: Jenkins Submitted-at: Thu, 12 Nov 2015 09:04:21 +0000 Reviewed-on: https://review.openstack.org/244503 Project: openstack/fuel-plugin-ha-fencing Branch: refs/heads/master
-rw-r--r--.gitignore11
-rw-r--r--Gemfile33
-rw-r--r--Rakefile183
-rw-r--r--deployment_scripts/puppet/modules/pcs_fencing/.fixtures.yml4
-rw-r--r--deployment_scripts/puppet/modules/pcs_fencing/Gemfile7
-rw-r--r--deployment_scripts/puppet/modules/pcs_fencing/Gemfile.lock56
-rw-r--r--deployment_scripts/puppet/modules/pcs_fencing/lib/puppet/type/cs_fencetopo.rb2
-rw-r--r--deployment_scripts/puppet/modules/pcs_fencing/manifests/fencing.pp8
-rw-r--r--deployment_scripts/puppet/modules/pcs_fencing/spec/classes/fencing_primitives_spec.rb7
-rw-r--r--deployment_scripts/puppet/modules/pcs_fencing/spec/defines/fencing_spec.rb18
-rw-r--r--deployment_scripts/puppet/modules/pcs_fencing/spec/spec_helper.rb6
-rw-r--r--deployment_scripts/puppet/modules/pcs_fencing/spec/unit/puppet/provider/cs_fencetopo/crm_spec.rb4
-rw-r--r--deployment_scripts/puppet/modules/pcs_fencing/spec/unit/puppet/type/cs_fencetopo_spec.rb4
-rw-r--r--modules.disable_rspec1
-rwxr-xr-xpre_build_hook23
15 files changed, 278 insertions, 89 deletions
diff --git a/.gitignore b/.gitignore
index ae7297c..d2b3a5f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,16 @@
1# Plugin
1deployment_scripts/puppet/modules/corosync 2deployment_scripts/puppet/modules/corosync
3deployment_scripts/puppet/modules/pacemaker
2deployment_scripts/puppet/modules/stdlib 4deployment_scripts/puppet/modules/stdlib
3.build 5.build
4tmp 6tmp
5*.fp 7*.fp
8
9# Editors
10*.swp
11*~
12
13# Bundle
14Gemfile.lock
15.bundled_gems
16.bundle
diff --git a/Gemfile b/Gemfile
new file mode 100644
index 0000000..028f675
--- /dev/null
+++ b/Gemfile
@@ -0,0 +1,33 @@
1source 'https://rubygems.org'
2
3group :development, :test do
4 gem 'puppetlabs_spec_helper', :require => 'false'
5 gem 'rspec', '~>3.3', :require => 'false'
6 gem 'rspec-puppet', '~> 2.2.0', :require => 'false'
7 gem 'metadata-json-lint', :require => 'false'
8 gem 'puppet-lint-param-docs', :require => 'false'
9 gem 'puppet-lint-absolute_classname-check', :require => 'false'
10 gem 'puppet-lint-absolute_template_path', :require => 'false'
11 gem 'puppet-lint-unquoted_string-check', :require => 'false'
12 gem 'puppet-lint-leading_zero-check', :require => 'false'
13 gem 'puppet-lint-variable_contains_upcase', :require => 'false'
14 gem 'puppet-lint-numericvariable', :require => 'false'
15 gem 'puppet_facts', :require => 'false'
16 gem 'json', :require => 'false'
17 gem 'pry', :require => 'false'
18 gem 'simplecov', :require => 'false'
19 gem 'webmock', :require => 'false'
20 gem 'fakefs', :require => 'false'
21 gem 'fog-google', '0.1.0', :require => 'false' # 0.1.1+ requires ruby 2.0
22 gem 'beaker-rspec', :require => 'false'
23 gem 'beaker-puppet_install_helper', :require => 'false'
24 gem 'puppet-blacksmith', :require => 'false'
25
26end
27
28if puppetversion = ENV['PUPPET_GEM_VERSION']
29 gem 'puppet', puppetversion, :require => false
30else
31 # TODO(bogdando): remove this version when 4 is supported
32 gem 'puppet', '~> 3.8', :require => false
33end
diff --git a/Rakefile b/Rakefile
new file mode 100644
index 0000000..429c176
--- /dev/null
+++ b/Rakefile
@@ -0,0 +1,183 @@
1###############################################################################
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6# http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13###############################################################################
14#
15# Rakefile
16# This file implements the lint and spec tasks for rake so that it will check
17# the plugin's puppet modules in the deployment_scripts/puppet/modules
18# folder by running the respective lint or test tasks for each module.
19# It will then return 0 if there are issues or return 1 if any of the modules
20# fail.
21#
22# Acknowledgements
23# The Rakefile is based on the work of Alex Schultz <aschultz@mirantis.com>,
24# https://raw.githubusercontent.com/openstack/fuel-library/master/Rakefile
25#
26require 'puppetlabs_spec_helper/rake_tasks'
27require 'puppet-lint/tasks/puppet-lint'
28require 'puppet-syntax/tasks/puppet-syntax'
29require 'rake'
30
31MODULES_PATH="./deployment_scripts/puppet/modules"
32PuppetSyntax.exclude_paths ||= []
33PuppetSyntax.exclude_paths << "spec/fixtures/**/*"
34PuppetSyntax.exclude_paths << "pkg/**/*"
35PuppetSyntax.exclude_paths << "vendor/**/*"
36
37# Main task list
38task :spec => ["spec:gemfile"]
39task :lint => ["lint:manual"]
40
41namespace :common do
42 desc 'Task to generate a list of puppet modules'
43 task :modulelist, [:skip_file] do |t,args|
44 args.with_defaults(:skip_file => nil)
45
46 cdir = Dir.pwd
47 skip_module_list = []
48 $module_directories = []
49 # NOTE(bogdando): some dependent modules may have no good tests an we need
50 # this file to exclude those
51 if not args[:skip_file].nil? and File.exists?(args[:skip_file])
52 File.open(args[:skip_file], 'r').each_line { |line|
53 skip_module_list << line.chomp
54 }
55 end
56
57 Dir.glob("#{MODULES_PATH}/*") do |mod|
58 next unless File.directory?(mod)
59 if skip_module_list.include?(File.basename(mod))
60 $stderr.puts "Skipping tests... modules.disable_rspec includes #{mod}"
61 next
62 end
63 $module_directories << mod
64 end
65 end
66end
67
68# The spec task to loop through the modules and run the tests
69namespace :spec do
70 desc 'Run spec tasks via module bundler with Gemfile'
71 task :gemfile do |t|
72 Rake::Task["common:modulelist"].invoke('./modules.disable_rspec')
73 cdir = Dir.pwd
74 status = true
75
76 ENV['GEM_HOME']="#{cdir}/.bundled_gems"
77 system("gem install bundler --no-rdoc --no-ri --verbose")
78 system("./pre_build_hook")
79
80 $module_directories.each do |mod|
81 next unless File.exists?("#{mod}/Gemfile")
82 $stderr.puts '-'*80
83 $stderr.puts "Running tests for #{mod}"
84 $stderr.puts '-'*80
85 Dir.chdir(mod)
86 begin
87 system("bundle install")
88 result = system("bundle exec rake spec")
89 if !result
90 status = false
91 $stderr.puts "!"*80
92 $stderr.puts "Unit tests failed for #{mod}"
93 $stderr.puts "!"*80
94 end
95 rescue Exception => e
96 $stderr.puts "ERROR: Unable to run tests for #{mod}, #{e.message}"
97 status = false
98 end
99 Dir.chdir(cdir)
100 end
101 fail unless status
102 end
103end
104
105# The lint tasks
106namespace :lint do
107 desc 'Find all the puppet files and run puppet-lint on them'
108 task :manual do |t|
109 Rake::Task["common:modulelist"].invoke('./modules.disable_rspec rake-lint')
110 # lint checks to skip if no Gemfile or Rakefile
111 skip_checks = [ "--no-80chars-check",
112 "--no-autoloader_layout-check",
113 "--no-nested_classes_or_defines-check",
114 "--no-only_variable_string-check",
115 "--no-2sp_soft_tabs-check",
116 "--no-trailing_whitespace-check",
117 "--no-hard_tabs-check",
118 "--no-class_inherits_from_params_class-check",
119 "--with-filename"]
120 cdir = Dir.pwd
121 status = true
122
123 ENV['GEM_HOME']="#{cdir}/.bundled_gems"
124 system("gem install bundler --no-rdoc --no-ri --verbose")
125
126 $module_directories.each do |mod|
127 $stderr.puts '-'*80
128 $stderr.puts "Running lint for #{mod}"
129 $stderr.puts '-'*80
130 Dir.chdir(mod)
131 begin
132 result = true
133 Dir.glob("**/**.pp") do |puppet_file|
134 result = false unless system("puppet-lint #{skip_checks.join(" ")} #{puppet_file}")
135 end
136 if !result
137 status = false
138 $stderr.puts "!"*80
139 $stderr.puts "puppet-lint failed for #{mod}"
140 $stderr.puts "!"*80
141 end
142 rescue Exception => e
143 $stderr.puts "ERROR: Unable to run lint for #{mod}, #{e.message}"
144 status = false
145 end
146 Dir.chdir(cdir)
147 end
148 fail unless status
149 end
150
151 desc 'Run lint tasks from modules with an existing Gemfile/Rakefile'
152 task :rakefile do |t|
153 Rake::Task["common:modulelist"].invoke('./modules.disable_rspec rake-lint')
154 cdir = Dir.pwd
155 status = true
156
157 ENV['GEM_HOME']="#{cdir}/.bundled_gems"
158 system("gem install bundler --no-rdoc --no-ri --verbose")
159
160 $module_directories.each do |mod|
161 next unless File.exists?("#{mod}/Rakefile")
162 $stderr.puts '-'*80
163 $stderr.puts "Running lint for #{mod}"
164 $stderr.puts '-'*80
165 Dir.chdir(mod)
166 begin
167 result = system("bundle exec rake lint > /dev/null")
168 $stderr.puts result
169 if !result
170 status = false
171 $stderr.puts "!"*80
172 $stderr.puts "rake lint failed for #{mod}"
173 $stderr.puts "!"*80
174 end
175 rescue Exception => e
176 $stderr.puts "ERROR: Unable to run lint for #{mod}, #{e.message}"
177 status = false
178 end
179 Dir.chdir(cdir)
180 end
181 fail unless status
182 end
183end
diff --git a/deployment_scripts/puppet/modules/pcs_fencing/.fixtures.yml b/deployment_scripts/puppet/modules/pcs_fencing/.fixtures.yml
index 9d3d8c3..4df429d 100644
--- a/deployment_scripts/puppet/modules/pcs_fencing/.fixtures.yml
+++ b/deployment_scripts/puppet/modules/pcs_fencing/.fixtures.yml
@@ -1,9 +1,11 @@
1fixtures: 1fixtures:
2 repositories: 2 repositories:
3 #corosync: 'https://github.com/puppetlabs/puppetlabs-corosync.git' 3 #corosync: 'https://github.com/puppetlabs/puppetlabs-corosync.git'
4 #pacemaker: 'https://github.com/puppet-community/puppet-corosync'
4 #stdlib: 'https://github.com/puppetlabs/puppetlabs-stdlib.git' 5 #stdlib: 'https://github.com/puppetlabs/puppetlabs-stdlib.git'
5 6
6 symlinks: 7 symlinks:
7 pcs_fencing: "#{source_dir}" 8 pcs_fencing: "#{source_dir}"
8 corosync: "#{source_dir}/../corosync" 9 corosync: "#{source_dir}/../corosync"
10 pacemaker: "#{source_dir}/../pacemaker"
9 stdlib: "#{source_dir}/../stdlib" 11 stdlib: "#{source_dir}/../stdlib"
diff --git a/deployment_scripts/puppet/modules/pcs_fencing/Gemfile b/deployment_scripts/puppet/modules/pcs_fencing/Gemfile
index 2797c77..6f0ea8a 100644
--- a/deployment_scripts/puppet/modules/pcs_fencing/Gemfile
+++ b/deployment_scripts/puppet/modules/pcs_fencing/Gemfile
@@ -1,10 +1,11 @@
1source 'https://rubygems.org' 1source 'https://rubygems.org'
2 2
3group :development, :test do 3group :development, :test do
4 gem 'rspec-puppet', :require => false
4 gem 'puppetlabs_spec_helper', :require => false 5 gem 'puppetlabs_spec_helper', :require => false
5 gem 'puppet-lint', '~> 0.3.2' 6 gem 'puppet-lint', '~> 1.1.0'
6 gem 'rake', '10.1.1' 7 gem 'rake', '~> 10.1.0', :require => false
7 gem 'rspec', '< 2.99' 8 gem 'rspec', '~> 3.3.0', :require => false
8 gem 'json' 9 gem 'json'
9 gem 'webmock' 10 gem 'webmock'
10end 11end
diff --git a/deployment_scripts/puppet/modules/pcs_fencing/Gemfile.lock b/deployment_scripts/puppet/modules/pcs_fencing/Gemfile.lock
deleted file mode 100644
index a730a2f..0000000
--- a/deployment_scripts/puppet/modules/pcs_fencing/Gemfile.lock
+++ /dev/null
@@ -1,56 +0,0 @@
1GEM
2 remote: https://rubygems.org/
3 specs:
4 addressable (2.3.6)
5 crack (0.4.2)
6 safe_yaml (~> 1.0.0)
7 diff-lcs (1.2.5)
8 facter (2.3.0)
9 hiera (1.3.4)
10 json_pure
11 json (1.8.1)
12 json_pure (1.8.1)
13 metaclass (0.0.4)
14 mocha (1.1.0)
15 metaclass (~> 0.0.1)
16 puppet (3.7.3)
17 facter (> 1.6, < 3)
18 hiera (~> 1.0)
19 json_pure
20 puppet-lint (0.3.2)
21 puppet-syntax (1.3.0)
22 rake
23 puppetlabs_spec_helper (0.8.2)
24 mocha
25 puppet-lint
26 puppet-syntax
27 rake
28 rspec
29 rspec-puppet
30 rake (10.1.1)
31 rspec (2.14.1)
32 rspec-core (~> 2.14.0)
33 rspec-expectations (~> 2.14.0)
34 rspec-mocks (~> 2.14.0)
35 rspec-core (2.14.8)
36 rspec-expectations (2.14.5)
37 diff-lcs (>= 1.1.3, < 2.0)
38 rspec-mocks (2.14.6)
39 rspec-puppet (1.0.1)
40 rspec
41 safe_yaml (1.0.4)
42 webmock (1.20.4)
43 addressable (>= 2.3.6)
44 crack (>= 0.3.2)
45
46PLATFORMS
47 ruby
48
49DEPENDENCIES
50 json
51 puppet
52 puppet-lint (~> 0.3.2)
53 puppetlabs_spec_helper
54 rake (= 10.1.1)
55 rspec (< 2.99)
56 webmock
diff --git a/deployment_scripts/puppet/modules/pcs_fencing/lib/puppet/type/cs_fencetopo.rb b/deployment_scripts/puppet/modules/pcs_fencing/lib/puppet/type/cs_fencetopo.rb
index 1565882..e6e5d74 100644
--- a/deployment_scripts/puppet/modules/pcs_fencing/lib/puppet/type/cs_fencetopo.rb
+++ b/deployment_scripts/puppet/modules/pcs_fencing/lib/puppet/type/cs_fencetopo.rb
@@ -39,7 +39,7 @@ module Puppet
39 end 39 end
40 40
41 autorequire(:service) do 41 autorequire(:service) do
42 [ 'corosync' ] 42 [ 'corosync', 'pacemaker' ]
43 end 43 end
44 44
45 autorequire(:cs_shadow) do 45 autorequire(:cs_shadow) do
diff --git a/deployment_scripts/puppet/modules/pcs_fencing/manifests/fencing.pp b/deployment_scripts/puppet/modules/pcs_fencing/manifests/fencing.pp
index bb3a8bc..7afc6f7 100644
--- a/deployment_scripts/puppet/modules/pcs_fencing/manifests/fencing.pp
+++ b/deployment_scripts/puppet/modules/pcs_fencing/manifests/fencing.pp
@@ -52,13 +52,13 @@ define pcs_fencing::fencing (
52 metadata => $meta, 52 metadata => $meta,
53 } 53 }
54 54
55 cs_location {"location__prohibit__${res_name}": 55 cs_rsc_location {"location__prohibit__${res_name}":
56 node_name => $::pacemaker_hostname, 56 node_name => $::pacemaker_hostname,
57 node_score => '-INFINITY', 57 node_score => '-INFINITY',
58 primitive => $res_name, 58 primitive => $res_name,
59 } 59 }
60 60
61 cs_location {"location__allow__${res_name}": 61 cs_rsc_location {"location__allow__${res_name}":
62 primitive => $res_name, 62 primitive => $res_name,
63 rules => [ 63 rules => [
64 { 64 {
@@ -74,7 +74,7 @@ define pcs_fencing::fencing (
74 }, 74 },
75 ], 75 ],
76 } 76 }
77 77
78 Cs_resource[$res_name] -> 78 Cs_resource[$res_name] ->
79 Cs_location<||> 79 Cs_rsc_location<||>
80} 80}
diff --git a/deployment_scripts/puppet/modules/pcs_fencing/spec/classes/fencing_primitives_spec.rb b/deployment_scripts/puppet/modules/pcs_fencing/spec/classes/fencing_primitives_spec.rb
index c0a31b7..bd1808a 100644
--- a/deployment_scripts/puppet/modules/pcs_fencing/spec/classes/fencing_primitives_spec.rb
+++ b/deployment_scripts/puppet/modules/pcs_fencing/spec/classes/fencing_primitives_spec.rb
@@ -22,11 +22,16 @@ describe 'pcs_fencing::fencing_primitives' do
22 'fqdn' => 'node-1.foo.bar', 22 'fqdn' => 'node-1.foo.bar',
23 'name' => 'node-1', 23 'name' => 'node-1',
24 'role' => 'primary-controller' 24 'role' => 'primary-controller'
25 },
26 {
27 'fqdn' => 'node-2.foo.bar',
28 'name' => 'node-2',
29 'role' => 'controller'
25 } 30 }
26 ] 31 ]
27 } 32 }
28 end 33 end
29 let(:names) { [ 'node-1.foo.bar' ] } 34 let(:names) { [ 'node-1.foo.bar', 'node-2.foo.bar' ] }
30 let(:facts) {{ :osfamily => 'RedHat' }} 35 let(:facts) {{ :osfamily => 'RedHat' }}
31 36
32 context 'then configuring fencing' do 37 context 'then configuring fencing' do
diff --git a/deployment_scripts/puppet/modules/pcs_fencing/spec/defines/fencing_spec.rb b/deployment_scripts/puppet/modules/pcs_fencing/spec/defines/fencing_spec.rb
index 3bff555..8cf03d7 100644
--- a/deployment_scripts/puppet/modules/pcs_fencing/spec/defines/fencing_spec.rb
+++ b/deployment_scripts/puppet/modules/pcs_fencing/spec/defines/fencing_spec.rb
@@ -35,14 +35,12 @@ describe 'pcs_fencing::fencing', :type => :define do
35 { 35 {
36 :primitive => res_name, 36 :primitive => res_name,
37 :rules => [ 37 :rules => [
38 { 38 ["score", "100"],
39 'score' => '100', 39 ["boolean", ""],
40 'boolean' => '', 40 ["expressions", [
41 'expressions' => [ 41 {"attribute"=>"#uname",
42 {'attribute'=>"#uname",'operation'=>'ne','value'=>node} 42 "operation"=>"ne",
43 ] 43 "value"=>"node-1"}]]]
44 }
45 ]
46 } 44 }
47 end 45 end
48 let(:facts) {{ :osfamily => 'Debian' }} 46 let(:facts) {{ :osfamily => 'Debian' }}
@@ -67,7 +65,7 @@ describe 'pcs_fencing::fencing', :type => :define do
67 ) 65 )
68 end 66 end
69 it 'should create a prohibit location' do 67 it 'should create a prohibit location' do
70 should contain_cs_location("location__prohibit__#{res_name}").with( 68 should contain_cs_rsc_location("location__prohibit__#{res_name}").with(
71 { 69 {
72 'node_name' => location_prohibit_params[:node_name], 70 'node_name' => location_prohibit_params[:node_name],
73 'node_score' => location_prohibit_params[:score], 71 'node_score' => location_prohibit_params[:score],
@@ -76,7 +74,7 @@ describe 'pcs_fencing::fencing', :type => :define do
76 ) 74 )
77 end 75 end
78 it 'should create an allow location' do 76 it 'should create an allow location' do
79 should contain_cs_location("location__allow__#{res_name}").with( 77 should contain_cs_rsc_location("location__allow__#{res_name}").with(
80 { 78 {
81 'primitive' => location_allow_params[:primitive], 79 'primitive' => location_allow_params[:primitive],
82 'rules' => location_allow_params[:rules] 80 'rules' => location_allow_params[:rules]
diff --git a/deployment_scripts/puppet/modules/pcs_fencing/spec/spec_helper.rb b/deployment_scripts/puppet/modules/pcs_fencing/spec/spec_helper.rb
index 3d92005..3ba70bd 100644
--- a/deployment_scripts/puppet/modules/pcs_fencing/spec/spec_helper.rb
+++ b/deployment_scripts/puppet/modules/pcs_fencing/spec/spec_helper.rb
@@ -1 +1,5 @@
1require 'puppetlabs_spec_helper/module_spec_helper' \ No newline at end of file 1require 'puppetlabs_spec_helper/module_spec_helper'
2
3RSpec.configure do |config|
4 config.expect_with(:rspec) { |c| c.syntax = :should }
5end
diff --git a/deployment_scripts/puppet/modules/pcs_fencing/spec/unit/puppet/provider/cs_fencetopo/crm_spec.rb b/deployment_scripts/puppet/modules/pcs_fencing/spec/unit/puppet/provider/cs_fencetopo/crm_spec.rb
index 6097f44..c020a84 100644
--- a/deployment_scripts/puppet/modules/pcs_fencing/spec/unit/puppet/provider/cs_fencetopo/crm_spec.rb
+++ b/deployment_scripts/puppet/modules/pcs_fencing/spec/unit/puppet/provider/cs_fencetopo/crm_spec.rb
@@ -135,7 +135,7 @@ describe Puppet::Type.type(:cs_fencetopo).provider(:crm) do
135 out=File.open(File.dirname(__FILE__) + '/../../../../fixtures/cib/cib.xml') 135 out=File.open(File.dirname(__FILE__) + '/../../../../fixtures/cib/cib.xml')
136 provider.class.stubs(:dump_cib).returns(out,nil) 136 provider.class.stubs(:dump_cib).returns(out,nil)
137 provider.class.stubs(:exec_withenv).with(' --query --scope fencing-topology', {}).returns(0) 137 provider.class.stubs(:exec_withenv).with(' --query --scope fencing-topology', {}).returns(0)
138 provider.exists?.should be_true 138 provider.exists?.should be_truthy
139 end 139 end
140 140
141 it 'checks if topology singleton does not exist' do 141 it 'checks if topology singleton does not exist' do
@@ -143,7 +143,7 @@ describe Puppet::Type.type(:cs_fencetopo).provider(:crm) do
143 out=File.open(File.dirname(__FILE__) + '/../../../../fixtures/cib/cib_no_topo.xml') 143 out=File.open(File.dirname(__FILE__) + '/../../../../fixtures/cib/cib_no_topo.xml')
144 provider.class.stubs(:dump_cib).returns(out,nil) 144 provider.class.stubs(:dump_cib).returns(out,nil)
145 provider.class.stubs(:exec_withenv).with(' --query --scope fencing-topology', {}).returns(6) 145 provider.class.stubs(:exec_withenv).with(' --query --scope fencing-topology', {}).returns(6)
146 provider.exists?.should be_false 146 provider.exists?.should be_falsey
147 end 147 end
148 end 148 end
149end 149end
diff --git a/deployment_scripts/puppet/modules/pcs_fencing/spec/unit/puppet/type/cs_fencetopo_spec.rb b/deployment_scripts/puppet/modules/pcs_fencing/spec/unit/puppet/type/cs_fencetopo_spec.rb
index 9d29091..e80eb63 100644
--- a/deployment_scripts/puppet/modules/pcs_fencing/spec/unit/puppet/type/cs_fencetopo_spec.rb
+++ b/deployment_scripts/puppet/modules/pcs_fencing/spec/unit/puppet/type/cs_fencetopo_spec.rb
@@ -71,7 +71,7 @@ describe Puppet::Type.type(:cs_fencetopo) do
71 71
72 [:cib, :name ].each do |param| 72 [:cib, :name ].each do |param|
73 it "should have a #{param} parameter" do 73 it "should have a #{param} parameter" do
74 subject.validparameter?(param).should be_true 74 subject.validparameter?(param).should be_truthy
75 end 75 end
76 76
77 it "should have documentation for its #{param} parameter" do 77 it "should have documentation for its #{param} parameter" do
@@ -81,7 +81,7 @@ describe Puppet::Type.type(:cs_fencetopo) do
81 81
82 [ :nodes, :fence_topology ].each do |prop| 82 [ :nodes, :fence_topology ].each do |prop|
83 it "should have a #{prop} property" do 83 it "should have a #{prop} property" do
84 subject.validproperty?(prop).should be_true 84 subject.validproperty?(prop).should be_truthy
85 end 85 end
86 86
87 it "should have documentation for its #{prop} property" do 87 it "should have documentation for its #{prop} property" do
diff --git a/modules.disable_rspec b/modules.disable_rspec
new file mode 100644
index 0000000..73aa0aa
--- /dev/null
+++ b/modules.disable_rspec
@@ -0,0 +1 @@
pacemaker
diff --git a/pre_build_hook b/pre_build_hook
index d9d91db..c740a68 100755
--- a/pre_build_hook
+++ b/pre_build_hook
@@ -4,23 +4,30 @@ set -eux
4 4
5ROOT="$(dirname `readlink -f $0`)" 5ROOT="$(dirname `readlink -f $0`)"
6MODULES="${ROOT}"/deployment_scripts/puppet/modules/ 6MODULES="${ROOT}"/deployment_scripts/puppet/modules/
7TMP_DIR="${ROOT}"/tmp 7TMP_DIR="${ROOT}"/tmp/
8mkdir -p "${MODULES}" 8mkdir -p "${MODULES}"
9mkdir -p "${TMP_DIR}" 9mkdir -p "${TMP_DIR}"
10#Puppetlabs/stdlib 4.5.0 10#Puppetlabs/stdlib 4.5.0
11REPO_PATH='https://github.com/puppetlabs/puppetlabs-stdlib/tarball/80f09623b63cf6946b5913b629911e2c49b5d1dd' 11REPO_PATH='https://github.com/puppetlabs/puppetlabs-stdlib/tarball/80f09623b63cf6946b5913b629911e2c49b5d1dd'
12 12
13wget -qO- "${REPO_PATH}" | \ 13wget -qO- "${REPO_PATH}" | \
14 tar -C "${MODULES}" -zxvf - \ 14 tar -C "${TMP_DIR}" -zxvf - \
15 puppetlabs-puppetlabs-stdlib-80f0962 && \ 15 puppetlabs-puppetlabs-stdlib-80f0962 && \
16 mv "${MODULES}puppetlabs-puppetlabs-stdlib-80f0962" "${MODULES}stdlib" 16 cp -Rf "${TMP_DIR}puppetlabs-puppetlabs-stdlib-80f0962" "${MODULES}stdlib"
17 17
18#Fuel 5.1.1 puppet-corosync 18#Puppet-community/puppet-corosync 0.8.0
19REPO_PATH='https://github.com/openstack/fuel-library/tarball/a3043477337b4a0a8fd166dc83d6cd5d504f5da8' 19REPO_PATH='https://github.com/puppet-community/puppet-corosync/tarball/88e267b00add700aeb0f4dae301bd327a8b18b54'
20MODULES="${ROOT}"/deployment_scripts/puppet/modules/
21 20
22wget -qO- "${REPO_PATH}" | \ 21wget -qO- "${REPO_PATH}" | \
23 tar -C "${MODULES}" --strip-components=3 -zxvf - \ 22 tar -C "${TMP_DIR}" -zxvf - \
24 openstack-fuel-library-a304347/deployment/puppet/corosync 23 puppet-community-puppet-corosync-88e267b && \
24 cp -Rf "${TMP_DIR}puppet-community-puppet-corosync-88e267b" "${MODULES}corosync"
25
26#Fuel 7.0 pacemaker
27REPO_PATH='https://github.com/openstack/fuel-library/tarball/5d50055aeca1dd0dc53b43825dc4c8f7780be9dd'
25 28
29wget -qO- "${REPO_PATH}" | \
30 tar -C "${TMP_DIR}" --strip-components=3 -zxvf - \
31 openstack-fuel-library-5d50055 && \
32 cp -Rf "${TMP_DIR}pacemaker" "${MODULES}pacemaker"
26 33