Skip to content

Commit

Permalink
drop system-v leftovers
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed May 10, 2024
1 parent 497bd17 commit 7713a1e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 38 deletions.
20 changes: 2 additions & 18 deletions spec/beaker/host/unix/exec_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def to_s
let(:ssh_command) { "echo 'PermitUserEnvironment yes' | cat - /etc/ssh/sshd_config > #{directory}/sshd_config.permit" }
let(:ssh_move) { "mv #{directory}/sshd_config.permit /etc/ssh/sshd_config" }

platforms = PlatformHelpers::SYSTEMDPLATFORMS + PlatformHelpers::DEBIANPLATFORMS + PlatformHelpers::SYSTEMVPLATFORMS
platforms = PlatformHelpers::SYSTEMDPLATFORMS + PlatformHelpers::DEBIANPLATFORMS

platforms.each do |platform|
it "calls the correct commands for #{platform}" do
Expand Down Expand Up @@ -119,26 +119,10 @@ def to_s
it "calls the correct command for #{platform}" do

Check failure on line 119 in spec/beaker/host/unix/exec_spec.rb

View workflow job for this annotation

GitHub Actions / rubocop

RSpec/RepeatedExample: Don't repeat examples within an example group. (https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedExample)
opts['platform'] = platform
expect(instance).to receive(:exec)
expect(Beaker::Command).to receive(:new).with("service ssh restart")
expect { instance.ssh_service_restart }.not_to raise_error
end
end

PlatformHelpers::SYSTEMVPLATFORMS.each do |platform|
it "calls the correct command for #{platform}" do
opts['platform'] = "#{platform}-arch"
expect(instance).to receive(:exec)
expect(Beaker::Command).to receive(:new).with("/sbin/service sshd restart")
expect(Beaker::Command).to receive(:new).with("systemctl restart sshd.service")
expect { instance.ssh_service_restart }.not_to raise_error
end
end

it 'raises an error on unsupported platforms' do
opts['platform'] = 'notarealthing02-parts-arch'
expect do
instance.ssh_service_restart
end.to raise_error(ArgumentError, /#{opts['platform']}/)
end
end

describe '#prepend_commands' do
Expand Down
26 changes: 6 additions & 20 deletions spec/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,24 +125,10 @@ module PlatformHelpers
FEDORASYSTEMD = (14..39).to_a.collect! { |i| "fedora-#{i}" }

SYSTEMDPLATFORMS = %w[amazon-2023
el-7
centos-7
redhat-7
oracle-7
scientific-7
eos-7
el-8
centos-8
redhat-8
oracle-8].concat(FEDORASYSTEMD)

FEDORASYSTEMV = (1..13).to_a.collect! { |i| "fedora-#{i}" }

SYSTEMVPLATFORMS = ['el-',
'centos',
'fedora',
'redhat',
'oracle',
'scientific',
'eos',].concat(FEDORASYSTEMV)
el-
centos
redhat
oracle
scientific
eos].concat(FEDORASYSTEMD)
end

0 comments on commit 7713a1e

Please sign in to comment.