Skip to content

Commit

Permalink
Merge pull request #1623 from florianfa/el8
Browse files Browse the repository at this point in the history
add el8 support
  • Loading branch information
genebean authored Feb 14, 2020
2 parents ccdba6c + 344aee1 commit d98908a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/beaker/host/unix/exec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def ssh_service_restart
case self['platform']
when /debian|ubuntu|cumulus|huaweios/
exec(Beaker::Command.new("service ssh restart"))
when /el-7|centos-7|redhat-7|oracle-7|scientific-7|eos-7|fedora-(1[4-9]|2[0-9]|3[0-9])|archlinux-/
when /el-7|centos-7|redhat-7|oracle-7|scientific-7|eos-7|el-8|centos-8|redhat-8|oracle-8|fedora-(1[4-9]|2[0-9]|3[0-9])|archlinux-/
exec(Beaker::Command.new("systemctl restart sshd.service"))
when /el-|centos|fedora|redhat|oracle|scientific|eos/
exec(Beaker::Command.new("/sbin/service sshd restart"))
Expand All @@ -252,7 +252,7 @@ def ssh_permit_user_environment
directory = tmpdir()
exec(Beaker::Command.new("echo 'PermitUserEnvironment yes' | cat - /etc/ssh/sshd_config > #{directory}/sshd_config.permit"))
exec(Beaker::Command.new("mv #{directory}/sshd_config.permit /etc/ssh/sshd_config"))
when /el-7|centos-7|redhat-7|oracle-7|scientific-7|eos-7/
when /el-7|centos-7|redhat-7|oracle-7|scientific-7|eos-7|el-8|centos-8|redhat-8|oracle-8/
directory = tmpdir()
exec(Beaker::Command.new("echo 'PermitUserEnvironment yes' | cat - /etc/ssh/sshd_config > #{directory}/sshd_config.permit"))
exec(Beaker::Command.new("mv #{directory}/sshd_config.permit /etc/ssh/sshd_config"))
Expand Down
2 changes: 1 addition & 1 deletion lib/beaker/host_prebuilt_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ def enable_root_login host, opts
#restart sshd
if host['platform'] =~ /debian|ubuntu|cumulus/
host.exec(Command.new("sudo su -c \"service ssh restart\""), {:pty => true})
elsif host['platform'] =~ /arch|centos-7|el-7|redhat-7|fedora-(1[4-9]|2[0-9]|3[0-9])/
elsif host['platform'] =~ /arch|centos-7|el-7|redhat-7|centos-8|el-8|redhat-8|fedora-(1[4-9]|2[0-9]|3[0-9])/
host.exec(Command.new("sudo -E systemctl restart sshd.service"), {:pty => true})
elsif host['platform'] =~ /centos|el-|redhat|fedora|eos/
host.exec(Command.new("sudo -E /sbin/service sshd reload"), {:pty => true})
Expand Down
4 changes: 4 additions & 0 deletions spec/beaker/host/unix/pkg_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,10 @@ def exec
'oracle-7-x86_64' => ["el/7/#{puppet_collection}/x86_64", "puppet-agent-#{puppet_agent_version}-1.el7.x86_64.rpm"],
'redhat-7-x86_64' => ["el/7/#{puppet_collection}/x86_64", "puppet-agent-#{puppet_agent_version}-1.el7.x86_64.rpm"],
'scientific-7-x86_64' => ["el/7/#{puppet_collection}/x86_64", "puppet-agent-#{puppet_agent_version}-1.el7.x86_64.rpm"],
'el-8-x86_64' => ["el/8/#{puppet_collection}/x86_64", "puppet-agent-#{puppet_agent_version}-1.el8.x86_64.rpm"],
'centos-8-x86_64' => ["el/8/#{puppet_collection}/x86_64", "puppet-agent-#{puppet_agent_version}-1.el8.x86_64.rpm"],
'oracle-8-x86_64' => ["el/8/#{puppet_collection}/x86_64", "puppet-agent-#{puppet_agent_version}-1.el8.x86_64.rpm"],
'redhat-8-x86_64' => ["el/8/#{puppet_collection}/x86_64", "puppet-agent-#{puppet_agent_version}-1.el8.x86_64.rpm"],
}
platforms.each do |p, v|
it "accomodates platform #{p} without erroring" do
Expand Down
6 changes: 5 additions & 1 deletion spec/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,11 @@ module PlatformHelpers
'redhat-7',
'oracle-7',
'scientific-7',
'eos-7'].concat(FEDORASYSTEMD)
'eos-7',
'el-8',
'centos-8',
'redhat-8',
'oracle-8'].concat(FEDORASYSTEMD)

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

Expand Down

0 comments on commit d98908a

Please sign in to comment.