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
|
||||
#
|
||||
class concat::setup {
|
||||
case $::osfamily {
|
||||
'windows': {
|
||||
fail("Unsupported osfamily: ${osfamily}")
|
||||
}
|
||||
default: {
|
||||
# Should work otherwise
|
||||
}
|
||||
}
|
||||
$id = $::id
|
||||
$root_group = $id ? {
|
||||
root => 0,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require 'spec_helper_acceptance'
|
||||
|
||||
describe 'concat backup parameter' do
|
||||
describe 'concat backup parameter', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
|
||||
basedir = default.tmpdir('concat')
|
||||
context '=> puppet' do
|
||||
before :all do
|
||||
|
|
|
@ -12,7 +12,7 @@ else
|
|||
groupname = 'root'
|
||||
end
|
||||
|
||||
describe 'basic concat test' do
|
||||
describe 'basic concat test', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
|
||||
basedir = default.tmpdir('concat')
|
||||
|
||||
shared_examples 'successfully_applied' do |pp|
|
||||
|
@ -51,7 +51,7 @@ describe 'basic concat test' do
|
|||
it { should be_owned_by username }
|
||||
it { should be_grouped_into groupname }
|
||||
# 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
|
||||
}
|
||||
it { should contain '1' }
|
||||
|
@ -62,7 +62,7 @@ describe 'basic concat test' do
|
|||
it { should be_owned_by username }
|
||||
it { should be_grouped_into groupname }
|
||||
# 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
|
||||
}
|
||||
end
|
||||
|
@ -71,7 +71,7 @@ describe 'basic concat test' do
|
|||
it { should be_owned_by username }
|
||||
it { should be_grouped_into groupname }
|
||||
# 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
|
||||
}
|
||||
end
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
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')
|
||||
context 'should run successfully' do
|
||||
pp = <<-EOS
|
||||
|
|
|
@ -12,7 +12,7 @@ else
|
|||
groupname = 'root'
|
||||
end
|
||||
|
||||
describe 'concat::fragment source' do
|
||||
describe 'concat::fragment source', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
|
||||
basedir = default.tmpdir('concat')
|
||||
context 'should read file fragments from local system' do
|
||||
before(:all) do
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
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')
|
||||
context '=> false' do
|
||||
pp = <<-EOS
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require 'spec_helper_acceptance'
|
||||
|
||||
describe 'concat order' do
|
||||
describe 'concat order', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
|
||||
basedir = default.tmpdir('concat')
|
||||
before(:all) do
|
||||
shell("rm -rf #{basedir} #{default.puppet['vardir']}/concat")
|
||||
|
@ -35,7 +35,7 @@ describe 'concat order' do
|
|||
describe file("#{basedir}/foo") do
|
||||
it { should be_file }
|
||||
#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"
|
||||
}
|
||||
end
|
||||
|
@ -69,14 +69,14 @@ describe 'concat order' do
|
|||
describe file("#{basedir}/foo") do
|
||||
it { should be_file }
|
||||
#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"
|
||||
}
|
||||
end
|
||||
end
|
||||
end # concat order
|
||||
|
||||
describe 'concat::fragment order' do
|
||||
describe 'concat::fragment order', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
|
||||
basedir = default.tmpdir('concat')
|
||||
before(:all) do
|
||||
shell("rm -rf #{basedir} #{default.puppet['vardir']}/concat")
|
||||
|
@ -112,7 +112,7 @@ describe 'concat::fragment order' do
|
|||
describe file("#{basedir}/foo") do
|
||||
it { should be_file }
|
||||
#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"
|
||||
}
|
||||
end
|
||||
|
@ -147,7 +147,7 @@ describe 'concat::fragment order' do
|
|||
describe file("#{basedir}/foo") do
|
||||
it { should be_file }
|
||||
#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"
|
||||
}
|
||||
end
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require 'spec_helper_acceptance'
|
||||
|
||||
describe 'replacement of' do
|
||||
describe 'replacement of', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
|
||||
basedir = default.tmpdir('concat')
|
||||
context 'file' do
|
||||
context 'should not succeed' do
|
||||
|
@ -118,7 +118,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 UNSUPPORTED_PLATFORMS.include?(fact('osfamily'))) do
|
||||
it { should be_linked_to "#{basedir}/dangling" }
|
||||
end
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require 'spec_helper_acceptance'
|
||||
|
||||
describe 'symbolic name' do
|
||||
describe 'symbolic name', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
|
||||
basedir = default.tmpdir('concat')
|
||||
pp = <<-EOS
|
||||
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'
|
||||
|
||||
describe 'concat warn =>' do
|
||||
describe 'concat warn =>', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
|
||||
basedir = default.tmpdir('concat')
|
||||
context 'true should enable default warning message' do
|
||||
pp = <<-EOS
|
||||
|
|
|
@ -17,6 +17,8 @@ unless ENV['RS_PROVISION'] == 'no'
|
|||
end
|
||||
end
|
||||
|
||||
UNSUPPORTED_PLATFORMS = ['windows']
|
||||
|
||||
RSpec.configure do |c|
|
||||
# Project root
|
||||
proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
||||
|
|
Loading…
Reference in a new issue