beaker 7.8.1 → 7.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 64705ecc4d36dfd8388655a14f0e35f897dbbe201fbe7e38c2303dadf4a29d9e
4
- data.tar.gz: ba6c7790d328b191e9f3cdbee701d570f03fb0faf66f5eb05c9f622dd65d9e76
3
+ metadata.gz: 5455c2d1cebdb2d73661f32339bb96c2b47e6d8195e822e90f8a6ec7e70f3ebb
4
+ data.tar.gz: d6c85cc74414509a007961f62bdc42f693ad367119d8b4bd3ed241156fbe1216
5
5
  SHA512:
6
- metadata.gz: 9d1d8a81da7ddc95cae0aee120d936fc5c433bb3eb7132d0f902a8fa35b0876c91495398abdba2a7cd37e230e8e1f788c2418383cf5665ecd59f417a4b400d25
7
- data.tar.gz: 1926fe23cb90e9a2c8c93a8a8b4ff7fd44e79a273350b9bde338ef82032f6a6b073b4293a44534b83a4fde5d738a6eb963a49d9c3a69225ef164613004954dec
6
+ metadata.gz: 9b8930a7bbadf2a1d5e5849315b2d8821e5d11d3b29c0f156d2ad1267e14265df07c9309c6862c70cbdc810d7b07103a09754dd25f1b0c6c40a4c24b38ae554a
7
+ data.tar.gz: e8c5c06e24ceaf07cd795b3e817d7460a2be9451d3c264845173171d1c31eca05dcdf0f493bf916ec78f7a0bf835711c1284030f603e369bd16cdc74c9caf235
@@ -17,7 +17,7 @@ jobs:
17
17
  steps:
18
18
  - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
19
19
  - name: Install Ruby
20
- uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
20
+ uses: ruby/setup-ruby@bec3f19a76460dbe12f60def7d1a77585f07516c # v1.322.0
21
21
  with:
22
22
  ruby-version: 'ruby'
23
23
  - name: Build gem
@@ -96,7 +96,7 @@ jobs:
96
96
  with:
97
97
  name: gem-artifact
98
98
  - name: Install Ruby
99
- uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
99
+ uses: ruby/setup-ruby@bec3f19a76460dbe12f60def7d1a77585f07516c # v1.322.0
100
100
  with:
101
101
  ruby-version: 'ruby'
102
102
  - name: Wait for release to propagate
@@ -18,7 +18,7 @@ jobs:
18
18
  steps:
19
19
  - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
20
20
  - name: Install Ruby ${{ matrix.ruby }}
21
- uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
21
+ uses: ruby/setup-ruby@bec3f19a76460dbe12f60def7d1a77585f07516c # v1.322.0
22
22
  with:
23
23
  ruby-version: '4.0'
24
24
  bundler-cache: true
@@ -40,7 +40,7 @@ jobs:
40
40
  steps:
41
41
  - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
42
42
  - name: Install Ruby ${{ matrix.ruby }}
43
- uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
43
+ uses: ruby/setup-ruby@bec3f19a76460dbe12f60def7d1a77585f07516c # v1.322.0
44
44
  with:
45
45
  ruby-version: ${{ matrix.ruby }}
46
46
  bundler-cache: true
data/CHANGELOG.md CHANGED
@@ -2,9 +2,28 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
- ## [7.8.1](https://github.com/voxpupuli/beaker/tree/7.8.1) (2026-09-04)
5
+ ## [7.8.3](https://github.com/voxpupuli/beaker/tree/7.8.3) (2026-09-17)
6
6
 
7
- [Full Changelog](https://github.com/voxpupuli/beaker/compare/v7.8.0...7.8.1)
7
+ [Full Changelog](https://github.com/voxpupuli/beaker/compare/v7.8.2...7.8.3)
8
+
9
+ **Fixed bugs:**
10
+
11
+ - Fix Solaris sshd\_config editing in ssh\_permit\_user\_environment [\#2029](https://github.com/voxpupuli/beaker/pull/2029) ([shubhamshinde360](https://github.com/shubhamshinde360))
12
+
13
+ ## [v7.8.2](https://github.com/voxpupuli/beaker/tree/v7.8.2) (2026-09-09)
14
+
15
+ [Full Changelog](https://github.com/voxpupuli/beaker/compare/v7.8.1...v7.8.2)
16
+
17
+ **Fixed bugs:**
18
+
19
+ - Create root's dotfiles on EL 8+ hosts \(the other half of \#2033\) [\#2037](https://github.com/voxpupuli/beaker/pull/2037) ([silug](https://github.com/silug))
20
+ - Fix NTP on Ubuntu 26.04 by using chrony [\#2036](https://github.com/voxpupuli/beaker/pull/2036) ([bwitt](https://github.com/bwitt))
21
+ - Install iproute on EL 8+ hosts [\#2035](https://github.com/voxpupuli/beaker/pull/2035) ([silug](https://github.com/silug))
22
+ - Fix Debian 13 NTP setup by using chrony [\#1996](https://github.com/voxpupuli/beaker/pull/1996) ([treydock](https://github.com/treydock))
23
+
24
+ ## [v7.8.1](https://github.com/voxpupuli/beaker/tree/v7.8.1) (2026-09-04)
25
+
26
+ [Full Changelog](https://github.com/voxpupuli/beaker/compare/v7.8.0...v7.8.1)
8
27
 
9
28
  **Fixed bugs:**
10
29
 
@@ -300,11 +300,13 @@ module Unix::Exec
300
300
  # (from {#ssh_service_restart}).
301
301
  def ssh_permit_user_environment
302
302
  case self['platform']
303
- when /amazon|debian|ubuntu|archlinux|el-|centos|fedora|redhat|oracle|scientific|opensuse|sles|solaris/
303
+ when /amazon|debian|ubuntu|archlinux|el-|centos|fedora|redhat|oracle|scientific|opensuse|sles/
304
304
  directory = tmpdir
305
305
  exec(Beaker::Command.new("sed -e 's/^PermitUserEnvironment .*/PermitUserEnvironment yes/' -e t -e '1s/^/PermitUserEnvironment yes\\n/' /etc/ssh/sshd_config > #{directory}/sshd_config.permit"))
306
306
  exec(Beaker::Command.new("mv #{directory}/sshd_config.permit /etc/ssh/sshd_config"))
307
307
  exec(Beaker::Command.new("echo '' >/etc/environment")) if self['platform'].include?('ubuntu-')
308
+ when /solaris/
309
+ exec(Beaker::Command.new("perl -i -0777 -pe 's/^#?PermitUserEnvironment\\b[^\\n]*/PermitUserEnvironment yes/m or s/\\z/PermitUserEnvironment yes\\n/' /etc/ssh/sshd_config"))
308
310
  when /(free|open)bsd/
309
311
  exec(Beaker::Command.new("sudo perl -pi -e 's/^#?PermitUserEnvironment no/PermitUserEnvironment yes/' /etc/ssh/sshd_config"), { :pty => true })
310
312
  else
@@ -13,6 +13,13 @@ module Beaker
13
13
  ETC_HOSTS_PATH = "/etc/hosts"
14
14
  ETC_HOSTS_PATH_SOLARIS = "/etc/inet/hosts"
15
15
  ROOT_KEYS_SCRIPT = "https://raw.githubusercontent.com/puppetlabs/puppetlabs-sshkeys/master/templates/scripts/manage_root_authorized_keys"
16
+ # Prefer the mechanism a booted host uses (the tmpfiles rule); fall back
17
+ # to copying the templates where systemd-tmpfiles is not available.
18
+ ROOT_DOTFILES_SYNC_CMD = 'if [ -f /usr/lib/tmpfiles.d/rootfiles.conf ] && command -v systemd-tmpfiles >/dev/null 2>&1; then ' \
19
+ 'systemd-tmpfiles --create rootfiles.conf; ' \
20
+ 'elif [ -d /usr/share/rootfiles ]; then ' \
21
+ 'for f in /usr/share/rootfiles/.[!.]*; do [ -e "/root/${f##*/}" ] || cp -p "$f" /root/; done; ' \
22
+ 'fi'
16
23
  ROOT_KEYS_SYNC_CMD = "curl -k -o - -L #{ROOT_KEYS_SCRIPT} | %s"
17
24
  ROOT_KEYS_SYNC_CMD_AIX = "curl --tlsv1 -o - -L #{ROOT_KEYS_SCRIPT} | %s"
18
25
 
@@ -72,11 +79,41 @@ module Beaker
72
79
  logger = opts[:logger]
73
80
  block_on host do |host|
74
81
  check_and_install_packages_if_needed(host, host_packages(host))
82
+ ensure_root_dotfiles(host)
75
83
  end
76
84
  rescue => e
77
85
  report_and_raise(logger, e, "validate")
78
86
  end
79
87
 
88
+ # Make sure root's shell dotfiles exist on EL 8+ and Fedora hosts.
89
+ #
90
+ # Since rootfiles 8.1-32 (EL 9+) and 9.0 (Fedora 43+), `/root/.bashrc`
91
+ # and friends are no longer shipped as regular files: they are %ghost
92
+ # entries that systemd-tmpfiles copies out of `/usr/share/rootfiles` at
93
+ # boot, per `/usr/lib/tmpfiles.d/rootfiles.conf`. Nothing else runs that
94
+ # rule -- the systemd package carries no tmpfiles file trigger -- so in a
95
+ # container, which is never booted, installing the package leaves /root
96
+ # without the dotfiles.
97
+ #
98
+ # That matters because a non-interactive bash started by sshd only
99
+ # sources `/etc/bashrc` (and from there `/etc/profile.d/*.sh`) through
100
+ # `~/.bashrc`. Without it, PATH additions made in profile.d, such as
101
+ # `/etc/profile.d/puppet-agent.sh`, never reach commands run over ssh.
102
+ #
103
+ # Apply the tmpfiles rule the way boot would, and fall back to copying
104
+ # the templates when systemd-tmpfiles is not installed. Either path only
105
+ # creates files that are missing, so this is a no-op on a booted host,
106
+ # on hosts whose rootfiles still ships the files directly (no rule and no
107
+ # `/usr/share/rootfiles`), and for any customised file already in /root.
108
+ #
109
+ # @param [Host] host Host to act on
110
+ def ensure_root_dotfiles(host)
111
+ platform = host['platform']
112
+ return unless (platform.variant == 'el' && platform.version.to_i >= 8) || platform.variant == 'fedora'
113
+
114
+ host.exec(Command.new(ROOT_DOTFILES_SYNC_CMD), :accept_all_exit_codes => true)
115
+ end
116
+
80
117
  # Return a list of packages that should be present.
81
118
  #
82
119
  # @param [Host] host A host return the packages for
@@ -109,6 +109,11 @@ module Beaker
109
109
  true
110
110
  when 'el'
111
111
  @version.to_i >= 8
112
+ when 'debian'
113
+ @version.to_i >= 13
114
+ when 'ubuntu'
115
+ # version may be '2604' or '26.04'
116
+ @version.delete('.').to_i >= 2604
112
117
  else
113
118
  false
114
119
  end
@@ -120,7 +125,7 @@ module Beaker
120
125
  def base_packages
121
126
  case @variant
122
127
  when 'el'
123
- @version.to_i >= 8 ? %w[iputils rootfiles] : %w[curl]
128
+ @version.to_i >= 8 ? %w[iputils iproute rootfiles] : %w[curl]
124
129
  when 'debian'
125
130
  %w[curl lsb-release]
126
131
  when 'freebsd'
@@ -132,7 +137,7 @@ module Beaker
132
137
  when 'amazon', 'amazonfips'
133
138
  ['iputils']
134
139
  when 'fedora'
135
- %w[iputils iproute]
140
+ %w[iputils iproute rootfiles]
136
141
  when 'aix', 'osx', 'windows'
137
142
  []
138
143
  else
@@ -1,5 +1,5 @@
1
1
  module Beaker
2
2
  module Version
3
- STRING = '7.8.1'
3
+ STRING = '7.8.3'
4
4
  end
5
5
  end
@@ -95,6 +95,18 @@ module Beaker
95
95
  expect { instance.ssh_permit_user_environment }.not_to raise_error
96
96
  end
97
97
  end
98
+
99
+ context 'on Solaris' do
100
+ PlatformHelpers::SOLARISPLATFORMS.each do |platform|
101
+ it "calls the correct commands for #{platform}" do
102
+ opts['platform'] = platform
103
+ expect(instance).to receive(:exec).once
104
+ expect(Beaker::Command).to receive(:new).with("perl -i -0777 -pe 's/^#?PermitUserEnvironment\\b[^\\n]*/PermitUserEnvironment yes/m or s/\\z/PermitUserEnvironment yes\\n/' /etc/ssh/sshd_config")
105
+ expect(instance).to receive(:ssh_service_restart)
106
+ expect { instance.ssh_permit_user_environment }.not_to raise_error
107
+ end
108
+ end
109
+ end
98
110
  end
99
111
 
100
112
  it 'raises an error on unsupported platforms' do
@@ -276,10 +276,27 @@ describe Beaker do
276
276
  it "can validate el-9 hosts" do
277
277
  host = make_host('host', { :platform => 'el-9-64' })
278
278
 
279
- %w[iputils rootfiles].each do |pkg|
279
+ %w[iputils iproute rootfiles].each do |pkg|
280
280
  expect(host).to receive(:check_for_package).with(pkg).once.and_return(false)
281
281
  expect(host).to receive(:install_package).with(pkg).once
282
282
  end
283
+ # rootfiles alone is not enough in a container: its dotfiles are
284
+ # tmpfiles-created %ghost files, so the tmpfiles rule is applied too
285
+ expect(host).to receive(:exec).with(
286
+ satisfy { |cmd| cmd.command.include?('systemd-tmpfiles --create rootfiles.conf') && cmd.command.include?('/usr/share/rootfiles') },
287
+ { :accept_all_exit_codes => true },
288
+ ).once
289
+
290
+ subject.validate_host(host, options)
291
+ end
292
+
293
+ it "does not touch root's dotfiles on non-EL hosts" do
294
+ host = make_host('host', { :platform => 'debian-12-64' })
295
+ allow(host).to receive(:check_for_package).and_return(true)
296
+
297
+ expect(host).not_to receive(:exec).with(
298
+ satisfy { |cmd| cmd.command.include?('/usr/share/rootfiles') }, anything
299
+ )
283
300
 
284
301
  subject.validate_host(host, options)
285
302
  end
@@ -321,7 +338,7 @@ describe Beaker do
321
338
  it "can validate RHEL8 hosts" do
322
339
  host = make_host('host', { :platform => 'el-8-64' })
323
340
 
324
- %w[iputils rootfiles].each do |pkg|
341
+ %w[iputils iproute rootfiles].each do |pkg|
325
342
  expect(host).to receive(:check_for_package).with(pkg).once.and_return(false)
326
343
  expect(host).to receive(:install_package).with(pkg).once
327
344
  end
@@ -332,10 +349,15 @@ describe Beaker do
332
349
  it "can validate Fedora hosts" do
333
350
  host = make_host('host', { :platform => 'fedora-32-x86_64' })
334
351
 
335
- ['iputils', 'iproute'].each do |pkg|
352
+ %w[iputils iproute rootfiles].each do |pkg|
336
353
  expect(host).to receive(:check_for_package).with(pkg).once.and_return(false)
337
354
  expect(host).to receive(:install_package).with(pkg).once
338
355
  end
356
+ # Fedora 43+ rootfiles is tmpfiles-based like EL 9+, so the rule is applied too
357
+ expect(host).to receive(:exec).with(
358
+ satisfy { |cmd| cmd.command.include?('systemd-tmpfiles --create rootfiles.conf') },
359
+ { :accept_all_exit_codes => true },
360
+ ).once
339
361
 
340
362
  subject.validate_host(host, options)
341
363
  end
data/spec/helpers.rb CHANGED
@@ -136,4 +136,6 @@ module PlatformHelpers
136
136
  scientific
137
137
  archlinux
138
138
  ]
139
+
140
+ SOLARISPLATFORMS = %w[solaris10-SPARC solaris11-SPARC]
139
141
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beaker
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.8.1
4
+ version: 7.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet
@@ -755,7 +755,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
755
755
  - !ruby/object:Gem::Version
756
756
  version: '0'
757
757
  requirements: []
758
- rubygems_version: 4.0.16
758
+ rubygems_version: 4.0.20
759
759
  specification_version: 4
760
760
  summary: Let's test Puppet!
761
761
  test_files: []