Showing with 76 additions and 30 deletions.
  1. +0 −1 .gitignore
  2. +3 −1 .sync.yml
  3. +0 −3 .travis.yml
  4. +6 −1 CHANGELOG.md
  5. +19 −2 Gemfile
  6. +0 −1 appveyor.yml
  7. +5 −1 metadata.json
  8. +1 −1 spec/defines/config_spec.rb
  9. +3 −0 spec/spec_helper.rb
  10. +20 −19 spec/spec_helper_acceptance.rb
  11. +19 −0 spec/sql_testing_helpers.rb
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
pkg/
Gemfile.lock
Gemfile.local
vendor/
spec/fixtures/
log/
junit/
Expand Down
4 changes: 3 additions & 1 deletion .sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@ Gemfile:
required:
':development':
- gem: rake
version: '~>10.1'
- gem: rspec
version: '~>3.0.0'
version: '~>3.0'
- gem: puppet-lint
- gem: puppetlabs_spec_helper
version: '~>0.10.3'
- gem: puppet_facts
- gem: mocha
version: '~>0.10.5'
- gem: pry
- gem: simplecov
- gem: yard
':system_tests':
Expand Down
3 changes: 0 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,5 @@ matrix:
env: PUPPET_GEM_VERSION="3.7.0"
- rvm: 2.0.0
env: PUPPET_GEM_VERSION="3.7.0"
allow_failures:
- rvm: 2.1.5
env: PUPPET_GEM_VERSION="~> 4.0"
notifications:
email: false
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
##Supported Release 1.1.1
##2016-04-06 - Supported Release 1.1.2
###Summary

Small release to support Puppet version ranges.

##2015-12-08 - Supported Release 1.1.1
###Summary

Small release for support of newer PE versions.
Expand Down
21 changes: 19 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,24 @@ def location_for(place_or_version, fake_version = nil)
end
end

# The following gems are not included by default as they require DevKit on Windows.
# You should probably include them in a Gemfile.local or a ~/.gemfile
#gem 'pry' #this may already be included in the gemfile
#gem 'pry-stack_explorer', :require => false
#if RUBY_VERSION =~ /^2/
# gem 'pry-byebug'
#else
# gem 'pry-debugger'
#end

group :development do
gem 'rake', :require => false
gem 'rspec', '~>3.0.0', :require => false
gem 'rake', '~>10.1', :require => false
gem 'rspec', '~>3.0', :require => false
gem 'puppet-lint', :require => false
gem 'puppetlabs_spec_helper', '~>0.10.3', :require => false
gem 'puppet_facts', :require => false
gem 'mocha', '~>0.10.5', :require => false
gem 'pry', :require => false
gem 'simplecov', :require => false
gem 'yard', :require => false
end
Expand Down Expand Up @@ -110,8 +121,14 @@ if explicitly_require_windows_gems
gem "windows-pr", "1.2.3", :require => false
end

# Evaluate Gemfile.local if it exists
if File.exists? "#{__FILE__}.local"
eval(File.read("#{__FILE__}.local"), binding)
end

# Evaluate ~/.gemfile if it exists
if File.exists?(File.join(Dir.home, '.gemfile'))
eval(File.read(File.join(Dir.home, '.gemfile')), binding)
end

# vim:ft=ruby
1 change: 0 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ matrix:
fast_finish: true
install:
- SET PATH=C:\Ruby%RUBY_VER%\bin;%PATH%
- gem install bundler --quiet --no-ri --no-rdoc
- bundle install --jobs 4 --retry 2 --without system_tests
- type Gemfile.lock
build: off
Expand Down
6 changes: 5 additions & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "puppetlabs-sqlserver",
"version": "1.1.1",
"version": "1.1.2",
"author": "puppetlabs",
"summary": "The `sqlserver` module installs and manages MS SQL Server 2012 and 2014 on Windows systems.",
"license": "PuppetLabs-Enterprise",
Expand Down Expand Up @@ -30,6 +30,10 @@
{
"name": "pe",
"version_requirement": ">= 3.7.0 < 2015.4.0"
},
{
"name": "puppet",
"version_requirement": ">=3.7.0 < 5.0.0"
}
],
"dependencies": [
Expand Down
2 changes: 1 addition & 1 deletion spec/defines/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

RSpec.describe 'sqlserver::config', :type => :define do
let(:title) { 'MSSQLSERVER' }
let(:facts) { {:osfamily => 'windows', :platform => :windows, :puppet_vardir => 'C:/ProgramData/PuppetLabs/puppet/var'} }
let(:facts) { {:osfamily => 'windows', :platform => 'windows', :puppet_vardir => 'C:/ProgramData/PuppetLabs/puppet/var'} }

describe 'compile' do
let(:params) { {
Expand Down
3 changes: 3 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
RSpec.configure do |c|
c.module_path = File.join(fixture_path, 'modules')
c.manifest_dir = File.join(fixture_path, 'manifests')
c.expect_with :rspec do |e|
e.syntax = [:should, :expect]
end
end

SimpleCov.start do
Expand Down
39 changes: 20 additions & 19 deletions spec/spec_helper_acceptance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,37 +18,38 @@
end
end

# Install PE
run_puppet_install_helper

# Install PE License onto Master
install_pe_license(master)

unless ENV['MODULE_provision'] == 'no'
agents.each do |agent|
# Emit CommonProgramFiles environment variable
program_files = agent.get_env_var('ProgramFiles').split('=')[1]
agent.add_env_var('CommonProgramFiles', "#{program_files}\\Common Files")

# Install sqlserver module to agent
result = on agent, "echo #{agent['distmoduledir']}"
target = result.raw_output.chomp
proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
exec_puppet = <<-EOS
exec{'Download':
command => 'powershell.exe -command "Invoke-WebRequest https://forgeapi.puppetlabs.com"',
path => ['c:\\windows\\sysnative\\WindowsPowershell\\v1.0','c:\\windows\\system32\\WindowsPowershell\\v1.0'],
}
EOS
apply_manifest_on(agent, exec_puppet)
%w(puppetlabs/stdlib cyberious/pget).each do |dep|
on agent, puppet("module install #{dep}")
# Install Forge certs to allow for PMT installation.
install_ca_certs(agent)

# Install test helper modules onto agent.
%w(puppetlabs-mount_iso cyberious-pget).each do |dep|
on(agent, puppet("module install #{dep}"))
end
on agent, "git clone https://github.com/puppetlabs/puppetlabs-mount_iso #{target}/mount_iso"

install_ca_certs(agent)
# Determine root path of local module source.
proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))

# in CI install from staging forge, otherwise from local
# In CI install from staging forge, otherwise from local
staging = { :module_name => 'puppetlabs-sqlserver' }
local = { :module_name => 'sqlserver', :proj_root => proj_root, :target_module_path => target }
local = { :module_name => 'sqlserver', :source => proj_root }

install_dev_puppet_module_on(agent, options[:forge_host] ? staging : local)
# Install sqlserver dependencies.
on(agent, puppet('module install puppetlabs-stdlib'))

# Install sqlserver module from local source.
# See FM-5062 for more details.
copy_module_to(agent, local)
end
end

19 changes: 19 additions & 0 deletions spec/sql_testing_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -235,3 +235,22 @@ def install_ca_certs(host)
on host, "chmod 644 equifax.pem"
on host, "cmd /c certutil -v -addstore Root `cygpath -w equifax.pem`"
end

def install_pe_license(host)
# Init
license = <<-EOF
#######################
# Begin License File #
#######################
# PUPPET ENTERPRISE LICENSE - Puppet Labs
to: qa
nodes: 100
start: 2016-03-31
end: 2026-03-31
#####################
# End License File #
#####################
EOF

create_remote_file(host, '/etc/puppetlabs/license.key', license)
end