diff --git a/CHANGELOG.md b/CHANGELOG.md index f8898669b..54367bef3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/metadata.json b/metadata.json index 51f42f978..5a48a8fd4 100644 --- a/metadata.json +++ b/metadata.json @@ -43,7 +43,9 @@ { "operatingsystem": "SLES", "operatingsystemrelease": [ - "11 SP1" + "10 SP4", + "11 SP1", + "12" ] }, { diff --git a/spec/acceptance/concat_spec.rb b/spec/acceptance/concat_spec.rb index 10f72d91c..7cec1a5a0 100644 --- a/spec/acceptance/concat_spec.rb +++ b/spec/acceptance/concat_spec.rb @@ -42,49 +42,49 @@ 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 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 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 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' } diff --git a/spec/acceptance/deprecation_warnings_spec.rb b/spec/acceptance/deprecation_warnings_spec.rb index 7b0f5c50c..dc2f234d0 100644 --- a/spec/acceptance/deprecation_warnings_spec.rb +++ b/spec/acceptance/deprecation_warnings_spec.rb @@ -73,10 +73,9 @@ 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 @@ 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': diff --git a/spec/acceptance/replace_spec.rb b/spec/acceptance/replace_spec.rb index cc30d1250..688234548 100644 --- a/spec/acceptance/replace_spec.rb +++ b/spec/acceptance/replace_spec.rb @@ -126,7 +126,7 @@ 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 diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb index b34a188d6..713466e95 100644 --- a/spec/spec_helper_acceptance.rb +++ b/spec/spec_helper_acceptance.rb @@ -24,6 +24,10 @@ 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 diff --git a/spec/unit/classes/concat_setup_spec.rb b/spec/unit/classes/concat_setup_spec.rb index 3096e7368..b25428ef5 100644 --- a/spec/unit/classes/concat_setup_spec.rb +++ b/spec/unit/classes/concat_setup_spec.rb @@ -5,7 +5,14 @@ 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 @@ 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 @@ concatdir = '/foo' let(:facts) do { - :concat_basedir => concatdir, - :osfamily => 'windows', - :id => 'batman', + :concat_basedir => concatdir, + :caller_module_name => 'Test', + :osfamily => 'windows', + :id => 'batman', } end diff --git a/spec/unit/defines/concat_fragment_spec.rb b/spec/unit/defines/concat_fragment_spec.rb index 3c61aabf7..64ae7dbdf 100644 --- a/spec/unit/defines/concat_fragment_spec.rb +++ b/spec/unit/defines/concat_fragment_spec.rb @@ -24,7 +24,14 @@ 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 @@ 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 @@ 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 @@ 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', diff --git a/spec/unit/defines/concat_spec.rb b/spec/unit/defines/concat_spec.rb index e7be4d570..7682cdf0b 100644 --- a/spec/unit/defines/concat_spec.rb +++ b/spec/unit/defines/concat_spec.rb @@ -33,7 +33,15 @@ 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