beaker 4.40.2 → 4.41.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop_todo.yml +1 -1
- data/CHANGELOG.md +16 -0
- data/lib/beaker/host/unix/exec.rb +3 -3
- data/lib/beaker/host/unix/file.rb +2 -2
- data/lib/beaker/host/unix/pkg.rb +25 -25
- data/lib/beaker/host_prebuilt_steps.rb +12 -9
- data/lib/beaker/perf.rb +3 -3
- data/lib/beaker/platform.rb +19 -16
- data/lib/beaker/version.rb +1 -1
- data/spec/beaker/host/unix/file_spec.rb +2 -4
- data/spec/beaker/host/unix/pkg_spec.rb +22 -7
- data/spec/beaker/host_prebuilt_steps_spec.rb +33 -6
- data/spec/beaker/platform_spec.rb +14 -0
- data/spec/helpers.rb +11 -10
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c06faa5c80dc86ede27a61dca6134f4ce08fa3515920a61fea1076f2864152a4
|
4
|
+
data.tar.gz: 39c5e65099b28d6f858e16f6027e9fb9ab2a0cc3dfc4d157eab5a2fad5b34fc0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9182f83ddcbbdd920d09c8dbc410b7fb017cb22a7a128f30713749ebebd1964a431c6c78aac38d7ba29c75addadd300f7ee539c1b93344f9ca6f302bda2cce6a
|
7
|
+
data.tar.gz: cd4a94ae6414b2b9bf5c225d904f3b87346787abc25e79541d88ccdf5e8074b02a5c2b8ae0b6355268d77b8f2fd07517aaf02f5052c687fc32f4ee57985edc21
|
data/.rubocop_todo.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,21 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [4.41.1](https://github.com/voxpupuli/beaker/tree/4.41.1) (2023-12-04)
|
4
|
+
|
5
|
+
[Full Changelog](https://github.com/voxpupuli/beaker/compare/4.41.0...4.41.1)
|
6
|
+
|
7
|
+
**Fixed bugs:**
|
8
|
+
|
9
|
+
- (maint) Use DNF as Amazon Linux 2023 package manager [\#1831](https://github.com/voxpupuli/beaker/pull/1831) ([mhashizume](https://github.com/mhashizume))
|
10
|
+
|
11
|
+
## [4.41.0](https://github.com/voxpupuli/beaker/tree/4.41.0) (2023-11-15)
|
12
|
+
|
13
|
+
[Full Changelog](https://github.com/voxpupuli/beaker/compare/4.40.2...4.41.0)
|
14
|
+
|
15
|
+
**Implemented enhancements:**
|
16
|
+
|
17
|
+
- \[PA-5938\] Add support for debian & amazon linux in beaker 4.x [\#1828](https://github.com/voxpupuli/beaker/pull/1828) ([span786](https://github.com/span786))
|
18
|
+
|
3
19
|
## [4.40.2](https://github.com/voxpupuli/beaker/tree/4.40.2) (2023-07-26)
|
4
20
|
|
5
21
|
[Full Changelog](https://github.com/voxpupuli/beaker/compare/4.40.1...4.40.2)
|
@@ -280,7 +280,7 @@ module Unix::Exec
|
|
280
280
|
case self['platform']
|
281
281
|
when /debian|ubuntu|cumulus|huaweios/
|
282
282
|
exec(Beaker::Command.new("service ssh restart"))
|
283
|
-
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-/
|
283
|
+
when /amazon|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-/
|
284
284
|
exec(Beaker::Command.new("systemctl restart sshd.service"))
|
285
285
|
when /el-|centos|fedora|redhat|oracle|scientific|eos/
|
286
286
|
exec(Beaker::Command.new("/sbin/service sshd restart"))
|
@@ -302,8 +302,8 @@ module Unix::Exec
|
|
302
302
|
# (from {#ssh_service_restart}).
|
303
303
|
def ssh_permit_user_environment
|
304
304
|
case self['platform']
|
305
|
-
when /debian|ubuntu|cumulus|huaweios|archlinux|el-|centos|fedora|redhat|oracle|scientific|eos|opensuse|sles|solaris/
|
306
|
-
directory = tmpdir
|
305
|
+
when /amazon|debian|ubuntu|cumulus|huaweios|archlinux|el-|centos|fedora|redhat|oracle|scientific|eos|opensuse|sles|solaris/
|
306
|
+
directory = tmpdir
|
307
307
|
exec(Beaker::Command.new("echo 'PermitUserEnvironment yes' | cat - /etc/ssh/sshd_config > #{directory}/sshd_config.permit"))
|
308
308
|
exec(Beaker::Command.new("mv #{directory}/sshd_config.permit /etc/ssh/sshd_config"))
|
309
309
|
exec(Beaker::Command.new("echo '' >/etc/environment")) if /ubuntu-2(0|2).04/.match?(self['platform'])
|
@@ -88,7 +88,7 @@ module Unix::File
|
|
88
88
|
# @return [String] Path to package config dir
|
89
89
|
def package_config_dir
|
90
90
|
case self['platform']
|
91
|
-
when /fedora|el-|redhat|centos/
|
91
|
+
when /amazon|fedora|el-|redhat|centos/
|
92
92
|
'/etc/yum.repos.d/'
|
93
93
|
when /opensuse|sles/
|
94
94
|
'/etc/zypp/repos.d/'
|
@@ -154,7 +154,7 @@ module Unix::File
|
|
154
154
|
# @return [String] Type of repo (rpm|deb)
|
155
155
|
def repo_type
|
156
156
|
case self['platform']
|
157
|
-
when /fedora|el-|redhat|centos|opensuse|sles/
|
157
|
+
when /amazon|fedora|el-|redhat|centos|opensuse|sles/
|
158
158
|
'rpm'
|
159
159
|
when /debian|ubuntu|cumulus|huaweios/
|
160
160
|
'deb'
|
data/lib/beaker/host/unix/pkg.rb
CHANGED
@@ -40,7 +40,7 @@ module Unix::Pkg
|
|
40
40
|
when /el-4/
|
41
41
|
@logger.debug("Package query not supported on rhel4")
|
42
42
|
return false
|
43
|
-
when /cisco|fedora|centos|redhat|eos|el-/
|
43
|
+
when /amazon|cisco|fedora|centos|redhat|eos|el-/
|
44
44
|
result = execute("rpm -q #{name}", opts) { |result| result }
|
45
45
|
when /ubuntu|debian|cumulus|huaweios/
|
46
46
|
result = execute("dpkg -s #{name}", opts) { |result| result }
|
@@ -91,7 +91,7 @@ module Unix::Pkg
|
|
91
91
|
execute("zypper --non-interactive --gpg-auto-import-keys in #{name}", opts)
|
92
92
|
when /el-4/
|
93
93
|
@logger.debug("Package installation not supported on rhel4")
|
94
|
-
when /fedora-(2[2-9]|3[0-9])/
|
94
|
+
when /amazon-2023|fedora-(2[2-9]|3[0-9])/
|
95
95
|
if version
|
96
96
|
name = "#{name}-#{version}"
|
97
97
|
end
|
@@ -179,26 +179,26 @@ module Unix::Pkg
|
|
179
179
|
|
180
180
|
def uninstall_package(name, cmdline_args = '', opts = {})
|
181
181
|
case self['platform']
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
182
|
+
when /opensuse|sles-/
|
183
|
+
execute("zypper --non-interactive rm #{name}", opts)
|
184
|
+
when /el-4/
|
185
|
+
@logger.debug("Package uninstallation not supported on rhel4")
|
186
|
+
when /amazon-2023|fedora-(2[2-9]|3[0-9])/
|
187
|
+
execute("dnf -y #{cmdline_args} remove #{name}", opts)
|
188
|
+
when /cisco|fedora|centos|redhat|eos|el-/
|
189
|
+
execute("yum -y #{cmdline_args} remove #{name}", opts)
|
190
|
+
when /ubuntu|debian|cumulus|huaweios/
|
191
|
+
execute("apt-get purge #{cmdline_args} -y #{name}", opts)
|
192
|
+
when /solaris-11/
|
193
|
+
execute("pkg #{cmdline_args} uninstall #{name}", opts)
|
194
|
+
when /solaris-10/
|
195
|
+
execute("pkgrm -n #{cmdline_args} #{name}", opts)
|
196
|
+
when /aix/
|
197
|
+
execute("rpm #{cmdline_args} -e #{name}", opts)
|
198
|
+
when /archlinux/
|
199
|
+
execute("pacman -R --noconfirm #{cmdline_args} #{name}", opts)
|
200
|
+
else
|
201
|
+
raise "Package #{name} cannot be installed on #{self}"
|
202
202
|
end
|
203
203
|
end
|
204
204
|
|
@@ -527,9 +527,9 @@ module Unix::Pkg
|
|
527
527
|
def install_local_package(onhost_package_file, onhost_copy_dir = nil)
|
528
528
|
variant, version, _arch, _codename = self['platform'].to_array
|
529
529
|
case variant
|
530
|
-
when /^(fedora|el|redhat|centos)$/
|
530
|
+
when /^(amazon|fedora|el|redhat|centos)$/
|
531
531
|
command_name = 'yum'
|
532
|
-
command_name = 'dnf' if variant == 'fedora' && version.to_i > 21
|
532
|
+
command_name = 'dnf' if (variant == 'fedora' && version.to_i > 21) || (variant == 'amazon' && version.to_i >= 2023)
|
533
533
|
execute("#{command_name} --nogpgcheck localinstall -y #{onhost_package_file}")
|
534
534
|
when /^(opensuse|sles)$/
|
535
535
|
execute("zypper --non-interactive --no-gpg-checks in #{onhost_package_file}")
|
@@ -557,7 +557,7 @@ module Unix::Pkg
|
|
557
557
|
def uncompress_local_tarball(onhost_tar_file, onhost_base_dir, download_file)
|
558
558
|
variant, version, _arch, _codename = self['platform'].to_array
|
559
559
|
case variant
|
560
|
-
when /^(fedora|el|centos|redhat|opensuse|sles|debian|ubuntu|cumulus)$/
|
560
|
+
when /^(amazon|fedora|el|centos|redhat|opensuse|sles|debian|ubuntu|cumulus)$/
|
561
561
|
execute("tar -zxvf #{onhost_tar_file} -C #{onhost_base_dir}")
|
562
562
|
when /^solaris$/
|
563
563
|
# uncompress PE puppet-agent tarball
|
@@ -12,7 +12,8 @@ module Beaker
|
|
12
12
|
NTPSERVER = 'pool.ntp.org'
|
13
13
|
SLEEPWAIT = 5
|
14
14
|
TRIES = 5
|
15
|
-
|
15
|
+
AMAZON2023_PACKAGES = %w[curl-minimal chrony]
|
16
|
+
RHEL8_PACKAGES = %w[curl chrony]
|
16
17
|
RHEL9_PACKAGES = ['chrony']
|
17
18
|
FEDORA_PACKAGES = ['curl', 'chrony']
|
18
19
|
UNIX_PACKAGES = ['curl', 'ntpdate']
|
@@ -54,7 +55,7 @@ module Beaker
|
|
54
55
|
logger.notify "NTP date succeeded on #{host}"
|
55
56
|
else
|
56
57
|
case
|
57
|
-
when /el-[89]|fedora/.match?(host['platform'])
|
58
|
+
when /amazon|el-[89]|fedora/.match?(host['platform'])
|
58
59
|
ntp_command = "chronyc add server #{ntp_server} prefer trust;chronyc makestep;chronyc burst 1/2"
|
59
60
|
when /opensuse-|sles-/.match?(host['platform'])
|
60
61
|
ntp_command = "sntp #{ntp_server}"
|
@@ -114,6 +115,8 @@ module Beaker
|
|
114
115
|
# @return [Array<String>] A list of packages to install
|
115
116
|
def host_packages(host)
|
116
117
|
case host['platform']
|
118
|
+
when /amazon/
|
119
|
+
AMAZON2023_PACKAGES
|
117
120
|
when /el-8/
|
118
121
|
RHEL8_PACKAGES
|
119
122
|
when /el-9/
|
@@ -461,9 +464,9 @@ module Beaker
|
|
461
464
|
end
|
462
465
|
#restart sshd
|
463
466
|
if /debian|ubuntu|cumulus/.match?(host['platform'])
|
464
|
-
host.exec(Command.new("sudo su -c \"service ssh restart\""), {:pty => true})
|
465
|
-
elsif /arch|(centos|el|redhat)-[789]|fedora-(1[4-9]|2[0-9]|3[0-9])/.match?(host['platform'])
|
466
|
-
host.exec(Command.new("sudo -E systemctl restart sshd.service"), {:pty => true})
|
467
|
+
host.exec(Command.new("sudo su -c \"service ssh restart\""), { :pty => true })
|
468
|
+
elsif /amazon|arch|(centos|el|redhat)-[789]|fedora-(1[4-9]|2[0-9]|3[0-9])/.match?(host['platform'])
|
469
|
+
host.exec(Command.new("sudo -E systemctl restart sshd.service"), { :pty => true })
|
467
470
|
elsif /centos|el-|redhat|fedora|eos/.match?(host['platform'])
|
468
471
|
host.exec(Command.new("sudo -E /sbin/service sshd reload"), {:pty => true})
|
469
472
|
elsif /(free|open)bsd/.match?(host['platform'])
|
@@ -520,10 +523,10 @@ module Beaker
|
|
520
523
|
block_on host do |host|
|
521
524
|
logger.debug("enabling proxy support on #{host.name}")
|
522
525
|
case host['platform']
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
526
|
+
when /ubuntu/, /debian/, /cumulus/
|
527
|
+
host.exec(Command.new("echo 'Acquire::http::Proxy \"#{opts[:package_proxy]}/\";' >> /etc/apt/apt.conf.d/10proxy"))
|
528
|
+
when /amazon/, /^el-/, /centos/, /fedora/, /redhat/, /eos/
|
529
|
+
host.exec(Command.new("echo 'proxy=#{opts[:package_proxy]}/' >> /etc/yum.conf"))
|
527
530
|
else
|
528
531
|
logger.debug("Attempting to enable package manager proxy support on non-supported platform: #{host.name}: #{host['platform']}")
|
529
532
|
end
|
data/lib/beaker/perf.rb
CHANGED
@@ -4,8 +4,8 @@ module Beaker
|
|
4
4
|
|
5
5
|
PERF_PACKAGES = ['sysstat']
|
6
6
|
# SLES does not treat sysstat as a service that can be started
|
7
|
-
PERF_SUPPORTED_PLATFORMS = /debian|ubuntu|redhat|centos|oracle|scientific|fedora|el|eos|cumulus|opensuse|sles/
|
8
|
-
PERF_START_PLATFORMS = /debian|ubuntu|redhat|centos|oracle|scientific|fedora|el|eos|cumulus/
|
7
|
+
PERF_SUPPORTED_PLATFORMS = /amazon|debian|ubuntu|redhat|centos|oracle|scientific|fedora|el|eos|cumulus|opensuse|sles/
|
8
|
+
PERF_START_PLATFORMS = /amazon|debian|ubuntu|redhat|centos|oracle|scientific|fedora|el|eos|cumulus/
|
9
9
|
|
10
10
|
# Create the Perf instance and runs setup_perf_on_host on all hosts if --collect-perf-data
|
11
11
|
# was used as an option on the Baker command line invocation. Instances of this class do not
|
@@ -50,7 +50,7 @@ module Beaker
|
|
50
50
|
@logger.perf_output("Enabling aggressive sysstat polling")
|
51
51
|
if /debian|ubuntu/.match?(host['platform'])
|
52
52
|
host.exec(Command.new('sed -i s/5-55\\\/10/*/ /etc/cron.d/sysstat'))
|
53
|
-
elsif /centos|el|fedora|oracle|redhat|scientific/.match?(host['platform'])
|
53
|
+
elsif /amazon|centos|el|fedora|oracle|redhat|scientific/.match?(host['platform'])
|
54
54
|
host.exec(Command.new('sed -i s/*\\\/10/*/ /etc/cron.d/sysstat'))
|
55
55
|
end
|
56
56
|
end
|
data/lib/beaker/platform.rb
CHANGED
@@ -3,24 +3,26 @@ module Beaker
|
|
3
3
|
# all String methods while adding several platform-specific use cases.
|
4
4
|
class Platform < String
|
5
5
|
# Supported platforms
|
6
|
-
PLATFORMS = /^(alpine|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)\-.+\-.+$/
|
6
|
+
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)\-.+\-.+$/
|
7
7
|
# Platform version numbers vs. codenames conversion hash
|
8
8
|
PLATFORM_VERSION_CODES =
|
9
|
-
{ :debian => { "
|
10
|
-
"
|
11
|
-
"
|
12
|
-
"
|
13
|
-
"
|
14
|
-
"
|
15
|
-
|
16
|
-
|
17
|
-
"
|
18
|
-
|
19
|
-
"
|
20
|
-
"
|
21
|
-
"
|
22
|
-
"
|
23
|
-
"
|
9
|
+
{ :debian => { "forky" => "14",
|
10
|
+
"trixie" => "13",
|
11
|
+
"bookworm" => "12",
|
12
|
+
"bullseye" => "11",
|
13
|
+
"buster" => "10",
|
14
|
+
"stretch" => "9",
|
15
|
+
"jessie" => "8",
|
16
|
+
"wheezy" => "7",
|
17
|
+
"squeeze" => "6", },
|
18
|
+
:ubuntu => { "jammy" => "2204",
|
19
|
+
"focal" => "2004",
|
20
|
+
"eoan" => "1910",
|
21
|
+
"disco" => "1904",
|
22
|
+
"cosmic" => "1810",
|
23
|
+
"bionic" => "1804",
|
24
|
+
"artful" => "1710",
|
25
|
+
"zesty" => "1704",
|
24
26
|
"yakkety" => "1610",
|
25
27
|
"xenial" => "1604",
|
26
28
|
"wily" => "1510",
|
@@ -57,6 +59,7 @@ module Beaker
|
|
57
59
|
# Creates the Platform object. Checks to ensure that the platform String
|
58
60
|
# provided meets the platform formatting rules. Platforms name must be of
|
59
61
|
# the format /^OSFAMILY-VERSION-ARCH.*$/ where OSFAMILY is one of:
|
62
|
+
# * amazon
|
60
63
|
# * huaweios
|
61
64
|
# * cisco_nexus
|
62
65
|
# * cisco_ios_xr
|
data/lib/beaker/version.rb
CHANGED
@@ -36,8 +36,7 @@ module Beaker
|
|
36
36
|
let(:instance) { UnixFileTest.new(opts.merge(platform), logger) }
|
37
37
|
|
38
38
|
describe '#repo_type' do
|
39
|
-
|
40
|
-
['centos','redhat'].each do |platform|
|
39
|
+
%w[amazon centos redhat].each do |platform|
|
41
40
|
it "returns correctly for platform '#{platform}'" do
|
42
41
|
@platform = "#{platform}-5-x86_64"
|
43
42
|
expect( instance.repo_type ).to be === 'rpm'
|
@@ -58,8 +57,7 @@ module Beaker
|
|
58
57
|
end
|
59
58
|
|
60
59
|
describe '#package_config_dir' do
|
61
|
-
|
62
|
-
['centos','redhat'].each do |platform|
|
60
|
+
%w[amazon centos redhat].each do |platform|
|
63
61
|
it "returns correctly for platform '#{platform}'" do
|
64
62
|
@platform = "#{platform}-5-x86_64"
|
65
63
|
expect( instance.package_config_dir ).to be === '/etc/yum.repos.d/'
|
@@ -127,7 +127,7 @@ module Beaker
|
|
127
127
|
expect( instance.check_for_package(pkg) ).to be === true
|
128
128
|
end
|
129
129
|
|
130
|
-
[
|
130
|
+
%w[amazon centos redhat].each do |platform|
|
131
131
|
it "checks correctly on #{platform}" do
|
132
132
|
@opts = {'platform' => "#{platform}-is-me"}
|
133
133
|
pkg = "#{platform}_package"
|
@@ -267,12 +267,20 @@ module Beaker
|
|
267
267
|
end
|
268
268
|
end
|
269
269
|
|
270
|
+
it "uses dnf on amazon-2023" do
|
271
|
+
@opts = { 'platform' => "amazon-2023-is-me" }
|
272
|
+
pkg = 'amazon_package'
|
273
|
+
expect(Beaker::Command).to receive(:new).with("dnf -y install #{pkg}", [], { :prepend_cmds => nil, :cmdexe => false }).and_return('')
|
274
|
+
expect(instance).to receive(:exec).with('', {}).and_return(generate_result("hello", { :exit_code => 0 }))
|
275
|
+
expect(instance.install_package(pkg)).to be == "hello"
|
276
|
+
end
|
277
|
+
|
270
278
|
it "uses pacman on archlinux" do
|
271
|
-
@opts = {'platform' => 'archlinux-is-me'}
|
279
|
+
@opts = { 'platform' => 'archlinux-is-me' }
|
272
280
|
pkg = 'archlinux_package'
|
273
|
-
expect(
|
274
|
-
expect(
|
275
|
-
expect(
|
281
|
+
expect(Beaker::Command).to receive(:new).with("pacman -S --noconfirm #{pkg}", [], { :prepend_cmds => nil, :cmdexe => false }).and_return('')
|
282
|
+
expect(instance).to receive(:exec).with('', {}).and_return(generate_result("hello", { :exit_code => 0 }))
|
283
|
+
expect(instance.install_package(pkg)).to be == "hello"
|
276
284
|
end
|
277
285
|
end
|
278
286
|
|
@@ -531,7 +539,15 @@ module Beaker
|
|
531
539
|
let( :version ) { @version || 6 }
|
532
540
|
|
533
541
|
before do
|
534
|
-
allow(
|
542
|
+
allow(instance).to receive(:[]).with('platform') { Beaker::Platform.new("#{platform}-#{version}-x86_64") }
|
543
|
+
end
|
544
|
+
|
545
|
+
it 'amazon-2023: uses dnf' do
|
546
|
+
@platform = platform
|
547
|
+
@version = '2023'
|
548
|
+
package_file = 'test_123.yay'
|
549
|
+
expect(instance).to receive(:execute).with(/^dnf.*#{package_file}$/)
|
550
|
+
instance.install_local_package(package_file)
|
535
551
|
end
|
536
552
|
|
537
553
|
it 'Fedora 22-39: uses dnf' do
|
@@ -654,4 +670,3 @@ module Beaker
|
|
654
670
|
end
|
655
671
|
end
|
656
672
|
end
|
657
|
-
|
@@ -13,6 +13,7 @@ describe Beaker do
|
|
13
13
|
let( :sles_only_pkgs ) { Beaker::HostPrebuiltSteps::SLES_PACKAGES }
|
14
14
|
let( :rhel8_packages ) { Beaker::HostPrebuiltSteps::RHEL8_PACKAGES }
|
15
15
|
let( :fedora_packages) { Beaker::HostPrebuiltSteps::FEDORA_PACKAGES }
|
16
|
+
let(:amazon2023_packages) { Beaker::HostPrebuiltSteps::AMAZON2023_PACKAGES }
|
16
17
|
let( :platform ) { @platform || 'unix' }
|
17
18
|
let( :ip ) { "ip.address.0.0" }
|
18
19
|
let( :stdout) { @stdout || ip }
|
@@ -87,7 +88,12 @@ describe Beaker do
|
|
87
88
|
"if grep \"root::::type=role\" /etc/user_attr; then sudo rolemod -K type=normal root; else echo \"root user already type=normal\"; fi"
|
88
89
|
], true
|
89
90
|
|
90
|
-
|
91
|
+
it_behaves_like 'enables_root_login', 'amazon-2023', [
|
92
|
+
"sudo -E systemctl restart sshd.service",
|
93
|
+
"sudo su -c \"sed -ri 's/^#?PermitRootLogin no|^#?PermitRootLogin yes/PermitRootLogin yes/' /etc/ssh/sshd_config\"",
|
94
|
+
]
|
95
|
+
|
96
|
+
%w[debian ubuntu cumulus].each do |deb_like|
|
91
97
|
it_behaves_like 'enables_root_login', deb_like, [
|
92
98
|
"sudo su -c \"sed -ri 's/^#?PermitRootLogin no|^#?PermitRootLogin yes/PermitRootLogin yes/' /etc/ssh/sshd_config\"",
|
93
99
|
"sudo su -c \"service ssh restart\""
|
@@ -144,12 +150,20 @@ describe Beaker do
|
|
144
150
|
end
|
145
151
|
|
146
152
|
it "can sync time on Sles hosts" do
|
147
|
-
hosts = make_hosts(
|
153
|
+
hosts = make_hosts({ :platform => 'sles-13.1-x64' })
|
148
154
|
|
149
|
-
expect(
|
155
|
+
expect(Beaker::Command).to receive(:new).with("sntp #{ntpserver}").exactly(3).times
|
150
156
|
|
151
|
-
subject.timesync(
|
157
|
+
subject.timesync(hosts, options)
|
158
|
+
end
|
152
159
|
|
160
|
+
it "can sync time on amazon2023 hosts" do
|
161
|
+
hosts = make_hosts(:platform => 'amazon-2023-x86_64')
|
162
|
+
expect(Beaker::Command).to receive(:new)
|
163
|
+
.with("chronyc add server #{ntpserver} prefer trust;chronyc makestep;chronyc burst 1/2")
|
164
|
+
.exactly(3)
|
165
|
+
.times
|
166
|
+
subject.timesync(hosts, options)
|
153
167
|
end
|
154
168
|
|
155
169
|
it "can sync time on RHEL8 hosts" do
|
@@ -489,6 +503,19 @@ describe Beaker do
|
|
489
503
|
subject.validate_host(hosts, options)
|
490
504
|
end
|
491
505
|
|
506
|
+
it "can validate Amazon hosts" do
|
507
|
+
@platform = 'amazon-2023-x86_64'
|
508
|
+
|
509
|
+
hosts.each do |host|
|
510
|
+
amazon2023_packages.each do |pkg|
|
511
|
+
expect(host).to receive(:check_for_package).with(pkg).once.and_return(false)
|
512
|
+
expect(host).to receive(:install_package).with(pkg).once
|
513
|
+
end
|
514
|
+
end
|
515
|
+
|
516
|
+
subject.validate_host(hosts, options)
|
517
|
+
end
|
518
|
+
|
492
519
|
it 'skips validation on cisco hosts' do
|
493
520
|
host = make_host('cisco-7', { stdout: stdout, platform: 'cisco_nexus-7-x86_64' })
|
494
521
|
expect( subject ).to receive( :check_and_install_packages_if_needed ).with(host, []).once
|
@@ -533,7 +560,7 @@ describe Beaker do
|
|
533
560
|
end
|
534
561
|
end
|
535
562
|
|
536
|
-
[
|
563
|
+
%w[amazon centos redhat].each do |platform|
|
537
564
|
context "on platform '#{platform}'" do
|
538
565
|
let(:host) { make_host( 'name', {
|
539
566
|
:platform => platform,
|
@@ -635,7 +662,7 @@ describe Beaker do
|
|
635
662
|
subject.package_proxy(host, options.merge( {'package_proxy' => proxyurl}) )
|
636
663
|
end
|
637
664
|
|
638
|
-
[
|
665
|
+
%w[amazon centos redhat].each do |platform|
|
639
666
|
it "can set proxy config on a '#{platform}' host" do
|
640
667
|
host = make_host('name', { :platform => platform } )
|
641
668
|
|
@@ -66,6 +66,20 @@ module Beaker
|
|
66
66
|
end
|
67
67
|
|
68
68
|
context 'with_version_codename' do
|
69
|
+
it "can convert debian-14-xxx to debian-forky-xxx" do
|
70
|
+
@name = 'debian-14-xxx'
|
71
|
+
expect(platform.with_version_codename).to be === 'debian-forky-xxx'
|
72
|
+
end
|
73
|
+
|
74
|
+
it "can convert debian-13-xxx to debian-trixie-xxx" do
|
75
|
+
@name = 'debian-13-xxx'
|
76
|
+
expect(platform.with_version_codename).to be === 'debian-trixie-xxx'
|
77
|
+
end
|
78
|
+
|
79
|
+
it "can convert debian-12-xxx to debian-bookworm-xxx" do
|
80
|
+
@name = 'debian-12-xxx'
|
81
|
+
expect(platform.with_version_codename).to be === 'debian-bookworm-xxx'
|
82
|
+
end
|
69
83
|
|
70
84
|
it "can convert debian-11-xxx to debian-bullseye-xxx" do
|
71
85
|
@name = 'debian-11-xxx'
|
data/spec/helpers.rb
CHANGED
@@ -132,16 +132,17 @@ module PlatformHelpers
|
|
132
132
|
|
133
133
|
FEDORASYSTEMD = (14..39).to_a.collect! { |i| "fedora-#{i}" }
|
134
134
|
|
135
|
-
SYSTEMDPLATFORMS = [
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
135
|
+
SYSTEMDPLATFORMS = %w[amazon-2023
|
136
|
+
el-7
|
137
|
+
centos-7
|
138
|
+
redhat-7
|
139
|
+
oracle-7
|
140
|
+
scientific-7
|
141
|
+
eos-7
|
142
|
+
el-8
|
143
|
+
centos-8
|
144
|
+
redhat-8
|
145
|
+
oracle-8].concat(FEDORASYSTEMD)
|
145
146
|
|
146
147
|
FEDORASYSTEMV = (1..13).to_a.collect! { |i| "fedora-#{i}" }
|
147
148
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: beaker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.41.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Puppet
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-12-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fakefs
|