Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9696158
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
6 KB
Subscribers
None
View Options
diff --git a/Gemfile b/Gemfile
index f3f9bc3..559cff6 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,32 +1,33 @@
source 'https://rubygems.org'
puppetversion = ENV['PUPPET_VERSION'] || '~> 3.8.0'
gem 'puppet', puppetversion, :require => false
gem 'beaker'
gem 'beaker-rspec'
gem 'metadata-json-lint'
gem 'rspec-puppet'
+gem 'specinfra', '>= 2.55'
gem 'pry'
gem 'docker-api', '~> 1.0'
gem 'rubysl-securerandom'
gem 'ci_reporter_rspec'
gem 'rspec', '~> 3.0'
gem 'rake'
gem 'puppet-doc-lint'
gem 'puppet-lint'
gem 'puppetlabs_spec_helper'
gem 'puppet-syntax'
gem 'rspec-puppet-facts'
gem 'webmock'
# Extra Puppet-lint gems
gem 'puppet-lint-appends-check', :require => false
gem 'puppet-lint-version_comparison-check', :require => false
gem 'puppet-lint-unquoted_string-check', :require => false
gem 'puppet-lint-undef_in_function-check', :require => false
gem 'puppet-lint-trailing_comma-check', :require => false
gem 'puppet-lint-leading_zero-check', :require => false
gem 'puppet-lint-file_ensure-check', :require => false
gem 'puppet-lint-empty_string-check', :require => false
diff --git a/Makefile b/Makefile
index 4bca8d7..ac65271 100644
--- a/Makefile
+++ b/Makefile
@@ -1,46 +1,51 @@
DISTRO ?= ubuntu-server-1404-x64
+PUPPET_VERSION ?= 3.8.6
PE ?= false
ifeq ($(PE), true)
PE_VER ?= 3.8.0
BEAKER_PE_VER := $(PE_VER)
BEAKER_IS_PE := $(PE)
export BEAKER_PE_VER
export BEAKER_IS_PE
endif
-.vendor:
+.DEFAULT_GOAL := bundle
+
+.PHONY: bundle
+bundle:
+ bundle update || true
bundle install --path .vendor
.PHONY: clean
clean:
bundle exec rake spec_clean
bundle exec rake artifacts:clean
rm -rf .bundle .vendor
.PHONY: test-intake
test-intake: test-docs test-rspec
.PHONY: test-acceptance
-test-acceptance: .vendor
+test-acceptance: bundle
BEAKER_PE_DIR=spec/fixtures/artifacts \
BEAKER_set=$(DISTRO) \
bundle exec rake beaker:acceptance
.PHONY: test-integration
-test-integration: .vendor
+test-integration: bundle
BEAKER_PE_DIR=spec/fixtures/artifacts \
BEAKER_PE_VER=$(PE_VER) \
BEAKER_IS_PE=$(PE) \
BEAKER_set=$(DISTRO) \
bundle exec rake beaker:integration
.PHONY: test-docs
-test-docs: .vendor
+test-docs: bundle
bundle exec rake parse_doc
.PHONY: test-rspec
-test-rspec: .vendor
+test-rspec: bundle
bundle exec rake lint
bundle exec rake validate
bundle exec rake spec_verbose
diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb
index b0e0d2e..418e594 100644
--- a/spec/spec_helper_acceptance.rb
+++ b/spec/spec_helper_acceptance.rb
@@ -1,141 +1,145 @@
require 'beaker-rspec'
require 'pry'
require 'securerandom'
require_relative 'spec_acceptance_integration'
def test_settings
RSpec.configuration.test_settings
end
RSpec.configure do |c|
c.add_setting :test_settings, :default => {}
end
files_dir = ENV['files_dir'] || './spec/fixtures/artifacts'
+puppet_version = ENV['PUPPET_VERSION'] || '3.8.6'
hosts.each do |host|
# Install Puppet
if host.is_pe?
install_pe
else
- install_puppet_on host, :default_action => 'gem_install'
+ install_puppet_on host, {
+ :version => puppet_version,
+ :default_action => 'gem_install',
+ }
if fact('osfamily') == 'Suse'
install_package host, 'augeas-devel libxml2-devel'
install_package host, '-t pattern devel_ruby'
on host, "gem install ruby-augeas --no-ri --no-rdoc"
end
if host[:type] == 'aio'
on host, "mkdir -p /var/log/puppetlabs/puppet"
end
end
if ENV['ES_VERSION']
case fact('osfamily')
when 'RedHat'
if ENV['ES_VERSION'][0,1] == '1'
ext='noarch.rpm'
else
ext='rpm'
end
when 'Debian'
ext='deb'
when 'Suse'
ext='rpm'
end
url = get_url
RSpec.configuration.test_settings['snapshot_package'] = url.gsub('$EXT$', ext)
else
case fact('osfamily')
when 'RedHat'
package_name = 'elasticsearch-1.3.1.noarch.rpm'
when 'Debian'
case fact('lsbmajdistrelease')
when '6'
package_name = 'elasticsearch-1.1.0.deb'
else
package_name = 'elasticsearch-1.3.1.deb'
end
when 'Suse'
case fact('operatingsystem')
when 'OpenSuSE'
package_name = 'elasticsearch-1.3.1.noarch.rpm'
end
end
snapshot_package = {
:src => "#{files_dir}/#{package_name}",
:dst => "/tmp/#{package_name}"
}
scp_to(host, snapshot_package[:src], snapshot_package[:dst])
scp_to(host, "#{files_dir}/elasticsearch-bigdesk.zip", "/tmp/elasticsearch-bigdesk.zip")
scp_to(host, "#{files_dir}/elasticsearch-kopf.zip", "/tmp/elasticsearch-kopf.zip")
RSpec.configuration.test_settings['snapshot_package'] = "file:#{snapshot_package[:dst]}"
end
end
RSpec.configure do |c|
# Readable test descriptions
c.formatter = :documentation
# Configure all nodes in nodeset
c.before :suite do
# Install module and dependencies
install_dev_puppet_module :ignore_list => [
'junit'
] + Beaker::DSL::InstallUtils::ModuleUtils::PUPPET_MODULE_INSTALL_IGNORE
hosts.each do |host|
copy_hiera_data_to(host, 'spec/fixtures/hiera/hieradata/')
modules = ['stdlib', 'java', 'datacat']
dist_module = {
'Debian' => 'apt',
'Suse' => 'zypprepo',
'RedHat' => 'yum',
}[fact('osfamily')]
modules << dist_module if not dist_module.nil?
modules.each do |mod|
copy_module_to host, {
:module_name => mod,
:source => "spec/fixtures/modules/#{mod}"
}
end
if host.is_pe?
on(host, 'sed -i -e "s/PATH=PATH:\/opt\/puppet\/bin:/PATH=PATH:/" ~/.ssh/environment')
end
on(host, 'mkdir -p etc/puppet/modules/another/files/')
end
end
c.after :suite do
if ENV['ES_VERSION']
hosts.each do |host|
timestamp = Time.now
log_dir = File.join('./spec/logs', timestamp.strftime("%F_%H_%M_%S"))
FileUtils.mkdir_p(log_dir) unless File.directory?(log_dir)
scp_from(host, '/var/log/elasticsearch', log_dir)
end
end
end
end
require_relative 'spec_acceptance_common'
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Mon, Aug 18, 7:10 PM (2 w, 13 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3354645
Attached To
R150 puppet-elastic-elasticsearch
Event Timeline
Log In to Comment