From c1b63509e913391275148926622590f510f44a99 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Fri, 10 May 2024 16:10:11 +0200 Subject: [PATCH] Drop EoL EL4 support --- lib/beaker/host/unix/pkg.rb | 9 --------- lib/beaker/options/parser.rb | 4 ++-- spec/beaker/host/unix/pkg_spec.rb | 6 ------ spec/beaker/options/parser_spec.rb | 1 - 4 files changed, 2 insertions(+), 18 deletions(-) diff --git a/lib/beaker/host/unix/pkg.rb b/lib/beaker/host/unix/pkg.rb index 8e4de8c6b..9455b6176 100644 --- a/lib/beaker/host/unix/pkg.rb +++ b/lib/beaker/host/unix/pkg.rb @@ -37,9 +37,6 @@ def check_for_package(name, opts = {}) self[:sles_rpmkeys_nightly_pl_imported] = true end result = execute("zypper --gpg-auto-import-keys se -i --match-exact #{name}", opts) { |result| result } - when /el-4/ - @logger.debug("Package query not supported on rhel4") - return false when /amazon|cisco|fedora|centos|redhat|eos|el-/ result = execute("rpm -q #{name}", opts) { |result| result } when /ubuntu|debian/ @@ -85,8 +82,6 @@ def install_package(name, cmdline_args = '', version = nil, opts = {}) case self['platform'] when /opensuse|sles-/ execute("zypper --non-interactive --gpg-auto-import-keys in #{name}", opts) - when /el-4/ - @logger.debug("Package installation not supported on rhel4") when /amazon-2023|el-(8|9|1[0-9])|fedora/ name = "#{name}-#{version}" if version execute("dnf -y #{cmdline_args} install #{name}", opts) @@ -170,8 +165,6 @@ def uninstall_package(name, cmdline_args = '', opts = {}) case self['platform'] when /opensuse|sles-/ execute("zypper --non-interactive rm #{name}", opts) - when /el-4/ - @logger.debug("Package uninstallation not supported on rhel4") when /amazon-2023|el-(8|9|1[0-9])|fedora/ execute("dnf -y #{cmdline_args} remove #{name}", opts) when /cisco|centos|redhat|eos|el-[1-7]-/ @@ -200,8 +193,6 @@ def upgrade_package(name, cmdline_args = '', opts = {}) case self['platform'] when /opensuse|sles-/ execute("zypper --non-interactive --no-gpg-checks up #{name}", opts) - when /el-4/ - @logger.debug("Package upgrade is not supported on rhel4") when /fedora-(2[2-9]|3[0-9])/ execute("dnf -y #{cmdline_args} update #{name}", opts) when /cisco|fedora|centos|redhat|eos|el-/ diff --git a/lib/beaker/options/parser.rb b/lib/beaker/options/parser.rb index a959be14e..8d67e7ee4 100644 --- a/lib/beaker/options/parser.rb +++ b/lib/beaker/options/parser.rb @@ -364,10 +364,10 @@ def normalize_args @validator.validate_master_count(master) - # check that windows/el-4 boxes are only agents (solaris can be a master in foss cases) + # check that windows boxes are only agents (solaris can be a master in foss cases) @options[:HOSTS].each_key do |name| host = @options[:HOSTS][name] - test_host_roles(name, host) if /windows|el-4/.match?(host[:platform]) + test_host_roles(name, host) if host[:platform].include?('windows') # check to see if a custom user account has been provided, if so use it host[:user] = host[:ssh][:user] if host[:ssh] && host[:ssh][:user] diff --git a/spec/beaker/host/unix/pkg_spec.rb b/spec/beaker/host/unix/pkg_spec.rb index b33ba9337..5bba28cd8 100644 --- a/spec/beaker/host/unix/pkg_spec.rb +++ b/spec/beaker/host/unix/pkg_spec.rb @@ -124,12 +124,6 @@ def exec expect(instance.check_for_package(pkg)).to be === true end - it "returns false for el-4" do - @opts = { 'platform' => 'el-4-is-me' } - pkg = 'el-4_package' - expect(instance.check_for_package(pkg)).to be === false - end - it "raises on unknown platform" do @opts = { 'platform' => 'nope-is-me' } pkg = 'nope_package' diff --git a/spec/beaker/options/parser_spec.rb b/spec/beaker/options/parser_spec.rb index 62c282d7b..3b4236877 100644 --- a/spec/beaker/options/parser_spec.rb +++ b/spec/beaker/options/parser_spec.rb @@ -559,7 +559,6 @@ def fake_hosts_file_for_platform(hosts, platform) context "restricts agents" do it_behaves_like('a platform supporting only agents', 'windows-version-arch') - it_behaves_like('a platform supporting only agents', 'el-4-arch') end context "ssh user" do