From 344aee1d130008f002f92d9bf24d7a74fd7fdd52 Mon Sep 17 00:00:00 2001 From: Florian Faltermeier Date: Thu, 13 Feb 2020 13:56:37 +0000 Subject: [PATCH] (BKR-1632) add el8 support --- lib/beaker/host/unix/exec.rb | 4 ++-- lib/beaker/host_prebuilt_steps.rb | 2 +- spec/beaker/host/unix/pkg_spec.rb | 4 ++++ spec/helpers.rb | 6 +++++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/beaker/host/unix/exec.rb b/lib/beaker/host/unix/exec.rb index a91efcd8a7..41d4b4dc53 100644 --- a/lib/beaker/host/unix/exec.rb +++ b/lib/beaker/host/unix/exec.rb @@ -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")) @@ -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")) diff --git a/lib/beaker/host_prebuilt_steps.rb b/lib/beaker/host_prebuilt_steps.rb index 1d45ee4d95..ccb54b4ed1 100644 --- a/lib/beaker/host_prebuilt_steps.rb +++ b/lib/beaker/host_prebuilt_steps.rb @@ -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}) diff --git a/spec/beaker/host/unix/pkg_spec.rb b/spec/beaker/host/unix/pkg_spec.rb index aac7b4cd29..b8c9ddb2d0 100644 --- a/spec/beaker/host/unix/pkg_spec.rb +++ b/spec/beaker/host/unix/pkg_spec.rb @@ -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 diff --git a/spec/helpers.rb b/spec/helpers.rb index 2c79baa633..310087d3a2 100644 --- a/spec/helpers.rb +++ b/spec/helpers.rb @@ -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}" }