File: statistics_spec.rb

package info (click to toggle)
puppet-module-puppetlabs-ntp 7.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, forky, sid, trixie
  • size: 496 kB
  • sloc: ruby: 1,481; sh: 46; makefile: 2
file content (29 lines) | stat: -rw-r--r-- 817 bytes parent folder | download
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
require 'spec_helper_acceptance'

config = if fact('osfamily') == 'Solaris'
           '/etc/inet/ntp.conf'
         else
           '/etc/ntp.conf'
         end

describe 'ntp class with statistics:', unless: UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
  context 'when successful' do
    let(:pp) { "class { 'ntp': statistics => ['loopstats'], disable_monitor => false}" }

    it 'runs twice' do
      2.times do
        apply_manifest(pp, catch_failures: true) do |r|
          expect(r.stderr).not_to match(%r{error}i)
        end
      end
    end
  end

  describe file(config.to_s) do
    its(:content) { is_expected.to match('filegen loopstats file loopstats type day enable') }
  end

  describe file(config.to_s) do
    its(:content) { is_expected.to match('statsdir /var/log/ntpstats') }
  end
end