-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(packages): check when using repo or archives
- Loading branch information
1 parent
3014494
commit c5ad857
Showing
3 changed files
with
46 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,26 @@ | ||
# frozen_string_literal: true | ||
|
||
control 'prometheus package' do | ||
case platform[:family] | ||
when 'redhat' | ||
packages = %w[ | ||
prometheus2 | ||
alertmanager | ||
node_exporter | ||
] | ||
when 'debian' | ||
packages = %w[ | ||
prometheus | ||
prometheus-alertmanager | ||
prometheus-node-exporter | ||
] | ||
end | ||
|
||
control 'prometheus packages' do | ||
title 'should be installed' | ||
|
||
describe package('prometheus2') do | ||
it { should be_installed } | ||
packages.each do |p| | ||
describe package(p) do | ||
it { should be_installed } | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# frozen_string_literal: true | ||
|
||
control 'repositories' do | ||
impact 0.6 | ||
title 'Configure the repositories' | ||
desc ' | ||
Configure the Debian/RedHat repositories for the supported platforms. | ||
' | ||
tag 'repositories', 'apt', 'yum' | ||
ref 'Prometheus prerequisites - Section: Prometheus package repositories', url: 'https://prometheus.io/download' | ||
|
||
case os[:family] | ||
when 'debian' | ||
describe file('/etc/apt/sources.list.d/prometheus.list') do | ||
it { should_not exist } | ||
end | ||
when 'redhat', 'centos' | ||
describe yum.repo('prometheus') do | ||
it { should exist } | ||
it { should be_enabled } | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters