ldap_spec.rb 1.1 KB
Newer Older
1
2
3
require 'spec_helper'

describe 'freeradius::ldap' do
4
5
6
  include_context 'redhat_common_dependencies'

  let(:title) { 'test' }
7
8
9

  let(:params) do
    {
10
11
12
13
14
15
16
17
18
19
      identity: 'cn=root,dc=example,dc=com',
      password: 'test password',
      basedn: 'dc=example,dc=com',
      server: ['localhost'],
    }
  end

  let(:facts) do
    {
      freeradius_version: '3.0.21',
20
21
    }
  end
22
23
24
25
26
27

  it do
    is_expected.to contain_file('/etc/raddb/mods-available/test')
      .with_content(%r{^ldap test \{\n})
      .with_content(%r{^\s+server = 'localhost'\n})
      .with_content(%r{^\s+identity = 'cn=root,dc=example,dc=com'\n})
28
      .with_content(%r{^\s+password = 'test password'\n})
29
30
31
32
33
34
35
36
37
38
      .with_content(%r{^\s+base_dn = 'dc=example,dc=com'\n})
      .with_ensure('present')
      .with_group('radiusd')
      .with_mode('0640')
      .with_owner('root')
      .that_notifies('Service[radiusd]')
      .that_requires('Package[freeradius]')
      .that_requires('Group[radiusd]')
  end

39
  it do
40
41
42
    is_expected.to contain_file('/etc/raddb/mods-enabled/test')
      .with_ensure('link')
      .with_target('../mods-available/test')
43
44
  end
end