Skip to content

Commit

Permalink
Merge pull request #1874 from bastelfreak/f5
Browse files Browse the repository at this point in the history
Drop EoL Arista EOS support
  • Loading branch information
bastelfreak authored May 10, 2024
2 parents 8603333 + a451a61 commit 0807b0c
Show file tree
Hide file tree
Showing 13 changed files with 17 additions and 136 deletions.
11 changes: 0 additions & 11 deletions docs/how_to/hosts/eos.md

This file was deleted.

3 changes: 0 additions & 3 deletions lib/beaker/host.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ def self.create name, host_hash, options
Mac::Host.new name, host_hash, options
when /freebsd/
FreeBSD::Host.new name, host_hash, options
when /eos/
Eos::Host.new name, host_hash, options
when /cisco/
Cisco::Host.new name, host_hash, options
else
Expand Down Expand Up @@ -576,7 +574,6 @@ def add_env_var(key, val)
freebsd
windows
pswindows
eos
cisco
].each do |lib|
require "beaker/host/#{lib}"
Expand Down
33 changes: 0 additions & 33 deletions lib/beaker/host/eos.rb

This file was deleted.

6 changes: 3 additions & 3 deletions lib/beaker/host/unix/exec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,9 @@ def ssh_service_restart
case self['platform']
when /debian|ubuntu/
exec(Beaker::Command.new("service ssh restart"))
when /amazon|(el|centos|redhat|oracle|scientific)-[7-9]|eos-7|fedora-(1[4-9]|2[0-9]|3[0-9])|archlinux-/
when /amazon|(el|centos|redhat|oracle|scientific)-[7-9]|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/
when /el-|centos|fedora|redhat|oracle|scientific/
exec(Beaker::Command.new("/sbin/service sshd restart"))
when /opensuse|sles/
exec(Beaker::Command.new("/usr/sbin/rcsshd restart"))
Expand All @@ -302,7 +302,7 @@ def ssh_service_restart
# (from {#ssh_service_restart}).
def ssh_permit_user_environment
case self['platform']
when /amazon|debian|ubuntu|archlinux|el-|centos|fedora|redhat|oracle|scientific|eos|opensuse|sles|solaris/
when /amazon|debian|ubuntu|archlinux|el-|centos|fedora|redhat|oracle|scientific|opensuse|sles|solaris/
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
8 changes: 4 additions & 4 deletions lib/beaker/host/unix/pkg.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ 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 /amazon|cisco|fedora|centos|redhat|eos|el-/
when /amazon|cisco|fedora|centos|redhat|el-/
result = execute("rpm -q #{name}", opts) { |result| result }
when /ubuntu|debian/
result = execute("dpkg -s #{name}", opts) { |result| result }
Expand Down Expand Up @@ -85,7 +85,7 @@ def install_package(name, cmdline_args = '', version = nil, opts = {})
when /amazon-2023|el-(8|9|1[0-9])|fedora/
name = "#{name}-#{version}" if version
execute("dnf -y #{cmdline_args} install #{name}", opts)
when /cisco|centos|redhat|eos|el-[1-7]-/
when /cisco|centos|redhat|el-[1-7]-/
name = "#{name}-#{version}" if version
execute("yum -y #{cmdline_args} install #{name}", opts)
when /ubuntu|debian/
Expand Down Expand Up @@ -167,7 +167,7 @@ def uninstall_package(name, cmdline_args = '', opts = {})
execute("zypper --non-interactive rm #{name}", opts)
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]-/
when /cisco|centos|redhat|el-[1-7]-/
execute("yum -y #{cmdline_args} remove #{name}", opts)
when /ubuntu|debian/
execute("apt-get purge #{cmdline_args} -y #{name}", opts)
Expand Down Expand Up @@ -195,7 +195,7 @@ def upgrade_package(name, cmdline_args = '', opts = {})
execute("zypper --non-interactive --no-gpg-checks up #{name}", opts)
when /fedora-(2[2-9]|3[0-9])/
execute("dnf -y #{cmdline_args} update #{name}", opts)
when /cisco|fedora|centos|redhat|eos|el-/
when /cisco|fedora|centos|redhat|el-/
execute("yum -y #{cmdline_args} update #{name}", opts)
when /ubuntu|debian/
update_apt_if_needed
Expand Down
8 changes: 4 additions & 4 deletions lib/beaker/host_prebuilt_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def sync_root_keys host, opts
block_on host do |host|
logger.notify "Sync root authorized_keys from github on #{host.name}"
# Allow all exit code, as this operation is unlikely to cause problems if it fails.
if /solaris|eos/.match?(host['platform'])
if host['platform'].include?('solaris')
host.exec(Command.new(ROOT_KEYS_SYNC_CMD % "bash"), :accept_all_exit_codes => true)
elsif host['platform'].include?('aix')
host.exec(Command.new(ROOT_KEYS_SYNC_CMD_AIX % "env PATH=/usr/gnu/bin:$PATH bash"), :accept_all_exit_codes => true)
Expand Down Expand Up @@ -384,7 +384,7 @@ def enable_root_login host, opts
host.exec(Command.new("sudo su -c \"service ssh restart\""), { :pty => true })
elsif /amazon|arch|(centos|el|redhat)-[789]|fedora-(1[4-9]|2[0-9]|3[0-9])/.match?(host['platform'])
host.exec(Command.new("sudo -E systemctl restart sshd.service"), { :pty => true })
elsif /centos|el-|redhat|fedora|eos/.match?(host['platform'])
elsif /centos|el-|redhat|fedora/.match?(host['platform'])
host.exec(Command.new("sudo -E /sbin/service sshd reload"), { :pty => true })
elsif /(free|open)bsd/.match?(host['platform'])
host.exec(Command.new("sudo /etc/rc.d/sshd restart"))
Expand All @@ -403,7 +403,7 @@ def enable_root_login host, opts
def disable_se_linux host, opts
logger = opts[:logger]
block_on host do |host|
if /centos|el-|redhat|fedora|eos/.match?(host['platform'])
if /centos|el-|redhat|fedora/.match?(host['platform'])
logger.debug("Disabling se_linux on #{host.name}")
host.exec(Command.new("sudo su -c \"setenforce 0\""), { :pty => true })
else
Expand All @@ -426,7 +426,7 @@ def package_proxy host, opts
case host['platform']
when /ubuntu/, /debian/
host.exec(Command.new("echo 'Acquire::http::Proxy \"#{opts[:package_proxy]}/\";' >> /etc/apt/apt.conf.d/10proxy"))
when /amazon/, /^el-/, /centos/, /fedora/, /redhat/, /eos/
when /amazon/, /^el-/, /centos/, /fedora/, /redhat/
host.exec(Command.new("echo 'proxy=#{opts[:package_proxy]}/' >> /etc/yum.conf"))
when /solaris-11/
host.exec(Command.new("/usr/bin/pkg unset-publisher solaris || :"))
Expand Down
4 changes: 2 additions & 2 deletions lib/beaker/perf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ module Beaker
class Perf
PERF_PACKAGES = ['sysstat']
# SLES does not treat sysstat as a service that can be started
PERF_SUPPORTED_PLATFORMS = /amazon|debian|ubuntu|redhat|centos|oracle|scientific|fedora|el|eos|opensuse|sles/
PERF_START_PLATFORMS = /amazon|debian|ubuntu|redhat|centos|oracle|scientific|fedora|el|eos/
PERF_SUPPORTED_PLATFORMS = /amazon|debian|ubuntu|redhat|centos|oracle|scientific|fedora|el|opensuse|sles/
PERF_START_PLATFORMS = /amazon|debian|ubuntu|redhat|centos|oracle|scientific|fedora|el/

# Create the Perf instance and runs setup_perf_on_host on all hosts if --collect-perf-data
# was used as an option on the Baker command line invocation. Instances of this class do not
Expand Down
2 changes: 1 addition & 1 deletion lib/beaker/platform.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module Beaker
# all String methods while adding several platform-specific use cases.
class Platform < String
# Supported platforms
PLATFORMS = /^(alpine|amazon|cisco_nexus|cisco_ios_xr|(free|open)bsd|osx|centos|fedora|debian|oracle|redhat|redhatfips|scientific|opensuse|sles|ubuntu|windows|solaris|aix|archlinux|el|eos|netscaler)\-.+\-.+$/
PLATFORMS = /^(alpine|amazon|cisco_nexus|cisco_ios_xr|(free|open)bsd|osx|centos|fedora|debian|oracle|redhat|redhatfips|scientific|opensuse|sles|ubuntu|windows|solaris|aix|archlinux|el|netscaler)\-.+\-.+$/
# Platform version numbers vs. codenames conversion hash
PLATFORM_VERSION_CODES =
{ :debian => { "forky" => "14",
Expand Down
44 changes: 0 additions & 44 deletions spec/beaker/host/eos_spec.rb

This file was deleted.

14 changes: 0 additions & 14 deletions spec/beaker/host/unix/file_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,6 @@ def to_s
@platform = 'debian-6-x86_64'
expect(instance.repo_type).to be === 'deb'
end

it 'errors for all other platform types' do
@platform = 'eos-4-x86_64'
expect do
instance.repo_type
end.to raise_error(ArgumentError, /repo\ type\ not\ known/)
end
end

describe '#package_config_dir' do
Expand All @@ -75,13 +68,6 @@ def to_s
@platform = 'opensuse-15-x86_64'
expect(instance.package_config_dir).to be === '/etc/zypp/repos.d/'
end

it 'errors for all other platform types' do
@platform = 'eos-4-x86_64'
expect do
instance.package_config_dir
end.to raise_error(ArgumentError, /package\ config\ dir\ unknown/)
end
end

describe '#repo_filename' do
Expand Down
8 changes: 0 additions & 8 deletions spec/beaker/host/unix/pkg_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,6 @@ def exec
end
end

it "checks correctly on EOS" do
@opts = { 'platform' => 'eos-is-me' }
pkg = 'eos-package'
expect(Beaker::Command).to receive(:new).with("rpm -q #{pkg}", [], { :prepend_cmds => nil, :cmdexe => false }).and_return('')
expect(instance).to receive(:exec).with('', { :accept_all_exit_codes => true }).and_return(generate_result("hello", { :exit_code => 0 }))
expect(instance.check_for_package(pkg)).to be === true
end

it "checks correctly on el-" do
@opts = { 'platform' => 'el-is-me' }
pkg = 'el_package'
Expand Down
8 changes: 2 additions & 6 deletions spec/beaker/host_prebuilt_steps_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
]
end

['centos', 'el-', 'redhat', 'fedora', 'eos'].each do |redhat_like|
['centos', 'el-', 'redhat', 'fedora'].each do |redhat_like|
it_behaves_like 'enables_root_login', redhat_like, [
"sudo su -c \"sed -ri 's/^#?PermitRootLogin no|^#?PermitRootLogin yes/PermitRootLogin yes/' /etc/ssh/sshd_config\"",
"sudo -E /sbin/service sshd reload",
Expand Down Expand Up @@ -268,7 +268,7 @@
context "sync_root_keys" do
subject { dummy_class.new }

it "can sync keys on a solaris/eos host" do
it "can sync keys on a solaris host" do
@platform = 'solaris'

expect(Beaker::Command).to receive(:new).with(sync_cmd % "bash").exactly(3).times
Expand Down Expand Up @@ -537,10 +537,6 @@
test_host_ssh_calls('ubuntu')
end

it "sets user ssh environment on an sshd-based linux host" do
test_host_ssh_calls('eos')
end

it "sets user ssh environment on an sles host" do
test_host_ssh_calls('sles')
end
Expand Down
4 changes: 1 addition & 3 deletions spec/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ module PlatformHelpers
redhat-7
oracle-7
scientific-7
eos-7
el-8
centos-8
redhat-8
Expand All @@ -143,6 +142,5 @@ module PlatformHelpers
'fedora',
'redhat',
'oracle',
'scientific',
'eos',].concat(FEDORASYSTEMV)
'scientific',].concat(FEDORASYSTEMV)
end

0 comments on commit 0807b0c

Please sign in to comment.