Skip to content

Commit

Permalink
Add more complex tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed Jan 25, 2022
1 parent b2d84b6 commit 2f77941
Showing 1 changed file with 101 additions and 0 deletions.
101 changes: 101 additions & 0 deletions spec/acceptance/updating_posix_acl_spec.rb
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

0 comments on commit 2f77941

Please sign in to comment.