Don't test mode and symlinks on windows

This commit is contained in:
Morgan Haskel 2014-10-03 15:01:20 -04:00
parent 3ed9715731
commit bc727a7a62
2 changed files with 13 additions and 14 deletions

View file

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

View file

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