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 24, 2022
1 parent 3b091f7 commit e736d07
Showing 1 changed file with 100 additions and 0 deletions.
100 changes: 100 additions & 0 deletions spec/acceptance/updating_posix_acl_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# frozen_string_literal: true

require 'spec_helper_acceptance'

describe 'posix_acl' 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 e736d07

Please sign in to comment.