forked from pdrakeweb/puppet-acl
-
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #108 from bastelfreak/tests
dont set ACLs if there are no ACLs to change
- Loading branch information
Showing
2 changed files
with
103 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'spec_helper_acceptance' | ||
|
||
describe 'updating posix_acls' do | ||
context 'on a simple acl with an additional user' do | ||
it_behaves_like 'an idempotent resource' do | ||
let(:manifest) do | ||
<<-PUPPET | ||
include posix_acl::requirements | ||
user { ['blub', 'blub2']: | ||
ensure => 'present', | ||
} | ||
file { '/opt/test3': | ||
ensure => directory, | ||
owner => root, | ||
group => root, | ||
mode => '2770', | ||
} | ||
-> posix_acl { '/opt/test3': | ||
action => exact, | ||
permission => [ | ||
'user::rwx', | ||
'group::rwx', | ||
'mask::rwx', | ||
'other::---', | ||
'user:blub:r-x', | ||
], | ||
provider => posixacl, | ||
recursive => false, | ||
require => User['blub'], | ||
} | ||
PUPPET | ||
end | ||
end | ||
end | ||
|
||
context 'on adding ACLs without overwriting existing ACLs' do | ||
it_behaves_like 'an idempotent resource' do | ||
let(:manifest) do | ||
<<-PUPPET | ||
include posix_acl::requirements | ||
user { ['blub', 'blub2']: | ||
ensure => 'present', | ||
} | ||
file { '/opt/test3': | ||
ensure => directory, | ||
owner => root, | ||
group => root, | ||
mode => '2770', | ||
} | ||
-> posix_acl { '/opt/test3': | ||
action => set, | ||
permission => [ | ||
'user::rwx', | ||
'group::rwx', | ||
'mask::rwx', | ||
'other::---', | ||
'user:blub2:r-x', | ||
], | ||
provider => posixacl, | ||
recursive => false, | ||
require => User['blub2'], | ||
} | ||
PUPPET | ||
end | ||
end | ||
end | ||
|
||
context 'on adding ACLs with overwriting existing ACLs' do | ||
it_behaves_like 'an idempotent resource' do | ||
let(:manifest) do | ||
<<-PUPPET | ||
include posix_acl::requirements | ||
user { ['blub', 'blub2']: | ||
ensure => 'present', | ||
} | ||
file { '/opt/test3': | ||
ensure => directory, | ||
owner => root, | ||
group => root, | ||
mode => '2770', | ||
} | ||
-> posix_acl { '/opt/test3': | ||
action => exact, | ||
permission => [ | ||
'user::rwx', | ||
'group::rwx', | ||
'mask::rwx', | ||
'other::---', | ||
'user:blub2:r-x', | ||
], | ||
provider => posixacl, | ||
recursive => false, | ||
require => User['blub2'], | ||
} | ||
PUPPET | ||
end | ||
end | ||
end | ||
end |