Merge pull request #239 from mhaskel/pull_master_to_1.1.x

Pull master to 1.1.x
This commit is contained in:
Travis Fields 2014-10-24 15:04:43 -07:00
commit 73c7896632
9 changed files with 77 additions and 30 deletions

View file

@ -8,7 +8,7 @@ This is a bugfix release, and the first supported release of the 1.1.x series.
- Make the `$order` parameter default to a string and be validated as an integer
or a string
- Use the ruby script on Solaris to not break Sol10 support
- Add quotes to the ryby script location for Windows
- Add quotes to the ruby script location for Windows
- Fix typos in README.md
- Make regex in concat::setup case-insensitive to make it work on Windows
- Make sure concat fragments are always replaced

View file

@ -43,7 +43,9 @@
{
"operatingsystem": "SLES",
"operatingsystemrelease": [
"11 SP1"
"10 SP4",
"11 SP1",
"12"
]
},
{

View file

@ -42,49 +42,49 @@ describe 'basic concat test' do
describe file("#{vardir}/concat") do
it { should be_directory }
it { should be_owned_by username }
it("should be mode", :unless => (fact('osfamily') == 'AIX')) {
it("should be mode", :unless => (fact('osfamily') == 'AIX' or fact('osfamily') == 'windows')) {
should be_mode 755
}
end
describe file("#{vardir}/concat/bin") do
it { should be_directory }
it { should be_owned_by username }
it("should be mode", :unless => (fact('osfamily') == 'AIX')) {
it("should be mode", :unless => (fact('osfamily') == 'AIX' or fact('osfamily') == 'windows')) {
should be_mode 755
}
end
describe file("#{vardir}/concat/bin/#{scriptname}") do
it { should be_file }
it { should be_owned_by username }
it("should be mode", :unless => (fact('osfamily') == 'AIX')) {
it("should be mode", :unless => (fact('osfamily') == 'AIX' or fact('osfamily') == 'windows')) {
should be_mode 755
}
end
describe file("#{vardir}/concat/#{safe_basedir}_file") do
it { should be_directory }
it { should be_owned_by username }
it("should be mode", :unless => (fact('osfamily') == 'AIX')) {
it("should be mode", :unless => (fact('osfamily') == 'AIX' or fact('osfamily') == 'windows')) {
should be_mode 750
}
end
describe file("#{vardir}/concat/#{safe_basedir}_file/fragments") do
it { should be_directory }
it { should be_owned_by username }
it("should be mode", :unless => (fact('osfamily') == 'AIX')) {
it("should be mode", :unless => (fact('osfamily') == 'AIX' or fact('osfamily') == 'windows')) {
should be_mode 750
}
end
describe file("#{vardir}/concat/#{safe_basedir}_file/fragments.concat") do
it { should be_file }
it { should be_owned_by username }
it("should be mode", :unless => (fact('osfamily') == 'AIX')) {
it("should be mode", :unless => (fact('osfamily') == 'AIX' or fact('osfamily') == 'windows')) {
should be_mode 640
}
end
describe file("#{vardir}/concat/#{safe_basedir}_file/fragments.concat.out") do
it { should be_file }
it { should be_owned_by username }
it("should be mode", :unless => (fact('osfamily') == 'AIX')) {
it("should be mode", :unless => (fact('osfamily') == 'AIX' or fact('osfamily') == 'windows')) {
should be_mode 640
}
end
@ -124,8 +124,8 @@ describe 'basic concat test' do
describe file("#{basedir}/file") do
it { should be_file }
it { should be_owned_by username }
it { should be_grouped_into groupname }
it("should be mode", :unless => (fact('osfamily') == 'AIX')) {
it("should be group", :unless => (fact('osfamily') == 'windows')) { should be_grouped_into groupname }
it("should be mode", :unless => (fact('osfamily') == 'AIX' or fact('osfamily') == 'windows')) {
should be_mode 644
}
it { should contain '1' }
@ -134,14 +134,14 @@ describe 'basic concat test' do
describe file("#{vardir}/concat/#{safe_basedir}_file/fragments/01_1") do
it { should be_file }
it { should be_owned_by username }
it("should be mode", :unless => (fact('osfamily') == 'AIX')) {
it("should be mode", :unless => (fact('osfamily') == 'AIX' or fact('osfamily') == 'windows')) {
should be_mode 640
}
end
describe file("#{vardir}/concat/#{safe_basedir}_file/fragments/02_2") do
it { should be_file }
it { should be_owned_by username }
it("should be mode", :unless => (fact('osfamily') == 'AIX')) {
it("should be mode", :unless => (fact('osfamily') == 'AIX' or fact('osfamily') == 'windows')) {
should be_mode 640
}
end
@ -174,7 +174,7 @@ describe 'basic concat test' do
describe file("#{basedir}/file") do
it { should be_file }
it("should be mode", :unless => (fact('osfamily') == 'AIX')) {
it("should be mode", :unless => (fact('osfamily') == 'AIX' or fact('osfamily') == 'windows')) {
should be_mode 644
}
it { should contain '1' }

View file

@ -73,10 +73,9 @@ describe 'deprecation warnings' do
end
end
context 'concat::fragment ensure parameter' do
context 'concat::fragment ensure parameter', :unless => fact('osfamily') == 'windows' do
context 'target file exists' do
before(:all) do
shell("/bin/echo 'file1 contents' > #{basedir}/file1")
pp = <<-EOS
file { '#{basedir}':
ensure => directory,
@ -126,7 +125,7 @@ describe 'deprecation warnings' do
end
end # target file exists
context 'target does not exist' do
context 'target does not exist', :unless => fact('osfamily') == 'windows' do
pp = <<-EOS
concat { '#{basedir}/file': }
concat::fragment { 'foo':

View file

@ -126,7 +126,7 @@ describe 'replacement of' do
end
# XXX specinfra doesn't support be_linked_to on AIX
describe file("#{basedir}/file"), :unless => (fact("osfamily") == "AIX") do
describe file("#{basedir}/file"), :unless => (fact("osfamily") == "AIX" or fact("osfamily") == "windows") do
it { should be_linked_to "#{basedir}/dangling" }
end

View file

@ -24,6 +24,10 @@ RSpec.configure do |c|
c.before :suite do
# Install module and dependencies
hosts.each do |host|
if fact_on(host, 'osfamily') == 'windows'
on host, 'powershell.exe -command "(New-Object System.Net.Webclient).DownloadString(\'https://forge.puppetlabs.com\')"'
end
on host, "mkdir -p #{host['distmoduledir']}/concat"
result = on host, "echo #{host['distmoduledir']}/concat"
target = result.raw_output.chomp

View file

@ -5,7 +5,14 @@ describe 'concat::setup', :type => :class do
shared_examples 'setup' do |concatdir|
concatdir = '/foo' if concatdir.nil?
let(:facts) {{ :concat_basedir => concatdir }}
let(:facts) do
{
:concat_basedir => concatdir,
:caller_module_name => 'Test',
:osfamily => 'Debian',
:id => 'root',
}
end
it do
should contain_file("#{concatdir}/bin/concatfragments.sh").with({
@ -44,9 +51,10 @@ describe 'concat::setup', :type => :class do
concatdir = '/foo'
let(:facts) do
{
:concat_basedir => concatdir,
:osfamily => 'Solaris',
:id => 'root',
:concat_basedir => concatdir,
:caller_module_name => 'Test',
:osfamily => 'Solaris',
:id => 'root',
}
end
@ -65,9 +73,10 @@ describe 'concat::setup', :type => :class do
concatdir = '/foo'
let(:facts) do
{
:concat_basedir => concatdir,
:osfamily => 'windows',
:id => 'batman',
:concat_basedir => concatdir,
:caller_module_name => 'Test',
:osfamily => 'windows',
:id => 'batman',
}
end

View file

@ -24,7 +24,14 @@ describe 'concat::fragment', :type => :define do
end
let(:title) { title }
let(:facts) {{ :concat_basedir => concatdir, :id => id }}
let(:facts) do
{
:concat_basedir => concatdir,
:id => id,
:osfamily => 'Debian',
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end
let(:params) { params }
let(:pre_condition) do
"concat{ '#{p[:target]}': }"
@ -162,7 +169,13 @@ describe 'concat::fragment', :type => :define do
context 'ensure => target and source' do
let(:title) { 'motd_header' }
let(:facts) {{ :concat_basedir => '/tmp' }}
let(:facts) do
{
:concat_basedir => '/tmp',
:osfamily => 'Debian',
:id => 'root',
}
end
let(:params) do
{
:target => '/etc/motd',
@ -178,7 +191,13 @@ describe 'concat::fragment', :type => :define do
context 'ensure => target and content' do
let(:title) { 'motd_header' }
let(:facts) {{ :concat_basedir => '/tmp' }}
let(:facts) do
{
:concat_basedir => '/tmp',
:osfamily => 'Debian',
:id => 'root',
}
end
let(:params) do
{
:target => '/etc/motd',
@ -194,7 +213,13 @@ describe 'concat::fragment', :type => :define do
context 'source and content' do
let(:title) { 'motd_header' }
let(:facts) {{ :concat_basedir => '/tmp' }}
let(:facts) do
{
:concat_basedir => '/tmp',
:osfamily => 'Debian',
:id => 'root',
}
end
let(:params) do
{
:target => '/etc/motd',

View file

@ -33,7 +33,15 @@ describe 'concat', :type => :define do
let(:title) { title }
let(:params) { params }
let(:facts) {{ :concat_basedir => concatdir, :id => id }}
let(:facts) do
{
:concat_basedir => concatdir,
:id => id,
:osfamily => 'Debian',
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
:kernel => 'Linux',
}
end
if p[:ensure] == 'present'
it do