Skip to content

Commit

Permalink
Merge pull request redhat-openstack#239 from mhaskel/pull_master_to_1…
Browse files Browse the repository at this point in the history
….1.x

Pull master to 1.1.x
  • Loading branch information
cyberious committed Oct 24, 2014
2 parents 0f43e1a + fe9730a commit 73c7896
Show file tree
Hide file tree
Showing 9 changed files with 77 additions and 30 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@
{
"operatingsystem": "SLES",
"operatingsystemrelease": [
"11 SP1"
"10 SP4",
"11 SP1",
"12"
]
},
{
Expand Down
24 changes: 12 additions & 12 deletions spec/acceptance/concat_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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' }
Expand All @@ -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
Expand Down Expand Up @@ -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' }
Expand Down
5 changes: 2 additions & 3 deletions spec/acceptance/deprecation_warnings_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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':
Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/replace_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 4 additions & 0 deletions spec/spec_helper_acceptance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
23 changes: 16 additions & 7 deletions spec/unit/classes/concat_setup_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down Expand Up @@ -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

Expand All @@ -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

Expand Down
33 changes: 29 additions & 4 deletions spec/unit/defines/concat_fragment_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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]}': }"
Expand Down Expand Up @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand Down
10 changes: 9 additions & 1 deletion spec/unit/defines/concat_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 73c7896

Please sign in to comment.