beaker 4.30.0 → 4.34.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0f1cace175ace50c7737ff2962cd6f7bddb7037cb7e9fe8ecc638d4acdc088a7
4
- data.tar.gz: 81d573163a08a3b7a2d0b63039a2e41202c70fc9c3909247b8f897b2ed84016b
3
+ metadata.gz: bc022311d195fb3d0b0ff1b9b957272379e6adc5aadb1dfb30e77d89a912872d
4
+ data.tar.gz: be60dbf2c333ea695d3e6d8b4b8fd5dc6811acbe6489e17cf924b08f24c79b05
5
5
  SHA512:
6
- metadata.gz: 6a8506c9f3f460f1e64cb35ea4abd992c284b64b3d9f28c914186e8a8c35d59aa30ff0c15f8d7069b8b789c9b69b47c8234045b2eb5aad6cacc53b455dc10ae4
7
- data.tar.gz: 22edf3d35e3d9c5c38b3eb2dc925e73dd355ceec5e3a60614190fc66f2010776f05dafd0b6d7fff792d17b0c3b8c2e4768d6baba1213457f195c426f9eeebf6f
6
+ metadata.gz: '0287d90c4f88b325f104eb4dd36ad8d75f26f070c2851d4bec00c364ee3150fc706902667ecd14f1e127cd5e4030d8a418ce0dccbe9a6ec9f58dbdd08a81a1de'
7
+ data.tar.gz: 8db6cc489d03e57bf25f373cd20dbc1c99b3d1eebbd7108191bd133e3152f61b8333a8f24667f7ed24c29ba4f29242bfaa5c016c24d380a11c24cb0c3207d942
@@ -1,8 +1,9 @@
1
1
  name: Release
2
2
 
3
3
  on:
4
- create:
5
- ref_type: tag
4
+ push:
5
+ tags:
6
+ - '*'
6
7
 
7
8
  jobs:
8
9
  release:
data/CHANGELOG.md CHANGED
@@ -1,6 +1,44 @@
1
1
  # Changelog
2
2
 
3
- ## [4.30.0](https://github.com/voxpupuli/beaker/compare/4.29.1...4.30.0) (2021-07-21)
3
+ ## [4.34.0](https://github.com/voxpupuli/beaker/tree/4.34.0) (2022-01-27)
4
+
5
+ ### Added
6
+
7
+ - Extract a host_packages method from validate_host ([#1729](https://github.com/voxpupuli/beaker/pull/1729))
8
+ - Reduce duplication in ssh_permit_user_environment ([#1728](https://github.com/voxpupuli/beaker/pull/1728))
9
+
10
+ ### Fixed
11
+
12
+ - Do not install curl on EL9 ([#1728](https://github.com/voxpupuli/beaker/pull/1732))
13
+ - Drop old Ruby 1.8 compatibility code ([#1728](https://github.com/voxpupuli/beaker/pull/1730))
14
+
15
+ ## [4.33.0](https://github.com/voxpupuli/beaker/tree/4.33.0) (2022-01-21)
16
+
17
+ ### Added
18
+
19
+ - Add ed25519 as runtime dependency ([#1726](https://github.com/voxpupuli/beaker/pull/1726))
20
+
21
+ ## [4.32.0](https://github.com/voxpupuli/beaker/tree/4.32.0) (2021-12-06)
22
+
23
+ ### Fixed
24
+
25
+ - Arch Linux: install net-tools and openssh ([#1722](https://github.com/voxpupuli/beaker/pull/1722))
26
+
27
+ ### Added
28
+
29
+ - Initial EL9 support ([#1719](https://github.com/voxpupuli/beaker/pull/1719))
30
+
31
+ ## [4.31.0](https://github.com/voxpupuli/beaker/tree/4.31.0) (2021-11-02)
32
+
33
+ ### Fixed
34
+
35
+ - (BKR-1690) Fix localhost logging ([#1691](https://github.com/voxpupuli/beaker/pull/1691))
36
+
37
+ ### Added
38
+
39
+ - Made fips_check? more generally applicable ([#1717]https://github.com/voxpupuli/beaker/pull/1717))
40
+
41
+ ## [4.30.0](https://github.com/voxpupuli/beaker/tree/4.30.0) (2021-07-21)
4
42
 
5
43
  ### Fixed
6
44
 
data/HISTORY.md CHANGED
@@ -1,4 +1,14 @@
1
- ## [4.30.0](https://github.com/voxpupuli/beaker/compare/4.29.1...4.30.0) (2021-07-21)
1
+ ## [4.31.0](https://github.com/voxpupuli/beaker/tree/4.31.0) (2021-11-02)
2
+
3
+ ### Fixed
4
+
5
+ - (BKR-1690) Fix localhost logging ([#1691](https://github.com/voxpupuli/beaker/pull/1691))
6
+
7
+ ### Added
8
+
9
+ - Made fips_check? more generally applicable ([#1717]https://github.com/voxpupuli/beaker/pull/1717))
10
+
11
+ ## [4.30.0](https://github.com/voxpupuli/beaker/tree/4.30.0) (2021-07-21)
2
12
 
3
13
  ### Fixed
4
14
 
data/beaker.gemspec CHANGED
@@ -26,12 +26,6 @@ Gem::Specification.new do |s|
26
26
  s.add_development_dependency 'fakefs', '~> 1.0'
27
27
  s.add_development_dependency 'rake', '~> 13.0'
28
28
 
29
- # Provisioner dependencies - needed for acceptance tests
30
- # TODO: figure out how to remove these
31
- s.add_development_dependency 'beaker-aws', '~> 0.1'
32
- s.add_development_dependency 'beaker-abs', '>= 0.4'
33
- s.add_development_dependency 'beaker-vmpooler', '~> 1.0'
34
-
35
29
  # Documentation dependencies
36
30
  s.add_development_dependency 'yard', '~> 0.9.11'
37
31
 
@@ -45,6 +39,7 @@ Gem::Specification.new do |s|
45
39
 
46
40
  s.add_runtime_dependency 'hocon', '~> 1.0'
47
41
  s.add_runtime_dependency 'net-ssh', '>= 5.0'
42
+ s.add_runtime_dependency 'ed25519', '~> 1.0' # net-ssh compatibility with ed25519 keys
48
43
  s.add_runtime_dependency 'net-scp', '>= 1.2', '< 4.0'
49
44
  s.add_runtime_dependency 'inifile', '~> 3.0'
50
45
 
@@ -302,29 +302,11 @@ 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/
305
+ when /debian|ubuntu|cumulus|huaweios|archlinux|el-|centos|fedora|redhat|oracle|scientific|eos|opensuse|sles|solaris/
306
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 self['platform'] =~ /ubuntu-20.04/
310
- when /el-7|centos-7|redhat-7|oracle-7|scientific-7|eos-7|el-8|centos-8|redhat-8|oracle-8/
311
- directory = tmpdir()
312
- exec(Beaker::Command.new("echo 'PermitUserEnvironment yes' | cat - /etc/ssh/sshd_config > #{directory}/sshd_config.permit"))
313
- exec(Beaker::Command.new("mv #{directory}/sshd_config.permit /etc/ssh/sshd_config"))
314
- when /el-|centos|fedora|redhat|oracle|scientific|eos/
315
- directory = tmpdir()
316
- exec(Beaker::Command.new("echo 'PermitUserEnvironment yes' | cat - /etc/ssh/sshd_config > #{directory}/sshd_config.permit"))
317
- exec(Beaker::Command.new("mv #{directory}/sshd_config.permit /etc/ssh/sshd_config"))
318
- when /opensuse|sles/
319
- directory = tmpdir()
320
- exec(Beaker::Command.new("echo 'PermitUserEnvironment yes' | cat - /etc/ssh/sshd_config > #{directory}/sshd_config.permit"))
321
- exec(Beaker::Command.new("mv #{directory}/sshd_config.permit /etc/ssh/sshd_config"))
322
- when /solaris/
323
- # kept solaris here because refactoring it into its own Host module
324
- # conflicts with the solaris hypervisor that already exists
325
- directory = tmpdir()
326
- exec(Beaker::Command.new("echo 'PermitUserEnvironment yes' | cat - /etc/ssh/sshd_config > #{directory}/sshd_config.permit"))
327
- exec(Beaker::Command.new("mv #{directory}/sshd_config.permit /etc/ssh/sshd_config"))
328
310
  when /(free|open)bsd/
329
311
  exec(Beaker::Command.new("sudo perl -pi -e 's/^#?PermitUserEnvironment no/PermitUserEnvironment yes/' /etc/ssh/sshd_config"), {:pty => true} )
330
312
  else
data/lib/beaker/host.rb CHANGED
@@ -211,13 +211,8 @@ module Beaker
211
211
  end
212
212
 
213
213
  # Returns true if the host is running in FIPS mode.
214
- #
215
- # We currently only test FIPS mode on Redhat 7. Other detection
216
- # modes should be added here if we expand FIPS support to other
217
- # platforms.
218
214
  def fips_mode?
219
- case self['platform']
220
- when /el-7/
215
+ if self.file_exist?('/proc/sys/crypto/fips_enabled')
221
216
  begin
222
217
  execute("cat /proc/sys/crypto/fips_enabled") == "1"
223
218
  rescue Beaker::Host::CommandFailure
@@ -13,11 +13,12 @@ module Beaker
13
13
  SLEEPWAIT = 5
14
14
  TRIES = 5
15
15
  RHEL8_PACKAGES = ['curl', 'chrony']
16
+ RHEL9_PACKAGES = ['chrony']
16
17
  FEDORA_PACKAGES = ['curl', 'chrony']
17
18
  UNIX_PACKAGES = ['curl', 'ntpdate']
18
19
  FREEBSD_PACKAGES = ['curl', 'perl5|perl']
19
20
  OPENBSD_PACKAGES = ['curl']
20
- ARCHLINUX_PACKAGES = ['curl', 'ntp']
21
+ ARCHLINUX_PACKAGES = ['curl', 'ntp', 'net-tools', 'openssh']
21
22
  WINDOWS_PACKAGES = ['curl']
22
23
  PSWINDOWS_PACKAGES = []
23
24
  SLES10_PACKAGES = ['curl']
@@ -53,7 +54,7 @@ module Beaker
53
54
  logger.notify "NTP date succeeded on #{host}"
54
55
  else
55
56
  case
56
- when host['platform'] =~ /el-8|fedora/
57
+ when host['platform'] =~ /el-[89]|fedora/
57
58
  ntp_command = "chronyc add server #{ntp_server} prefer trust;chronyc makestep;chronyc burst 1/2"
58
59
  when host['platform'] =~ /opensuse-|sles-/
59
60
  ntp_command = "sntp #{ntp_server}"
@@ -101,42 +102,58 @@ module Beaker
101
102
  def validate_host host, opts
102
103
  logger = opts[:logger]
103
104
  block_on host do |host|
104
- case
105
- when host['platform'] =~ /el-8/
106
- check_and_install_packages_if_needed(host, RHEL8_PACKAGES)
107
- when host['platform'] =~ /sles-10/
108
- check_and_install_packages_if_needed(host, SLES10_PACKAGES)
109
- when host['platform'] =~ /opensuse|sles-/
110
- check_and_install_packages_if_needed(host, SLES_PACKAGES)
111
- when host['platform'] =~ /debian/
112
- check_and_install_packages_if_needed(host, DEBIAN_PACKAGES)
113
- when host['platform'] =~ /cumulus/
114
- check_and_install_packages_if_needed(host, CUMULUS_PACKAGES)
115
- when (host['platform'] =~ /windows/ and host.is_cygwin?)
116
- raise RuntimeError, "cygwin is not installed on #{host}" if !host.cygwin_installed?
117
- check_and_install_packages_if_needed(host, WINDOWS_PACKAGES)
118
- when (host['platform'] =~ /windows/ and not host.is_cygwin?)
119
- check_and_install_packages_if_needed(host, PSWINDOWS_PACKAGES)
120
- when host['platform'] =~ /freebsd/
121
- check_and_install_packages_if_needed(host, FREEBSD_PACKAGES)
122
- when host['platform'] =~ /openbsd/
123
- check_and_install_packages_if_needed(host, OPENBSD_PACKAGES)
124
- when host['platform'] =~ /solaris-10/
125
- check_and_install_packages_if_needed(host, SOLARIS10_PACKAGES)
126
- when host['platform'] =~ /solaris-1[1-9]/
127
- check_and_install_packages_if_needed(host, SOLARIS11_PACKAGES)
128
- when host['platform'] =~ /archlinux/
129
- check_and_install_packages_if_needed(host, ARCHLINUX_PACKAGES)
130
- when host['platform'] =~ /fedora/
131
- check_and_install_packages_if_needed(host, FEDORA_PACKAGES)
132
- when host['platform'] !~ /debian|aix|solaris|windows|opensuse-|sles-|osx-|cumulus|f5-|netscaler|cisco_/
133
- check_and_install_packages_if_needed(host, UNIX_PACKAGES)
134
- end
105
+ check_and_install_packages_if_needed(host, host_packages(host))
135
106
  end
136
107
  rescue => e
137
108
  report_and_raise(logger, e, "validate")
138
109
  end
139
110
 
111
+ # Return a list of packages that should be present.
112
+ #
113
+ # @param [Host] host A host return the packages for
114
+ # @return [Array<String>] A list of packages to install
115
+ def host_packages(host)
116
+ case host['platform']
117
+ when /el-8/
118
+ RHEL8_PACKAGES
119
+ when /el-9/
120
+ RHEL9_PACKAGES
121
+ when /sles-10/
122
+ SLES10_PACKAGES
123
+ when /opensuse|sles-/
124
+ SLES_PACKAGES
125
+ when /debian/
126
+ DEBIAN_PACKAGES
127
+ when /cumulus/
128
+ CUMULUS_PACKAGES
129
+ when /windows/
130
+ if host.is_cygwin?
131
+ raise RuntimeError, "cygwin is not installed on #{host}" if !host.cygwin_installed?
132
+ WINDOWS_PACKAGES
133
+ else
134
+ PSWINDOWS_PACKAGES
135
+ end
136
+ when /freebsd/
137
+ FREEBSD_PACKAGES
138
+ when /openbsd/
139
+ OPENBSD_PACKAGES
140
+ when /solaris-10/
141
+ SOLARIS10_PACKAGES
142
+ when /solaris-1[1-9]/
143
+ SOLARIS11_PACKAGES
144
+ when /archlinux/
145
+ ARCHLINUX_PACKAGES
146
+ when /fedora/
147
+ FEDORA_PACKAGES
148
+ else
149
+ if host['platform'] !~ /aix|solaris|osx-|f5-|netscaler|cisco_/
150
+ UNIX_PACKAGES
151
+ else
152
+ []
153
+ end
154
+ end
155
+ end
156
+
140
157
  # Installs the given packages if they aren't already on a host
141
158
  #
142
159
  # @param [Host] host Host to act on
@@ -452,7 +469,7 @@ module Beaker
452
469
  #restart sshd
453
470
  if host['platform'] =~ /debian|ubuntu|cumulus/
454
471
  host.exec(Command.new("sudo su -c \"service ssh restart\""), {:pty => true})
455
- elsif host['platform'] =~ /arch|centos-7|el-7|redhat-7|centos-8|el-8|redhat-8|fedora-(1[4-9]|2[0-9]|3[0-9])/
472
+ elsif host['platform'] =~ /arch|(centos|el|redhat)-[789]|fedora-(1[4-9]|2[0-9]|3[0-9])/
456
473
  host.exec(Command.new("sudo -E systemctl restart sshd.service"), {:pty => true})
457
474
  elsif host['platform'] =~ /centos|el-|redhat|fedora|eos/
458
475
  host.exec(Command.new("sudo -E /sbin/service sshd reload"), {:pty => true})
@@ -53,9 +53,12 @@ module Beaker
53
53
  result.stdout << std_out
54
54
  result.stderr << std_err
55
55
  result.exit_code = status.exitstatus
56
+ @logger.info(result.stdout) unless result.stdout.empty?
57
+ @logger.info(result.stderr) unless result.stderr.empty?
56
58
  end
57
59
  rescue => e
58
60
  result.stderr << e.inspect
61
+ @logger.info(result.stderr)
59
62
  result.exit_code = 1
60
63
  end
61
64
 
@@ -130,14 +130,5 @@ module Beaker
130
130
  def with_version_number
131
131
  [@variant, @version, @arch].join('-')
132
132
  end
133
-
134
- if RUBY_VERSION =~ /^1\.9/
135
- def init_with(coder)
136
- coder.map.each do |ivar, value|
137
- instance_variable_set("@#{ivar}", value)
138
- end
139
- replace("#{@variant}-#{@version}-#{@arch}")
140
- end
141
- end
142
133
  end
143
134
  end
@@ -1,5 +1,5 @@
1
1
  module Beaker
2
2
  module Version
3
- STRING = '4.30.0'
3
+ STRING = '4.34.0'
4
4
  end
5
5
  end
@@ -489,9 +489,9 @@ describe Beaker do
489
489
  end
490
490
 
491
491
  it 'skips validation on cisco hosts' do
492
- @platform = 'cisco_nexus-7-x86_64'
493
- expect( subject ).to receive( :check_and_install_packages_if_needed ).never
494
- subject.validate_host(hosts, options)
492
+ host = make_host('cisco-7', { stdout: stdout, platform: 'cisco_nexus-7-x86_64' })
493
+ expect( subject ).to receive( :check_and_install_packages_if_needed ).with(host, []).once
494
+ subject.validate_host(host, options)
495
495
  end
496
496
  end
497
497
 
@@ -832,21 +832,29 @@ module Beaker
832
832
  end
833
833
 
834
834
  describe "#fips_mode?" do
835
- it 'returns false on non-el7 hosts' do
835
+ it 'returns false on non-linux hosts' do
836
836
  @platform = 'windows'
837
+ expect(host).to receive(:file_exist?).with('/proc/sys/crypto/fips_enabled').and_return(false)
837
838
  expect(host.fips_mode?).to be false
838
839
  end
839
840
 
840
- it 'returns true when the `fips_enabled` file is present and contains "1"' do
841
- @platform = 'el-7'
842
- expect(host).to receive(:execute).with("cat /proc/sys/crypto/fips_enabled").and_return("1")
843
- expect(host.fips_mode?).to be true
844
- end
841
+ platforms = ['el-7', 'el-8', 'centos']
845
842
 
846
- it 'returns false when the `fips_enabled` file is present and contains "0"' do
847
- @platform = 'el-7'
848
- expect(host).to receive(:execute).with("cat /proc/sys/crypto/fips_enabled").and_return("0")
849
- expect(host.fips_mode?).to be false
843
+ platforms.each do |platform|
844
+ context "on #{platform}" do
845
+ it 'returns true when the `fips_enabled` file is present and contains "1"' do
846
+ @platform = platform
847
+ expect(host).to receive(:file_exist?).with('/proc/sys/crypto/fips_enabled').and_return(true)
848
+ expect(host).to receive(:execute).with("cat /proc/sys/crypto/fips_enabled").and_return("1")
849
+ expect(host.fips_mode?).to be true
850
+ end
851
+
852
+ it 'returns false when the `fips_enabled` file is present and contains "0"' do
853
+ @platform = platform
854
+ expect(host).to receive(:execute).with("cat /proc/sys/crypto/fips_enabled").and_return("0")
855
+ expect(host.fips_mode?).to be false
856
+ end
857
+ end
850
858
  end
851
859
  end
852
860
  end
@@ -17,12 +17,7 @@ module Beaker
17
17
  expect( logger.convert(valid_utf8) ).to be === valid_utf8
18
18
  end
19
19
  it 'strips out invalid utf-8 characters' do
20
- #this is 1.9 behavior only
21
- if RUBY_VERSION.to_f >= 1.9
22
- expect( logger.convert(invalid_utf8) ).to be === valid_utf8
23
- else
24
- pending "not supported in ruby 1.8 (using #{RUBY_VERSION})"
25
- end
20
+ expect( logger.convert(invalid_utf8) ).to be === valid_utf8
26
21
  end
27
22
  it 'supports frozen strings' do
28
23
  valid_utf8.freeze
@@ -145,7 +145,7 @@ module Beaker
145
145
  end
146
146
  end
147
147
 
148
- context 'round tripping from yaml', if: RUBY_VERSION =~ /^1\.9/ do
148
+ context 'round tripping from yaml' do
149
149
  before do
150
150
  @name = 'ubuntu-14.04-x86_64'
151
151
  end
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.30.0
4
+ version: 4.34.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-21 00:00:00.000000000 Z
11
+ date: 2022-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -66,48 +66,6 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '13.0'
69
- - !ruby/object:Gem::Dependency
70
- name: beaker-aws
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: '0.1'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: '0.1'
83
- - !ruby/object:Gem::Dependency
84
- name: beaker-abs
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: '0.4'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- version: '0.4'
97
- - !ruby/object:Gem::Dependency
98
- name: beaker-vmpooler
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - "~>"
102
- - !ruby/object:Gem::Version
103
- version: '1.0'
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - "~>"
109
- - !ruby/object:Gem::Version
110
- version: '1.0'
111
69
  - !ruby/object:Gem::Dependency
112
70
  name: yard
113
71
  requirement: !ruby/object:Gem::Requirement
@@ -220,6 +178,20 @@ dependencies:
220
178
  - - ">="
221
179
  - !ruby/object:Gem::Version
222
180
  version: '5.0'
181
+ - !ruby/object:Gem::Dependency
182
+ name: ed25519
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - "~>"
186
+ - !ruby/object:Gem::Version
187
+ version: '1.0'
188
+ type: :runtime
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - "~>"
193
+ - !ruby/object:Gem::Version
194
+ version: '1.0'
223
195
  - !ruby/object:Gem::Dependency
224
196
  name: net-scp
225
197
  requirement: !ruby/object:Gem::Requirement
@@ -704,7 +676,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
704
676
  - !ruby/object:Gem::Version
705
677
  version: '0'
706
678
  requirements: []
707
- rubygems_version: 3.2.22
679
+ rubygems_version: 3.2.32
708
680
  signing_key:
709
681
  specification_version: 4
710
682
  summary: Let's test Puppet!