spec_helper_local.rb 1.95 KB
Newer Older
1
2
3
4
5
6
7
8
9
RSpec.configure do |c|
  c.after(:suite) do
    RSpec::Puppet::Coverage.report!
  end
end

# Set up freeradius::params with the redhat values, so we have something
# to test for in the freeradius spec without defining separate tests for
# every OS
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
redhat_params_class = 'class freeradius::params {
  $fr_basepath = "/etc/raddb"
  $fr_configdir = "mods-config"
  $fr_db_dir = "\${localstatedir}/lib/radiusd"
  $fr_group = "radiusd"
  $fr_libdir = "/usr/lib64/freeradius"
  $fr_logpath = "/var/log/radius"
  $fr_moduleconfigpath = "/etc/raddb/mods-config"
  $fr_moduledir = "mods-enabled"
  $fr_modulepath = "/etc/raddb/mods-enabled"
  $fr_package = "freeradius"
  $fr_pidfile = "/var/run/radiusd/radiusd.pid"
  $fr_raddbdir = "\${sysconfdir}/raddb"
  $fr_service = "radiusd"
  $fr_service_has_status = true
  $fr_user = "radiusd"
  $fr_version = "3"
  $fr_wbpriv_user = "wbpriv"
  $fr_wpa_supplicant = "wpa_supplicant"
  $radacctdir = "\${logdir}/radacct"
}
include freeradius::params'

33
34
35
shared_context 'redhat_params' do
  let(:pre_condition) do
    [
36
      redhat_params_class,
37
38
39
40
41
42
43
44
45
    ]
  end
end

# Set up a default freeradius instance, so we can test other classes which
# require freeradius to exist first
shared_context 'freeradius_default' do
  let(:pre_condition) do
    [
46
      redhat_params_class,
47
48
49
50
      'class { freeradius: }'
    ]
  end
end
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68

# Some common dependencies for things based on names for redhat systems
shared_context 'redhat_common_dependencies' do
  let(:pre_condition) do
    [
      redhat_params_class,
      "package { 'freeradius': }",
      "group { 'radiusd': }",
      "service { 'radiusd': }",
      "file { '/etc/raddb': ensure => directory }",
      "file { '/etc/raddb/certs': ensure => directory }",
      "file { '/etc/raddb/clients.d': ensure => directory }",
      "file { '/etc/raddb/dictionary.d': ensure => directory }",
      "file { '/etc/raddb/mods-config': ensure => directory }",
      "file { '/etc/raddb/scripts': ensure => directory }",
    ]
  end
end