Skip to content

Commit

Permalink
Add examples to the test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
smortex committed Jan 24, 2022
1 parent e3f9ac7 commit 2542861
Showing 1 changed file with 36 additions and 1 deletion.
37 changes: 36 additions & 1 deletion spec/defines/openldap_server_access_wrapper_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'spec_helper'

describe 'openldap::server::access_wrapper' do
let(:title) { 'foo' }
let(:title) { 'dc=example,dc=com' }

on_supported_os.each do |os, facts|
context "on #{os}" do
Expand Down Expand Up @@ -38,6 +38,41 @@

it { is_expected.to compile.with_all_deps }
it { is_expected.to have_openldap__server__access_resource_count(3) }
it do
is_expected.to contain_openldap_access('0 on dc=example,dc=com').with(
position: 0,
what: '*',
access: [
'by dn.exact=gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth manage',
'by dn.exact=cn=admin,dc=example,dc=com write',
'by dn.exact=cn=replicator,dc=example,dc=com read',
'by * break',
],
suffix: 'dc=example,dc=com'
)
end
it do
is_expected.to contain_openldap_access('1 on dc=example,dc=com').with(
position: 1,
what: 'attrs=userPassword,shadowLastChange',
access: [
'by dn="cn=admin,dc=example,dc=com" write',
'by self write',
'by anonymous auth',
],
suffix: 'dc=example,dc=com'
)
end
it do
is_expected.to contain_openldap_access('2 on dc=example,dc=com').with(
position: 2,
what: '*',
access: [
'by self read',
],
suffix: 'dc=example,dc=com'
)
end
end
end
end

0 comments on commit 2542861

Please sign in to comment.