|
8 | 8 | MANIFEST |
9 | 9 | idempotent_apply(pp) |
10 | 10 | end |
11 | | - it 'sets all puppet_* metric services to be active' do |
| 11 | + it 'all puppet_* metric services should be active or inactive' do |
12 | 12 | run_shell('systemctl list-units --type=service | grep "puppet_.*metrics"') do |r| |
13 | | - puts r.stdout |
14 | 13 | expect(r.stdout).to match(%r{activ}) |
15 | 14 | end |
16 | 15 | end |
17 | | - it 'check for the tidy services files' do |
| 16 | + context 'all of the timers are running' do |
| 17 | + it { expect(service('puppet_ace-metrics.timer')).to be_running } |
| 18 | + it { expect(service('puppet_ace-tidy.timer')).to be_running } |
| 19 | + it { expect(service('puppet_bolt-metrics.timer')).to be_running } |
| 20 | + it { expect(service('puppet_bolt-tidy.timer')).to be_running } |
| 21 | + it { expect(service('puppet_orchestrator-metrics.timer')).to be_running } |
| 22 | + it { expect(service('puppet_orchestrator-tidy.timer')).to be_running } |
| 23 | + it { expect(service('puppet_postgres-metrics.timer')).to be_running } |
| 24 | + it { expect(service('puppet_postgres-tidy.timer')).to be_running } |
| 25 | + it { expect(service('puppet_puppetdb-metrics.timer')).to be_running } |
| 26 | + it { expect(service('puppet_puppetdb-tidy.timer')).to be_running } |
| 27 | + it { expect(service('puppet_puppetserver-metrics.timer')).to be_running } |
| 28 | + it { expect(service('puppet_puppetserver-tidy.timer')).to be_running } |
| 29 | + it { expect(service('puppet_system_cpu-metrics.timer')).to be_running } |
| 30 | + it { expect(service('puppet_system_cpu-tidy.timer')).to be_running } |
| 31 | + it { expect(service('puppet_system_memory-metrics.timer')).to be_running } |
| 32 | + it { expect(service('puppet_system_memory-tidy.timer')).to be_running } |
| 33 | + it { expect(service('puppet_system_processes-metrics.timer')).to be_running } |
| 34 | + it { expect(service('puppet_system_processes-tidy.timer')).to be_running } |
| 35 | + end |
| 36 | + it 'creates tidy services files' do |
18 | 37 | files = run_shell('ls /etc/systemd/system/puppet_*-tidy.service').stdout |
19 | 38 | expect(files.split("\n").count).to eq(9) |
20 | 39 | end |
21 | | - it 'check for the timer files' do |
| 40 | + it 'creates the timer files' do |
22 | 41 | files = run_shell('ls /etc/systemd/system/puppet_*-tidy.timer').stdout |
23 | 42 | expect(files.split("\n").count).to eq(9) |
24 | 43 | end |
25 | | - it 'checks if sysstat package is installed' do |
| 44 | + it 'sysstat package is installed' do |
26 | 45 | expect(package('sysstat')).to be_installed |
27 | 46 | end |
| 47 | + |
| 48 | + describe file('/opt/puppetlabs/puppet-metrics-collector/puppetserver/127.0.0.1') do |
| 49 | + before(:each) { run_shell('systemctl start puppet_puppetserver-metrics.service') } |
| 50 | + |
| 51 | + it { is_expected.to be_directory } |
| 52 | + it 'contains metric files' do |
| 53 | + files = run_shell('ls /opt/puppetlabs/puppet-metrics-collector/puppetserver/127.0.0.1/*').stdout |
| 54 | + expect(files.split('\n')).not_to be_empty |
| 55 | + end |
| 56 | + end |
| 57 | + |
| 58 | + describe file('/opt/puppetlabs/puppet-metrics-collector/puppetdb/127.0.0.1') do |
| 59 | + before(:each) { run_shell('systemctl start puppet_puppetdb-metrics.service') } |
| 60 | + |
| 61 | + it { is_expected.to be_directory } |
| 62 | + it 'contains metric files' do |
| 63 | + files = run_shell('ls /opt/puppetlabs/puppet-metrics-collector/puppetdb/127.0.0.1/*').stdout |
| 64 | + expect(files.split('\n')).not_to be_empty |
| 65 | + end |
| 66 | + end |
| 67 | + |
| 68 | + describe file('/opt/puppetlabs/puppet-metrics-collector/orchestrator/127.0.0.1') do |
| 69 | + before(:each) { run_shell('systemctl start puppet_orchestrator-metrics.service') } |
| 70 | + |
| 71 | + it { is_expected.to be_directory } |
| 72 | + it 'contains metric files' do |
| 73 | + files = run_shell('ls /opt/puppetlabs/puppet-metrics-collector/orchestrator/127.0.0.1/*').stdout |
| 74 | + expect(files.split('\n')).not_to be_empty |
| 75 | + end |
| 76 | + end |
| 77 | + |
| 78 | + describe file('/opt/puppetlabs/puppet-metrics-collector/ace/127.0.0.1') do |
| 79 | + before(:each) { run_shell('systemctl start puppet_ace-metrics.service') } |
| 80 | + |
| 81 | + it { is_expected.to be_directory } |
| 82 | + it 'contains metric files' do |
| 83 | + files = run_shell('ls /opt/puppetlabs/puppet-metrics-collector/ace/127.0.0.1/*').stdout |
| 84 | + expect(files.split('\n')).not_to be_empty |
| 85 | + end |
| 86 | + end |
| 87 | + |
| 88 | + describe file('/opt/puppetlabs/puppet-metrics-collector/bolt/127.0.0.1') do |
| 89 | + before(:each) { run_shell('systemctl start puppet_bolt-metrics.service') } |
| 90 | + |
| 91 | + it { is_expected.to be_directory } |
| 92 | + it 'contains metric files' do |
| 93 | + files = run_shell('ls /opt/puppetlabs/puppet-metrics-collector/bolt/127.0.0.1/*').stdout |
| 94 | + expect(files.split('\n')).not_to be_empty |
| 95 | + end |
| 96 | + end |
28 | 97 | end |
0 commit comments