This file is indexed.

/usr/share/puppet/modules.available/puppet-community-mcollective/spec/defines/mcollective__user_spec.rb is in puppet-module-puppet-community-mcollective 0.6.2-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 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
require 'spec_helper'

describe 'mcollective::user' do
  let(:title) { 'nagios' }
  let(:default_params) { { :connector => 'activemq', :middleware_hosts => ['localhost'] } }
  let(:params) { default_params }
  it { should contain_file('/home/nagios/.mcollective.d') }
  it { should contain_file('mcollective::user nagios').with_path('/home/nagios/.mcollective') }

  describe '#securityprovider' do
    context 'ssl' do
      let(:params) { default_params.merge(:securityprovider => 'ssl') }
      it { should contain_file('/home/nagios/.mcollective.d/credentials/certs/nagios.pem') }
      it { should contain_file('/home/nagios/.mcollective.d/credentials/private_keys/nagios.pem') }
      it { should contain_mcollective__user__setting('nagios:plugin.ssl_client_public') }
      it { should contain_mcollective__user__setting('nagios:plugin.ssl_client_public').with_value('/home/nagios/.mcollective.d/credentials/certs/nagios.pem') }
      it { should contain_mcollective__user__setting('nagios:plugin.ssl_client_private') }
      it { should contain_mcollective__user__setting('nagios:plugin.ssl_server_public') }
    end

    context 'pies' do
      let(:params) { default_params.merge(:securityprovider => 'pies') }
      it { should_not contain_file('/home/nagios/.mcollective.d/credentials/certs/nagios.pem') }
      it { should_not contain_mcollective__user__setting('nagios:plugin.ssl_client_public') }
      it { should_not contain_mcollective__user__setting('nagios:plugin.ssl_client_private') }
      it { should_not contain_mcollective__user__setting('nagios:plugin.ssl_server_public') }
    end
  end

  describe '#middleware_ssl' do
    context 'true' do
      let(:params) { default_params.merge(:middleware_ssl => true) }
      it { should contain_file('/home/nagios/.mcollective.d/credentials/private_keys/nagios.pem') }
      it { should contain_mcollective__user__setting('nagios plugin.activemq.pool.1.ssl.cert') }
      it { should contain_mcollective__user__setting('nagios plugin.activemq.pool.1.ssl.cert').with_value('/home/nagios/.mcollective.d/credentials/certs/nagios.pem') }
    end

    context 'false' do
      let(:params) { default_params.merge(:middleware_ssl => false) }
      it { should_not contain_mcollective__user__setting('nagios plugin.activemq.pool.1.ssl.cert') }
    end
  end
end