diff --git a/spec/beaker/host/unix/exec_spec.rb b/spec/beaker/host/unix/exec_spec.rb index 42ae75ae0..711b64dff 100644 --- a/spec/beaker/host/unix/exec_spec.rb +++ b/spec/beaker/host/unix/exec_spec.rb @@ -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 @@ -119,16 +119,7 @@ def to_s it "calls the correct command for #{platform}" do 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 diff --git a/spec/helpers.rb b/spec/helpers.rb index 2a846bbdf..e2c200818 100644 --- a/spec/helpers.rb +++ b/spec/helpers.rb @@ -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