From 2a50e6af51254cfdfb5d090630a41352494ca59f Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Fri, 10 May 2024 16:44:47 +0200 Subject: [PATCH] Drop Fedora < 22 support Those are long EOL and this makes sure the right commands on Fedora 40 are used. --- .../module/spec/acceptance/nodesets/fedora-18-x64.yml | 10 ---------- ...pl-puppetserver-latest-repos-pe-fedora-20-i386.repo | 6 ------ ...-puppetserver-latest-repos-pe-fedora-20-x86_64.repo | 6 ------ ...pl-puppetserver-latest-repos-pe-fedora-21-i386.repo | 6 ------ ...-puppetserver-latest-repos-pe-fedora-21-x86_64.repo | 6 ------ ...pl-puppetserver-latest-repos-pe-fedora-22-i386.repo | 6 ------ ...-puppetserver-latest-repos-pe-fedora-22-x86_64.repo | 6 ------ ...pl-puppetserver-latest-repos-pe-fedora-23-i386.repo | 6 ------ ...-puppetserver-latest-repos-pe-fedora-23-x86_64.repo | 6 ------ ...-puppetserver-latest-repos-pe-fedora-24-x86_64.repo | 6 ------ lib/beaker/host/unix/exec.rb | 4 ++-- lib/beaker/host/unix/pkg.rb | 4 ++-- lib/beaker/host_prebuilt_steps.rb | 4 ++-- spec/beaker/host_prebuilt_steps_spec.rb | 7 ++++++- spec/helpers.rb | 10 +++------- 15 files changed, 15 insertions(+), 78 deletions(-) delete mode 100644 acceptance/fixtures/module/spec/acceptance/nodesets/fedora-18-x64.yml delete mode 100644 acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-fedora-20-i386.repo delete mode 100644 acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-fedora-20-x86_64.repo delete mode 100644 acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-fedora-21-i386.repo delete mode 100644 acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-fedora-21-x86_64.repo delete mode 100644 acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-fedora-22-i386.repo delete mode 100644 acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-fedora-22-x86_64.repo delete mode 100644 acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-fedora-23-i386.repo delete mode 100644 acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-fedora-23-x86_64.repo delete mode 100644 acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-fedora-24-x86_64.repo diff --git a/acceptance/fixtures/module/spec/acceptance/nodesets/fedora-18-x64.yml b/acceptance/fixtures/module/spec/acceptance/nodesets/fedora-18-x64.yml deleted file mode 100644 index 1361649830..0000000000 --- a/acceptance/fixtures/module/spec/acceptance/nodesets/fedora-18-x64.yml +++ /dev/null @@ -1,10 +0,0 @@ -HOSTS: - fedora-18-x64: - roles: - - master - platform: fedora-18-x86_64 - box : fedora-18-x64-vbox4210-nocm - box_url : http://puppet-vagrant-boxes.puppetlabs.com/fedora-18-x64-vbox4210-nocm.box - hypervisor : vagrant -CONFIG: - type: foss diff --git a/acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-fedora-20-i386.repo b/acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-fedora-20-i386.repo deleted file mode 100644 index a8867a63df..0000000000 --- a/acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-fedora-20-i386.repo +++ /dev/null @@ -1,6 +0,0 @@ -[pl-puppetserver-latest] -name=PL Repo for puppetserver at commit latest -baseurl=http://nightlies.puppetlabs.com/puppetserver-latest/repos/fedora/f20/PC1/i386/ -enabled=1 -gpgcheck=1 -gpgkey=http://nightlies.puppetlabs.com/07BB6C57 diff --git a/acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-fedora-20-x86_64.repo b/acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-fedora-20-x86_64.repo deleted file mode 100644 index 34b5c9af07..0000000000 --- a/acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-fedora-20-x86_64.repo +++ /dev/null @@ -1,6 +0,0 @@ -[pl-puppetserver-latest] -name=PL Repo for puppetserver at commit latest -baseurl=http://nightlies.puppetlabs.com/puppetserver-latest/repos/fedora/f20/PC1/x86_64/ -enabled=1 -gpgcheck=1 -gpgkey=http://nightlies.puppetlabs.com/07BB6C57 diff --git a/acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-fedora-21-i386.repo b/acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-fedora-21-i386.repo deleted file mode 100644 index 38117991fc..0000000000 --- a/acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-fedora-21-i386.repo +++ /dev/null @@ -1,6 +0,0 @@ -[pl-puppetserver-latest] -name=PL Repo for puppetserver at commit latest -baseurl=http://nightlies.puppetlabs.com/puppetserver-latest/repos/fedora/f21/PC1/i386/ -enabled=1 -gpgcheck=1 -gpgkey=http://nightlies.puppetlabs.com/07BB6C57 diff --git a/acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-fedora-21-x86_64.repo b/acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-fedora-21-x86_64.repo deleted file mode 100644 index b84e948547..0000000000 --- a/acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-fedora-21-x86_64.repo +++ /dev/null @@ -1,6 +0,0 @@ -[pl-puppetserver-latest] -name=PL Repo for puppetserver at commit latest -baseurl=http://nightlies.puppetlabs.com/puppetserver-latest/repos/fedora/f21/PC1/x86_64/ -enabled=1 -gpgcheck=1 -gpgkey=http://nightlies.puppetlabs.com/07BB6C57 diff --git a/acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-fedora-22-i386.repo b/acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-fedora-22-i386.repo deleted file mode 100644 index 1dc797fe53..0000000000 --- a/acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-fedora-22-i386.repo +++ /dev/null @@ -1,6 +0,0 @@ -[pl-puppetserver-latest] -name=PL Repo for puppetserver at commit latest -baseurl=http://nightlies.puppetlabs.com/puppetserver-latest/repos/fedora/f22/PC1/i386/ -enabled=1 -gpgcheck=1 -gpgkey=http://nightlies.puppetlabs.com/07BB6C57 diff --git a/acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-fedora-22-x86_64.repo b/acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-fedora-22-x86_64.repo deleted file mode 100644 index 4cbb7288a5..0000000000 --- a/acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-fedora-22-x86_64.repo +++ /dev/null @@ -1,6 +0,0 @@ -[pl-puppetserver-latest] -name=PL Repo for puppetserver at commit latest -baseurl=http://nightlies.puppetlabs.com/puppetserver-latest/repos/fedora/f22/PC1/x86_64/ -enabled=1 -gpgcheck=1 -gpgkey=http://nightlies.puppetlabs.com/07BB6C57 diff --git a/acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-fedora-23-i386.repo b/acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-fedora-23-i386.repo deleted file mode 100644 index bb0e3d40a8..0000000000 --- a/acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-fedora-23-i386.repo +++ /dev/null @@ -1,6 +0,0 @@ -[pl-puppetserver-latest] -name=PL Repo for puppetserver at commit latest -baseurl=http://nightlies.puppetlabs.com/puppetserver-latest/repos/fedora/f23/PC1/i386/ -enabled=1 -gpgcheck=1 -gpgkey=http://nightlies.puppetlabs.com/07BB6C57 diff --git a/acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-fedora-23-x86_64.repo b/acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-fedora-23-x86_64.repo deleted file mode 100644 index aff46b1632..0000000000 --- a/acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-fedora-23-x86_64.repo +++ /dev/null @@ -1,6 +0,0 @@ -[pl-puppetserver-latest] -name=PL Repo for puppetserver at commit latest -baseurl=http://nightlies.puppetlabs.com/puppetserver-latest/repos/fedora/f23/PC1/x86_64/ -enabled=1 -gpgcheck=1 -gpgkey=http://nightlies.puppetlabs.com/07BB6C57 diff --git a/acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-fedora-24-x86_64.repo b/acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-fedora-24-x86_64.repo deleted file mode 100644 index 42af3fdd8e..0000000000 --- a/acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-fedora-24-x86_64.repo +++ /dev/null @@ -1,6 +0,0 @@ -[pl-puppetserver-latest] -name=PL Repo for puppetserver at commit latest -baseurl=http://nightlies.puppetlabs.com/puppetserver-latest/repos/fedora/f24/PC1/x86_64/ -enabled=1 -gpgcheck=1 -gpgkey=http://nightlies.puppetlabs.com/07BB6C57 diff --git a/lib/beaker/host/unix/exec.rb b/lib/beaker/host/unix/exec.rb index 2182f5ac24..feceb98976 100644 --- a/lib/beaker/host/unix/exec.rb +++ b/lib/beaker/host/unix/exec.rb @@ -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]|fedora-(1[4-9]|2[0-9]|3[0-9])|archlinux-/ + when /amazon|(el|centos|redhat|oracle|scientific)-[7-9]|fedora|archlinux-/ exec(Beaker::Command.new("systemctl restart sshd.service")) - when /el-|centos|fedora|redhat|oracle|scientific/ + when /el-|centos|redhat|oracle|scientific/ exec(Beaker::Command.new("/sbin/service sshd restart")) when /opensuse|sles/ exec(Beaker::Command.new("/usr/sbin/rcsshd restart")) diff --git a/lib/beaker/host/unix/pkg.rb b/lib/beaker/host/unix/pkg.rb index 8df96659db..fd5ffbf457 100644 --- a/lib/beaker/host/unix/pkg.rb +++ b/lib/beaker/host/unix/pkg.rb @@ -193,9 +193,9 @@ def upgrade_package(name, cmdline_args = '', opts = {}) case self['platform'] when /opensuse|sles-/ execute("zypper --non-interactive --no-gpg-checks up #{name}", opts) - when /fedora-(2[2-9]|3[0-9])/ + when /fedora/ execute("dnf -y #{cmdline_args} update #{name}", opts) - when /fedora|centos|redhat|el-/ + when /centos|redhat|el-/ execute("yum -y #{cmdline_args} update #{name}", opts) when /ubuntu|debian/ update_apt_if_needed diff --git a/lib/beaker/host_prebuilt_steps.rb b/lib/beaker/host_prebuilt_steps.rb index c87274f2a8..b01394725b 100644 --- a/lib/beaker/host_prebuilt_steps.rb +++ b/lib/beaker/host_prebuilt_steps.rb @@ -379,9 +379,9 @@ def enable_root_login host, opts # restart sshd if /debian|ubuntu/.match?(host['platform']) 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']) + elsif /amazon|arch|(centos|el|redhat)-[789]|fedora/.match?(host['platform']) host.exec(Command.new("sudo -E systemctl restart sshd.service"), { :pty => true }) - elsif /centos|el-|redhat|fedora/.match?(host['platform']) + elsif /centos|el-|redhat/.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")) diff --git a/spec/beaker/host_prebuilt_steps_spec.rb b/spec/beaker/host_prebuilt_steps_spec.rb index 5cedb4803a..a96da9928c 100644 --- a/spec/beaker/host_prebuilt_steps_spec.rb +++ b/spec/beaker/host_prebuilt_steps_spec.rb @@ -97,13 +97,18 @@ ] end - ['centos', 'el-', 'redhat', 'fedora'].each do |redhat_like| + ['centos', 'el-', 'redhat'].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", ] end + it_behaves_like 'enables_root_login', 'fedora', [ + "sudo su -c \"sed -ri 's/^#?PermitRootLogin no|^#?PermitRootLogin yes/PermitRootLogin yes/' /etc/ssh/sshd_config\"", + "sudo -E systemctl restart sshd.service", + ] + context 'timesync' do subject { dummy_class.new } diff --git a/spec/helpers.rb b/spec/helpers.rb index 27f983385a..444ea414e1 100644 --- a/spec/helpers.rb +++ b/spec/helpers.rb @@ -122,9 +122,8 @@ def make_instance instance_data = {} module PlatformHelpers DEBIANPLATFORMS = %w[debian ubuntu] - FEDORASYSTEMD = (14..39).to_a.collect! { |i| "fedora-#{i}" } - SYSTEMDPLATFORMS = %w[amazon-2023 + fedora el-7 centos-7 redhat-7 @@ -133,14 +132,11 @@ module PlatformHelpers el-8 centos-8 redhat-8 - oracle-8].concat(FEDORASYSTEMD) - - FEDORASYSTEMV = (1..13).to_a.collect! { |i| "fedora-#{i}" } + oracle-8] SYSTEMVPLATFORMS = ['el-', 'centos', - 'fedora', 'redhat', 'oracle', - 'scientific',].concat(FEDORASYSTEMV) + 'scientific',] end