mirror of
https://github.com/saltstack-formulas/salt-formula.git
synced 2026-08-10 11:35:57 +02:00
test: centralise all suites into default suite
Modify the `default` suite to use the `saltmajorversion` InSpec input rather than the `version` variable in `pkgs_spec.rb`.
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
pkgs =
|
||||
case system.platform[:name]
|
||||
when 'arch'
|
||||
%w[salt]
|
||||
when /bsd$/
|
||||
%w[py38-salt]
|
||||
when 'windows'
|
||||
['Salt Minion']
|
||||
else
|
||||
%w[salt-master salt-minion]
|
||||
end
|
||||
|
||||
control 'salt packages' do
|
||||
title 'should be installed'
|
||||
|
||||
pkgs.each do |p|
|
||||
describe package(p) do
|
||||
it { should be_installed }
|
||||
its('version') { should match(/^#{input('saltmajorversion')}/) }
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,23 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
services =
|
||||
case system.platform[:family]
|
||||
when 'bsd'
|
||||
%w[salt_master salt_minion]
|
||||
when 'windows'
|
||||
%w[salt-minion]
|
||||
else
|
||||
%w[salt-master salt-minion]
|
||||
end
|
||||
|
||||
control 'salt services' do
|
||||
title 'should be running'
|
||||
|
||||
services.each do |p|
|
||||
describe service(p) do
|
||||
it { should be_installed }
|
||||
it { should be_enabled }
|
||||
it { should be_running }
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user