49
49
context 'system timers are running' do
50
50
it { expect ( service ( 'puppet_system_cpu-metrics.timer' ) ) . to be_running }
51
51
it { expect ( service ( 'puppet_system_cpu-tidy.timer' ) ) . to be_running }
52
- it { expect ( service ( 'puppet_system_memory-metrics.timer' ) ) . to be_running }
53
- it { expect ( service ( 'puppet_system_memory-tidy.timer' ) ) . to be_running }
54
52
it { expect ( service ( 'puppet_system_processes-metrics.timer' ) ) . to be_running }
55
53
it { expect ( service ( 'puppet_system_processes-tidy.timer' ) ) . to be_running }
56
54
end
57
55
58
56
it 'creates system tidy services files' do
59
- files = run_shell ( 'ls /etc/systemd/system/puppet_system* -tidy.service' ) . stdout
60
- expect ( files . split ( " \n " ) . count ) . to eq ( 3 )
57
+ expect ( run_shell ( 'ls /etc/systemd/system/puppet_system_cpu -tidy.service' ) . exit_code ) . to eq ( 0 )
58
+ expect ( run_shell ( 'ls /etc/systemd/system/puppet_system_processes-tidy.service' ) . exit_code ) . to eq ( 0 )
61
59
end
62
60
end
63
61
@@ -79,15 +77,13 @@ class { 'puppet_metrics_collector::system':
79
77
context 'system timers are running' do
80
78
it { expect ( service ( 'puppet_system_cpu-metrics.timer' ) ) . to be_running }
81
79
it { expect ( service ( 'puppet_system_cpu-tidy.timer' ) ) . to be_running }
82
- it { expect ( service ( 'puppet_system_memory-metrics.timer' ) ) . to be_running }
83
- it { expect ( service ( 'puppet_system_memory-tidy.timer' ) ) . to be_running }
84
80
it { expect ( service ( 'puppet_system_processes-metrics.timer' ) ) . to be_running }
85
81
it { expect ( service ( 'puppet_system_processes-tidy.timer' ) ) . to be_running }
86
82
end
87
83
88
84
it 'creates system tidy services files' do
89
- files = run_shell ( 'ls /etc/systemd/system/puppet_system* -tidy.service' ) . stdout
90
- expect ( files . split ( " \n " ) . count ) . to eq ( 3 )
85
+ expect ( run_shell ( 'ls /etc/systemd/system/puppet_system_cpu -tidy.service' ) . exit_code ) . to eq ( 0 )
86
+ expect ( run_shell ( 'ls /etc/systemd/system/puppet_system_processes-tidy.service' ) . exit_code ) . to eq ( 0 )
91
87
end
92
88
end
93
89
end
0 commit comments