beaker 5.1.0 → 5.2.0

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: 5ed6c6126f85203546e505eb1c8b8770582c303c11db2ab209e6cd1f03414fe5
4
- data.tar.gz: f007b424a8e1a4097c5704a5f009ec5d38c69e55535c4a40618eabf57e69637b
3
+ metadata.gz: d16043faca3a48ef9dd5a7171bf0241dd30fd801029eba8e881fe9d3d8afbef1
4
+ data.tar.gz: 64bec8b91441d824ad87a112914a5f41b5fe2b48131b9f6d99599b201279b4a3
5
5
  SHA512:
6
- metadata.gz: 646c6603a729bbe62a91365a7c90c3de1a960517e0a8b036076ba9f6705b7971ab630f5d86a1ce2a3d690094459c2730e8522ebc01108557f5f8fa64fc3c3cf9
7
- data.tar.gz: fd96942cd14a89a587fc010495f66124761c59502ad98b43f813bb80c53fd5429a748c710e9e4f4e614b59e789251e96957abbabaec486f39015f3524e9c6d50
6
+ metadata.gz: 17f0baf5a669e5ffa2e9f4214dbeb84f0e5fbf4ff80e048243215006aa8e5fc91be5df24e1714f71962a7a1d2e3d4f83c74c987f98a9a8ceff2b9397762b5167
7
+ data.tar.gz: 2826c21940af588185545f7a4f987600a789a9c646b9fe0d31d9e6d6f4f5eae0573d51591de0943d0dc9077cb0e0f3114291881fc10c6dcd3b54af24ec2425e2
data/.rubocop.yml CHANGED
@@ -1,8 +1,10 @@
1
1
  ---
2
2
  inherit_from:
3
- - rubocop.yml
4
3
  - .rubocop_todo.yml
5
4
 
5
+ inherit_gem:
6
+ voxpupuli-rubocop: rubocop.yml
7
+
6
8
  Layout/LineLength:
7
9
  Exclude:
8
10
  - acceptance/**/*.rb
@@ -40,6 +42,9 @@ RSpec/StubbedMock:
40
42
  RSpec/MultipleExpectations:
41
43
  Enabled: false
42
44
 
45
+ RSpec/IndexedLet:
46
+ Enabled: false
47
+
43
48
  RSpec/NestedGroups:
44
49
  Max: 4
45
50
 
data/.rubocop_todo.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config --no-offense-counts --no-auto-gen-timestamp`
3
- # using RuboCop version 1.48.0.
3
+ # using RuboCop version 1.50.1.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
@@ -236,4 +236,4 @@ Security/Open:
236
236
  # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
237
237
  # URISchemes: http, https
238
238
  Layout/LineLength:
239
- Max: 226
239
+ Max: 225
data/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # Changelog
2
2
 
3
+ ## [5.2.0](https://github.com/voxpupuli/beaker/tree/5.2.0) (2023-04-28)
4
+
5
+ **Implemented enhancements:**
6
+
7
+ - Enhance documentation about roles [\#1800](https://github.com/voxpupuli/beaker/pull/1800) ([rwaffen](https://github.com/rwaffen))
8
+ - Declare API interface on Beaker::Host [\#1806](https://github.com/voxpupuli/beaker/pull/1806) ([ekohl](https://github.com/ekohl))
9
+ - Support an extension to tmpfile [\#1735](https://github.com/voxpupuli/beaker/pull/1735) ([ekohl](https://github.com/ekohl))
10
+
11
+ **Fixed bugs:**
12
+
13
+ - Use systemctl to restat SSH on EL9 [\#1808](https://github.com/voxpupuli/beaker/pull/1808) ([ekohl](https://github.com/ekohl))
14
+
15
+ **Merged changes:**
16
+
17
+ - Drop legacy yard tasks [\#1805](https://github.com/voxpupuli/beaker/pull/1805) ([bastelfreak](https://github.com/bastelfreak))
18
+ - Switch to voxpupuli-rubocop [\#1804](https://github.com/voxpupuli/beaker/pull/1804) ([bastelfreak](https://github.com/bastelfreak))
19
+ - Disable RSpec/IndexedLet [\#1807](https://github.com/voxpupuli/beaker/pull/1807) ([ekohl](https://github.com/ekohl))
20
+
3
21
  ## [5.1.0](https://github.com/voxpupuli/beaker/tree/5.1.0) (2023-03-27)
4
22
 
5
23
  **Implemented enhancements:**
data/Gemfile CHANGED
@@ -25,13 +25,6 @@ if ENV['BEAKER_HYPERVISOR']
25
25
  gem "beaker-#{ENV['BEAKER_HYPERVISOR'].split('_').first}"
26
26
  end
27
27
 
28
- group :rubocop do
29
- gem 'rubocop', '~> 1.48.0'
30
- gem 'rubocop-performance', '~> 1.16.0'
31
- gem 'rubocop-rake', '~> 0.6.0'
32
- gem 'rubocop-rspec', '~> 2.19.0'
33
- end
34
-
35
28
  group :release do
36
29
  gem 'github_changelog_generator', require: false
37
30
  end
data/Rakefile CHANGED
@@ -16,14 +16,6 @@ end
16
16
 
17
17
  task :acceptance => ['test:base', 'test:hypervisor']
18
18
 
19
- task :yard do
20
- Rake::Task['docs:gen'].invoke
21
- end
22
-
23
- task :history do
24
- Rake::Task['history:gen'].invoke
25
- end
26
-
27
19
  module HarnessOptions
28
20
  defaults = {
29
21
  :tests => ['tests'],
@@ -189,120 +181,6 @@ namespace :test do
189
181
  end
190
182
  end
191
183
 
192
- ###########################################################
193
- #
194
- # History Tasks
195
- #
196
- ###########################################################
197
- namespace :history do
198
- desc 'Generate HISTORY.md'
199
- task :gen do
200
- Dir.chdir(__dir__) do
201
- output = `bundle exec ruby history.rb .`
202
- puts output
203
- raise "History generation failed" if !output.include?('success')
204
- end
205
- end
206
- end
207
-
208
- ###########################################################
209
- #
210
- # Documentation Tasks
211
- #
212
- ###########################################################
213
- DOCS_DIR = 'yard_docs'
214
- DOCS_DAEMON = "yard server --reload --daemon --docroot #{DOCS_DIR}"
215
- FOREGROUND_SERVER = "bundle exec yard server --reload --verbose lib/beaker --docroot #{DOCS_DIR}"
216
-
217
- def running?(cmdline)
218
- ps = `ps -ef`
219
- found = ps.lines.grep(/#{Regexp.quote(cmdline)}/)
220
- raise StandardError, "Found multiple YARD Servers. Don't know what to do." if found.length > 1
221
-
222
- yes = found.empty? ? false : true
223
- return yes, found.first
224
- end
225
-
226
- def pid_from(output)
227
- output.squeeze(' ').strip.split(' ')[1]
228
- end
229
-
230
- desc 'Start the documentation server in the foreground'
231
- task :docs => 'docs:clear' do
232
- Dir.chdir(__dir__) do
233
- sh FOREGROUND_SERVER
234
- end
235
- end
236
-
237
- namespace :docs do
238
- desc 'Clear the generated documentation cache'
239
- task :clear do
240
- Dir.chdir(__dir__) do
241
- sh "rm -rf #{DOCS_DIR}"
242
- end
243
- end
244
-
245
- desc 'Generate static documentation'
246
- task :gen => 'docs:clear' do
247
- Dir.chdir(__dir__) do
248
- output = `bundle exec yard doc -o #{DOCS_DIR}`
249
- puts output
250
- fail "Errors/Warnings during yard documentation generation" if /\[warn\]|\[error\]/.match?(output)
251
- end
252
- end
253
-
254
- desc 'Run the documentation server in the background, alias `bg`'
255
- task :background => 'docs:clear' do
256
- yes, output = running?(DOCS_DAEMON)
257
- if yes
258
- puts "Not starting a new YARD Server..."
259
- puts "Found one running with pid #{pid_from(output)}."
260
- else
261
- Dir.chdir(__dir__) do
262
- sh "bundle exec #{DOCS_DAEMON}"
263
- end
264
- end
265
- end
266
-
267
- task(:bg) { Rake::Task['docs:background'].invoke }
268
-
269
- desc 'Check the status of the documentation server'
270
- task :status do
271
- yes, output = running?(DOCS_DAEMON)
272
- if yes
273
- pid = pid_from(output)
274
- puts "Found a YARD Server running with pid #{pid}"
275
- else
276
- puts "Could not find a running YARD Server."
277
- end
278
- end
279
-
280
- desc "Stop a running YARD Server"
281
- task :stop do
282
- yes, output = running?(DOCS_DAEMON)
283
- if yes
284
- pid = pid_from(output)
285
- puts "Found a YARD Server running with pid #{pid}"
286
- `kill #{pid}`
287
- puts "Stopping..."
288
- yes, _output = running?(DOCS_DAEMON)
289
- if yes
290
- `kill -9 #{pid}`
291
- yes, _output = running?(DOCS_DAEMON)
292
- if yes
293
- puts "Could not Stop Server!"
294
- else
295
- puts "Server stopped."
296
- end
297
- else
298
- puts "Server stopped."
299
- end
300
- else
301
- puts "Could not find a running YARD Server"
302
- end
303
- end
304
- end
305
-
306
184
  begin
307
185
  require 'rubygems'
308
186
  require 'github_changelog_generator/task'
data/beaker.gemspec CHANGED
@@ -22,9 +22,7 @@ Gem::Specification.new do |s|
22
22
  s.add_development_dependency 'fakefs', '~> 2.4'
23
23
  s.add_development_dependency 'rake', '~> 13.0'
24
24
  s.add_development_dependency 'rspec', '~> 3.0'
25
-
26
- # Documentation dependencies
27
- s.add_development_dependency 'yard', '~> 0.9.11'
25
+ s.add_development_dependency 'voxpupuli-rubocop', '~> 1.1'
28
26
 
29
27
  # Run time dependencies
30
28
  s.add_runtime_dependency 'minitar', '~> 0.6'
@@ -45,6 +45,7 @@ To properly define a host you must provide:
45
45
 
46
46
  * name: The string identifying this host.
47
47
  * platform: One of the Beaker supported platforms.
48
+ * roles: In a multi-host setup roles are mandatory. One host needs the role of `default`. Roles describe the 'job' of a host, an array of `master`, `agent`, `frictionless`, `dashboard`, `database`, `default` or any user-defined string.
48
49
 
49
50
  ## Optional Host Settings
50
51
 
@@ -54,7 +55,7 @@ Additionally, Beaker supports the following host options:
54
55
  * hypervisor: One of `docker`, `solaris`, `ec2`, `vsphere`, `fusion`, `aix`, `vcloud` or `vagrant`.
55
56
  * Additional settings may be required depending on the selected hypervisor (ie, template, box, box_url, etc). Check the documentation below for your hypervisor for details.
56
57
  * snapshot: The name of the snapshot to revert to before testing.
57
- * roles: The 'job' of this host, an array of `master`, `agent`, `frictionless`, `dashboard`, `database`, `default` or any user-defined string.
58
+ * roles: In a single-host setup roles are optional. Roles describe the 'job' of a host, an array of `master`, `agent`, `frictionless`, `dashboard`, `database`, `default` or any user-defined string.
58
59
  * pe_dir: The directory where PE builds are located, may be local directory or a URL.
59
60
  * pe_ver: The version number of PE to install.
60
61
  * vagrant_memsize: The memory size (in MB) for this host
@@ -1,8 +1,8 @@
1
1
  module Aix::File
2
2
  include Beaker::CommandFactory
3
3
 
4
- def tmpfile(name = '')
5
- execute("rndnum=${RANDOM} && touch /tmp/#{name}.${rndnum} && echo /tmp/#{name}.${rndnum}")
4
+ def tmpfile(name = '', extension = nil)
5
+ execute("rndnum=${RANDOM} && touch /tmp/#{name}.${rndnum}#{extension} && echo /tmp/#{name}.${rndnum}#{extension}")
6
6
  end
7
7
 
8
8
  def tmpdir(name = '')
@@ -16,7 +16,7 @@ module FreeBSD::Pkg
16
16
  execute("/bin/sh -c '#{check_pkgng_sh}'", opts) { |r| r }.exit_code == 0
17
17
  end
18
18
 
19
- def install_package(package, cmdline_args = nil, opts = {})
19
+ def install_package(package, cmdline_args = nil, _version = nil, opts = {})
20
20
  cmd = if pkgng_active?
21
21
  "pkg install #{cmdline_args || '-y'} #{package}"
22
22
  else
@@ -1,7 +1,13 @@
1
1
  module PSWindows::File
2
2
  include Beaker::CommandFactory
3
3
 
4
- def tmpfile(_name = '')
4
+ def tmpfile(_name = '', extension = nil)
5
+ if extension
6
+ # TODO: I do not have access to Windows, but the internet suggests this
7
+ # $newname = [System.IO.Path]::ChangeExtension($filename, "#{extension}") ; MoveItem $filename $newname
8
+ raise NotImplementedError, 'Passing an extension is not implemented'
9
+ end
10
+
5
11
  result = exec(powershell('[System.IO.Path]::GetTempFileName()'))
6
12
  result.stdout.chomp
7
13
  end
@@ -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 /(el|centos|redhat|oracle|scientific)-[7-9]|eos-7|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"))
@@ -1,8 +1,8 @@
1
1
  module Unix::File
2
2
  include Beaker::CommandFactory
3
3
 
4
- def tmpfile(name = '')
5
- execute("mktemp -t #{name}.XXXXXX")
4
+ def tmpfile(name = '', extension = nil)
5
+ execute("mktemp -t #{name}.XXXXXX#{extension}")
6
6
  end
7
7
 
8
8
  def tmpdir(name = '')
@@ -1,8 +1,8 @@
1
1
  module Windows::File
2
2
  include Beaker::CommandFactory
3
3
 
4
- def tmpfile(name = '')
5
- execute("cygpath -m $(mktemp -t #{name}.XXXXXX)")
4
+ def tmpfile(name = '', extension = nil)
5
+ execute("cygpath -m $(mktemp -t #{name}.XXXXXX#{extension})")
6
6
  end
7
7
 
8
8
  def tmpdir(name = '')
data/lib/beaker/host.rb CHANGED
@@ -547,6 +547,30 @@ module Beaker
547
547
 
548
548
  raise Beaker::Host::CommandFailure, result.error
549
549
  end
550
+
551
+ def tmpfile(name = '')
552
+ raise NotImplementedError
553
+ end
554
+
555
+ def tmpdir(name = '')
556
+ raise NotImplementedError
557
+ end
558
+
559
+ def path_split(paths)
560
+ raise NotImplementedError
561
+ end
562
+
563
+ def rm_rf(path)
564
+ raise NotImplementedError
565
+ end
566
+
567
+ def install_package(package, cmdline_args = nil, _version = nil, opts = {})
568
+ raise NotImplementedError
569
+ end
570
+
571
+ def add_env_var(key, val)
572
+ raise NotImplementedError
573
+ end
550
574
  end
551
575
 
552
576
  %w[
@@ -1,5 +1,5 @@
1
1
  module Beaker
2
2
  module Version
3
- STRING = '5.1.0'
3
+ STRING = '5.2.0'
4
4
  end
5
5
  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: 5.1.0
4
+ version: 5.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-27 00:00:00.000000000 Z
11
+ date: 2023-04-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fakefs
@@ -53,19 +53,19 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3.0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: yard
56
+ name: voxpupuli-rubocop
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 0.9.11
61
+ version: '1.1'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 0.9.11
68
+ version: '1.1'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: minitar
71
71
  requirement: !ruby/object:Gem::Requirement