Add windows as unsupported
This commit is contained in:
parent
6929c709f9
commit
1577ec78e1
12 changed files with 46 additions and 18 deletions
|
@ -18,6 +18,14 @@
|
||||||
# It also copies out the concatfragments.sh file to ${concatdir}/bin
|
# It also copies out the concatfragments.sh file to ${concatdir}/bin
|
||||||
#
|
#
|
||||||
class concat::setup {
|
class concat::setup {
|
||||||
|
case $::osfamily {
|
||||||
|
'windows': {
|
||||||
|
fail("Unsupported osfamily: ${osfamily}")
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
# Should work otherwise
|
||||||
|
}
|
||||||
|
}
|
||||||
$id = $::id
|
$id = $::id
|
||||||
$root_group = $id ? {
|
$root_group = $id ? {
|
||||||
root => 0,
|
root => 0,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
require 'spec_helper_acceptance'
|
require 'spec_helper_acceptance'
|
||||||
|
|
||||||
describe 'concat backup parameter' do
|
describe 'concat backup parameter', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
|
||||||
basedir = default.tmpdir('concat')
|
basedir = default.tmpdir('concat')
|
||||||
context '=> puppet' do
|
context '=> puppet' do
|
||||||
before :all do
|
before :all do
|
||||||
|
|
|
@ -12,7 +12,7 @@ else
|
||||||
groupname = 'root'
|
groupname = 'root'
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'basic concat test' do
|
describe 'basic concat test', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
|
||||||
basedir = default.tmpdir('concat')
|
basedir = default.tmpdir('concat')
|
||||||
|
|
||||||
shared_examples 'successfully_applied' do |pp|
|
shared_examples 'successfully_applied' do |pp|
|
||||||
|
@ -51,7 +51,7 @@ describe 'basic concat test' do
|
||||||
it { should be_owned_by username }
|
it { should be_owned_by username }
|
||||||
it { should be_grouped_into groupname }
|
it { should be_grouped_into groupname }
|
||||||
# XXX file be_mode isn't supported on AIX
|
# XXX file be_mode isn't supported on AIX
|
||||||
it("should be mode 644", :unless => fact('osfamily') == "AIX") {
|
it("should be mode 644", :unless => (fact('osfamily') == "AIX" or UNSUPPORTED_PLATFORMS.include?(fact('osfamily')))) {
|
||||||
should be_mode 644
|
should be_mode 644
|
||||||
}
|
}
|
||||||
it { should contain '1' }
|
it { should contain '1' }
|
||||||
|
@ -62,7 +62,7 @@ describe 'basic concat test' do
|
||||||
it { should be_owned_by username }
|
it { should be_owned_by username }
|
||||||
it { should be_grouped_into groupname }
|
it { should be_grouped_into groupname }
|
||||||
# XXX file be_mode isn't supported on AIX
|
# XXX file be_mode isn't supported on AIX
|
||||||
it("should be mode 644", :unless => fact('osfamily') == "AIX") {
|
it("should be mode 644", :unless => (fact('osfamily') == "AIX" or UNSUPPORTED_PLATFORMS.include?(fact('osfamily')))) {
|
||||||
should be_mode 644
|
should be_mode 644
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
@ -71,7 +71,7 @@ describe 'basic concat test' do
|
||||||
it { should be_owned_by username }
|
it { should be_owned_by username }
|
||||||
it { should be_grouped_into groupname }
|
it { should be_grouped_into groupname }
|
||||||
# XXX file be_mode isn't supported on AIX
|
# XXX file be_mode isn't supported on AIX
|
||||||
it("should be mode 644", :unless => fact('osfamily') == "AIX") {
|
it("should be mode 644", :unless => (fact('osfamily') == "AIX" or UNSUPPORTED_PLATFORMS.include?(fact('osfamily')))) {
|
||||||
should be_mode 644
|
should be_mode 644
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
require 'spec_helper_acceptance'
|
require 'spec_helper_acceptance'
|
||||||
|
|
||||||
describe 'concat force empty parameter' do
|
describe 'concat force empty parameter', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
|
||||||
basedir = default.tmpdir('concat')
|
basedir = default.tmpdir('concat')
|
||||||
context 'should run successfully' do
|
context 'should run successfully' do
|
||||||
pp = <<-EOS
|
pp = <<-EOS
|
||||||
|
|
|
@ -12,7 +12,7 @@ else
|
||||||
groupname = 'root'
|
groupname = 'root'
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'concat::fragment source' do
|
describe 'concat::fragment source', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
|
||||||
basedir = default.tmpdir('concat')
|
basedir = default.tmpdir('concat')
|
||||||
context 'should read file fragments from local system' do
|
context 'should read file fragments from local system' do
|
||||||
before(:all) do
|
before(:all) do
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
require 'spec_helper_acceptance'
|
require 'spec_helper_acceptance'
|
||||||
|
|
||||||
describe 'concat ensure_newline parameter' do
|
describe 'concat ensure_newline parameter', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
|
||||||
basedir = default.tmpdir('concat')
|
basedir = default.tmpdir('concat')
|
||||||
context '=> false' do
|
context '=> false' do
|
||||||
pp = <<-EOS
|
pp = <<-EOS
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
require 'spec_helper_acceptance'
|
require 'spec_helper_acceptance'
|
||||||
|
|
||||||
describe 'concat order' do
|
describe 'concat order', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
|
||||||
basedir = default.tmpdir('concat')
|
basedir = default.tmpdir('concat')
|
||||||
before(:all) do
|
before(:all) do
|
||||||
shell("rm -rf #{basedir} #{default.puppet['vardir']}/concat")
|
shell("rm -rf #{basedir} #{default.puppet['vardir']}/concat")
|
||||||
|
@ -35,7 +35,7 @@ describe 'concat order' do
|
||||||
describe file("#{basedir}/foo") do
|
describe file("#{basedir}/foo") do
|
||||||
it { should be_file }
|
it { should be_file }
|
||||||
#XXX Solaris 10 doesn't support multi-line grep
|
#XXX Solaris 10 doesn't support multi-line grep
|
||||||
it("should contain string10\nstring1\nsring2", :unless => fact('osfamily') == 'Solaris') {
|
it("should contain string10\nstring1\nsring2", :unless => (fact('osfamily') == 'Solaris' or UNSUPPORTED_PLATFORMS.include?(fact('osfamily')))) {
|
||||||
should contain "string10\nstring1\nsring2"
|
should contain "string10\nstring1\nsring2"
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
@ -69,14 +69,14 @@ describe 'concat order' do
|
||||||
describe file("#{basedir}/foo") do
|
describe file("#{basedir}/foo") do
|
||||||
it { should be_file }
|
it { should be_file }
|
||||||
#XXX Solaris 10 doesn't support multi-line grep
|
#XXX Solaris 10 doesn't support multi-line grep
|
||||||
it("should contain string1\nstring2\nsring10", :unless => fact('osfamily') == 'Solaris') {
|
it("should contain string1\nstring2\nsring10", :unless => (fact('osfamily') == 'Solaris' or UNSUPPORTED_PLATFORMS.include?(fact('osfamily')))) {
|
||||||
should contain "string1\nstring2\nsring10"
|
should contain "string1\nstring2\nsring10"
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end # concat order
|
end # concat order
|
||||||
|
|
||||||
describe 'concat::fragment order' do
|
describe 'concat::fragment order', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
|
||||||
basedir = default.tmpdir('concat')
|
basedir = default.tmpdir('concat')
|
||||||
before(:all) do
|
before(:all) do
|
||||||
shell("rm -rf #{basedir} #{default.puppet['vardir']}/concat")
|
shell("rm -rf #{basedir} #{default.puppet['vardir']}/concat")
|
||||||
|
@ -112,7 +112,7 @@ describe 'concat::fragment order' do
|
||||||
describe file("#{basedir}/foo") do
|
describe file("#{basedir}/foo") do
|
||||||
it { should be_file }
|
it { should be_file }
|
||||||
#XXX Solaris 10 doesn't support multi-line grep
|
#XXX Solaris 10 doesn't support multi-line grep
|
||||||
it("should contain string3\nstring2\nsring1", :unless => fact('osfamily') == 'Solaris') {
|
it("should contain string3\nstring2\nsring1", :unless => (fact('osfamily') == 'Solaris' or UNSUPPORTED_PLATFORMS.include?(fact('osfamily')))) {
|
||||||
should contain "string3\nstring2\nsring1"
|
should contain "string3\nstring2\nsring1"
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
@ -147,7 +147,7 @@ describe 'concat::fragment order' do
|
||||||
describe file("#{basedir}/foo") do
|
describe file("#{basedir}/foo") do
|
||||||
it { should be_file }
|
it { should be_file }
|
||||||
#XXX Solaris 10 doesn't support multi-line grep
|
#XXX Solaris 10 doesn't support multi-line grep
|
||||||
it("should contain string1\nstring2\nsring3", :unless => fact('osfamily') == 'Solaris') {
|
it("should contain string1\nstring2\nsring3", :unless => (fact('osfamily') == 'Solaris' or UNSUPPORTED_PLATFORMS.include?(fact('osfamily')))) {
|
||||||
should contain "string1\nstring2\nsring3"
|
should contain "string1\nstring2\nsring3"
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
require 'spec_helper_acceptance'
|
require 'spec_helper_acceptance'
|
||||||
|
|
||||||
describe 'replacement of' do
|
describe 'replacement of', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
|
||||||
basedir = default.tmpdir('concat')
|
basedir = default.tmpdir('concat')
|
||||||
context 'file' do
|
context 'file' do
|
||||||
context 'should not succeed' do
|
context 'should not succeed' do
|
||||||
|
@ -118,7 +118,7 @@ describe 'replacement of' do
|
||||||
end
|
end
|
||||||
|
|
||||||
# XXX specinfra doesn't support be_linked_to on AIX
|
# 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 UNSUPPORTED_PLATFORMS.include?(fact('osfamily'))) do
|
||||||
it { should be_linked_to "#{basedir}/dangling" }
|
it { should be_linked_to "#{basedir}/dangling" }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
require 'spec_helper_acceptance'
|
require 'spec_helper_acceptance'
|
||||||
|
|
||||||
describe 'symbolic name' do
|
describe 'symbolic name', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
|
||||||
basedir = default.tmpdir('concat')
|
basedir = default.tmpdir('concat')
|
||||||
pp = <<-EOS
|
pp = <<-EOS
|
||||||
include concat::setup
|
include concat::setup
|
||||||
|
|
18
spec/acceptance/unsupported_spec.rb
Normal file
18
spec/acceptance/unsupported_spec.rb
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
require 'spec_helper_acceptance'
|
||||||
|
|
||||||
|
describe 'unsupported distributions and OSes', :if => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
|
||||||
|
basedir = default.tmpdir('concat')
|
||||||
|
it 'should fail' do
|
||||||
|
pp = <<-EOS
|
||||||
|
include concat::setup
|
||||||
|
concat { '#{basedir}/file':
|
||||||
|
backup => 'puppet',
|
||||||
|
}
|
||||||
|
concat::fragment { 'new file':
|
||||||
|
target => '#{basedir}/file',
|
||||||
|
content => 'new contents',
|
||||||
|
}
|
||||||
|
EOS
|
||||||
|
expect(apply_manifest(pp, :expect_failures => true).stderr).to match(/unsupported/i)
|
||||||
|
end
|
||||||
|
end
|
|
@ -1,6 +1,6 @@
|
||||||
require 'spec_helper_acceptance'
|
require 'spec_helper_acceptance'
|
||||||
|
|
||||||
describe 'concat warn =>' do
|
describe 'concat warn =>', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
|
||||||
basedir = default.tmpdir('concat')
|
basedir = default.tmpdir('concat')
|
||||||
context 'true should enable default warning message' do
|
context 'true should enable default warning message' do
|
||||||
pp = <<-EOS
|
pp = <<-EOS
|
||||||
|
|
|
@ -17,6 +17,8 @@ unless ENV['RS_PROVISION'] == 'no'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
UNSUPPORTED_PLATFORMS = ['windows']
|
||||||
|
|
||||||
RSpec.configure do |c|
|
RSpec.configure do |c|
|
||||||
# Project root
|
# Project root
|
||||||
proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
||||||
|
|
Loading…
Reference in a new issue