Skip to content

Commit

Permalink
Merge pull request #1866 from bastelfreak/f5
Browse files Browse the repository at this point in the history
Drop EoL F5 support
  • Loading branch information
bastelfreak authored May 10, 2024
2 parents 5206bed + 86d4e7c commit 59421bc
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 31 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
test_name "confirm host prebuilt steps behave correctly" do
confine_block :except, :platform => /f5|windows/ do
confine_block :except, :platform => /windows/ do
step "confirm ssh environment file existence" do
hosts.each do |host|
assert(host.file_exist?(host[:ssh_env_file]))
Expand Down
2 changes: 1 addition & 1 deletion lib/beaker/host/unix.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def external_copy_base
# nil if it should run.
def skip_set_env?
case self['platform'].variant
when /^(f5|netscaler)$/
when 'netscaler'
"no puppet-agent package for network device platform '#{self['platform'].variant}'"
end
end
Expand Down
5 changes: 2 additions & 3 deletions lib/beaker/host_prebuilt_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def host_packages(host)
when /fedora/
FEDORA_PACKAGES
else
if !/aix|solaris|osx-|f5-|netscaler|cisco_/.match?(host['platform'])
if !/aix|solaris|osx-|netscaler|cisco_/.match?(host['platform'])
UNIX_PACKAGES
else
[]
Expand Down Expand Up @@ -376,8 +376,7 @@ def enable_root_login host, opts
elsif host['platform'].include?('solaris-11')
host.exec(Command.new("if grep \"root::::type=role\" /etc/user_attr; then sudo rolemod -K type=normal root; else echo \"root user already type=normal\"; fi"), { :pty => true })
host.exec(Command.new("sudo gsed -i -e 's/PermitRootLogin no/PermitRootLogin yes/g' /etc/ssh/sshd_config"), { :pty => true })
elsif host['platform'].include?('f5') || host.is_powershell?
# interacting with f5 should using tmsh
elsif host.is_powershell?
logger.warn("Attempting to enable root login non-supported platform: #{host.name}: #{host['platform']}")
elsif host.is_cygwin?
host.exec(Command.new("sed -ri 's/^#?PermitRootLogin /PermitRootLogin yes/' /etc/sshd_config"), { :pty => true })
Expand Down
3 changes: 1 addition & 2 deletions lib/beaker/platform.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Beaker
class Platform < String
# Supported platforms
# rubocop:disable Layout/LineLength
PLATFORMS = /^(alpine|amazon|huaweios|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|cumulus|f5|netscaler)\-.+\-.+$/
PLATFORMS = /^(alpine|amazon|huaweios|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|cumulus|netscaler)\-.+\-.+$/
# rubocop:enable Layout/LineLength
# Platform version numbers vs. codenames conversion hash
PLATFORM_VERSION_CODES =
Expand Down Expand Up @@ -81,7 +81,6 @@ class Platform < String
# * aix
# * el
# * cumulus
# * f5
# * netscaler
# * archlinux
def initialize(name)
Expand Down
24 changes: 0 additions & 24 deletions spec/beaker/host_prebuilt_steps_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
end
end

it_behaves_like 'enables_root_login', 'f5', []
# Non-cygwin Windows
it_behaves_like 'enables_root_login', 'pswindows', [], false

Expand Down Expand Up @@ -570,29 +569,6 @@
test_host_ssh_calls('windows')
end

it "skips an f5 host correctly" do
host = make_host('name', {
:platform => 'f5-stuff',
:ssh_env_file => 'ssh_env_file',
:is_cygwin => true,
})
opts = {
:env1_key => :env1_value,
:env2_key => :env2_value,
}
allow(host).to receive(:skip_set_env?).and_return('f5 say NO')

expect(subject).to receive(:construct_env).exactly(0).times
expect(Beaker::Command).to receive(:new).exactly(0).times
expect(host).to receive(:add_env_var).exactly(0).times
opts.each_pair do |key, value|
expect(host).to receive(:add_env_var).with(key, value).exactly(0).times
end
expect(host).to receive(:exec).exactly(0).times

subject.set_env(host, options.merge(opts))
end

it 'skips a cisco host correctly' do
host = make_host('name', {
:platform => 'cisco_nexus-7-x86_64',
Expand Down

0 comments on commit 59421bc

Please sign in to comment.