Skip to content

Commit

Permalink
test: update for new platforms (inc. using system library)
Browse files Browse the repository at this point in the history
  • Loading branch information
myii committed Mar 30, 2021
1 parent 61201de commit e6bcdc1
Show file tree
Hide file tree
Showing 8 changed files with 80 additions and 26 deletions.
17 changes: 13 additions & 4 deletions test/integration/v3000-py2/controls/pkgs_spec.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
# frozen_string_literal: true

pkgs =
case system.platform[:name]
when 'arch'
%w[salt]
when /bsd$/
%w[py37-salt-3002.6]
when 'windows'
%w[Salt\ Minion]
else
%w[salt-master salt-minion]
end

control 'salt packages' do
title 'should be installed'

version = '3000'

%w[
salt-master
salt-minion
].each do |p|
pkgs.each do |p|
describe package(p) do
it { should be_installed }
its('version') { should match(/^#{version}/) }
Expand Down
15 changes: 11 additions & 4 deletions test/integration/v3000-py2/controls/service_spec.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
# 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'

%w[
salt-master
salt-minion
].each do |p|
services.each do |p|
describe service(p) do
it { should be_installed }
it { should be_enabled }
Expand Down
6 changes: 5 additions & 1 deletion test/integration/v3000-py3/controls/pkgs_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# frozen_string_literal: true

pkgs =
case platform[:family]
case system.platform[:name]
when 'arch'
%w[salt]
when /bsd$/
%w[py37-salt-3002.6]
when 'windows'
%w[Salt\ Minion]
else
Expand Down
4 changes: 3 additions & 1 deletion test/integration/v3000-py3/controls/service_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# frozen_string_literal: true

services =
case platform[:family]
case system.platform[:family]
when 'bsd'
%w[salt_master salt_minion]
when 'windows'
%w[salt-minion]
else
Expand Down
17 changes: 13 additions & 4 deletions test/integration/v3001-py3/controls/pkgs_spec.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
# frozen_string_literal: true

pkgs =
case system.platform[:name]
when 'arch'
%w[salt]
when /bsd$/
%w[py37-salt-3002.6]
when 'windows'
%w[Salt\ Minion]
else
%w[salt-master salt-minion]
end

control 'salt packages' do
title 'should be installed'

version = '3001'

%w[
salt-master
salt-minion
].each do |p|
pkgs.each do |p|
describe package(p) do
it { should be_installed }
its('version') { should match(/^#{version}/) }
Expand Down
15 changes: 11 additions & 4 deletions test/integration/v3001-py3/controls/service_spec.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
# 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'

%w[
salt-master
salt-minion
].each do |p|
services.each do |p|
describe service(p) do
it { should be_installed }
it { should be_enabled }
Expand Down
17 changes: 13 additions & 4 deletions test/integration/v3002-py3/controls/pkgs_spec.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
# frozen_string_literal: true

pkgs =
case system.platform[:name]
when 'arch'
%w[salt]
when /bsd$/
%w[py37-salt-3002.6]
when 'windows'
%w[Salt\ Minion]
else
%w[salt-master salt-minion]
end

control 'salt packages' do
title 'should be installed'

version = '3002'

%w[
salt-master
salt-minion
].each do |p|
pkgs.each do |p|
describe package(p) do
it { should be_installed }
its('version') { should match(/^#{version}/) }
Expand Down
15 changes: 11 additions & 4 deletions test/integration/v3002-py3/controls/service_spec.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
# 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'

%w[
salt-master
salt-minion
].each do |p|
services.each do |p|
describe service(p) do
it { should be_installed }
it { should be_enabled }
Expand Down

0 comments on commit e6bcdc1

Please sign in to comment.