summaryrefslogtreecommitdiff
path: root/spec/defines/rsyslog_imfile_spec.rb
blob: ad311e374b2a5f59cd1ff3a280a4ce62422b25cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
require 'spec_helper'

describe 'rsyslog::imfile', :type => :define do
  context "osfamily = RedHat" do
    let :facts do
      {
        :osfamily               => 'RedHat',
        :operatingsystemrelease => 6.0,
      }
    end

    let (:params) {
      {
        'file_name'     => 'mylogfile',
        'file_tag'      => 'mytag',
        'file_facility' => 'myfacility',
      }
    }

    context "default usage (osfamily = RedHat)" do
      let(:title) { 'rsyslog-imfile-basic' }

      it 'should compile' do
        should contain_file('/etc/rsyslog.d/rsyslog-imfile-basic.conf')
      end
    end
  end

  context "osfamily = Debian" do
    let :facts do
      {
        :osfamily        => 'Debian',
      }
    end

    let (:params) {
      {
        'file_name'     => 'mylogfile',
        'file_tag'      => 'mytag',
        'file_facility' => 'myfacility',
      }
    }

    context "default usage (osfamily = Debian)" do
      let(:title) { 'rsyslog-imfile-basic' }

      it 'should compile' do
        should contain_file('/etc/rsyslog.d/rsyslog-imfile-basic.conf')
      end
    end
  end

  context "osfamily = FreeBSD" do
    let :facts do
      {
        :osfamily        => 'freebsd',
      }
    end

    let (:params) {
      {
        'file_name'     => 'mylogfile',
        'file_tag'      => 'mytag',
        'file_facility' => 'myfacility',
      }
    }

    context "default usage (osfamily = Debian)" do
      let(:title) { 'rsyslog-imfile-basic' }

      it 'should compile' do
        should contain_file('/etc/syslog.d/rsyslog-imfile-basic.conf')
      end
    end
  end
end