beaker 6.8.1 → 7.0.1
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 +4 -4
- data/.github/workflows/release.yml +5 -5
- data/.github/workflows/test.yml +5 -2
- data/.rubocop.yml +4 -1
- data/.rubocop_todo.yml +24 -17
- data/CHANGELOG.md +21 -0
- data/Rakefile +3 -1
- data/beaker.gemspec +3 -3
- data/docs/concepts/argument_processing_and_precedence.md +1 -1
- data/docs/how_to/use_user_password_authentication.md +1 -1
- data/lib/beaker/command_factory.rb +1 -0
- data/lib/beaker/dsl/helpers/host_helpers.rb +11 -11
- data/lib/beaker/dsl/patterns.rb +2 -2
- data/lib/beaker/dsl/structure.rb +5 -5
- data/lib/beaker/host/aix/group.rb +4 -4
- data/lib/beaker/host/aix/user.rb +4 -4
- data/lib/beaker/host/mac/group.rb +2 -2
- data/lib/beaker/host/mac/user.rb +2 -2
- data/lib/beaker/host/pswindows/group.rb +4 -4
- data/lib/beaker/host/pswindows/user.rb +4 -4
- data/lib/beaker/host/unix/group.rb +4 -4
- data/lib/beaker/host/unix/user.rb +4 -4
- data/lib/beaker/host/windows/group.rb +4 -4
- data/lib/beaker/host/windows/user.rb +4 -4
- data/lib/beaker/host.rb +13 -1
- data/lib/beaker/options/presets.rb +1 -1
- data/lib/beaker/shared/repetition.rb +2 -2
- data/lib/beaker/tasks/rake_task.rb +2 -2
- data/lib/beaker/version.rb +1 -1
- data/spec/beaker/host_prebuilt_steps_spec.rb +6 -6
- data/spec/beaker/host_spec.rb +2 -2
- data/spec/beaker/options/data/hosts_preserved.yml +2 -2
- data/spec/beaker/platform_spec.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7aac904257f5f7c3605a6139a432f9768a1bf33a476f8069d66566853b31cee4
|
4
|
+
data.tar.gz: f853066d6563fa82c6e4fc8c66167ac200c6aad5ca49d15b1269771f4d1fd036
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63c3f7bc55be648f3dd630065c2db6669a6740c9cdfc5da7bae529587403fc0b7d64edbdc9665c364616cfc47a9eb2a9fc8502693fa8b132e06dd66fb1f7f216
|
7
|
+
data.tar.gz: 6818daa647d74f067e1ed8c21ef98ae92bd42f69539e864f708e2a51d40e3d1f9d68c82a76517662758d04db18fd37a67287c3d339192d8244f50a2bfe2bcbae
|
@@ -15,7 +15,7 @@ jobs:
|
|
15
15
|
name: Build the gem
|
16
16
|
runs-on: ubuntu-24.04
|
17
17
|
steps:
|
18
|
-
- uses: actions/checkout@
|
18
|
+
- uses: actions/checkout@v5
|
19
19
|
- name: Install Ruby
|
20
20
|
uses: ruby/setup-ruby@v1
|
21
21
|
with:
|
@@ -39,7 +39,7 @@ jobs:
|
|
39
39
|
contents: write # clone repo and create release
|
40
40
|
steps:
|
41
41
|
- name: Download gem from GitHub cache
|
42
|
-
uses: actions/download-artifact@
|
42
|
+
uses: actions/download-artifact@v5
|
43
43
|
with:
|
44
44
|
name: gem-artifact
|
45
45
|
- name: Create Release
|
@@ -56,7 +56,7 @@ jobs:
|
|
56
56
|
packages: write # publish to rubygems.pkg.github.com
|
57
57
|
steps:
|
58
58
|
- name: Download gem from GitHub cache
|
59
|
-
uses: actions/download-artifact@
|
59
|
+
uses: actions/download-artifact@v5
|
60
60
|
with:
|
61
61
|
name: gem-artifact
|
62
62
|
- name: Publish gem to GitHub packages
|
@@ -73,7 +73,7 @@ jobs:
|
|
73
73
|
id-token: write # rubygems.org authentication
|
74
74
|
steps:
|
75
75
|
- name: Download gem from GitHub cache
|
76
|
-
uses: actions/download-artifact@
|
76
|
+
uses: actions/download-artifact@v5
|
77
77
|
with:
|
78
78
|
name: gem-artifact
|
79
79
|
- uses: rubygems/configure-rubygems-credentials@v1.0.0
|
@@ -92,7 +92,7 @@ jobs:
|
|
92
92
|
- release-to-rubygems
|
93
93
|
steps:
|
94
94
|
- name: Download gem from GitHub cache
|
95
|
-
uses: actions/download-artifact@
|
95
|
+
uses: actions/download-artifact@v5
|
96
96
|
with:
|
97
97
|
name: gem-artifact
|
98
98
|
- name: Install Ruby
|
data/.github/workflows/test.yml
CHANGED
@@ -7,13 +7,16 @@ on:
|
|
7
7
|
branches:
|
8
8
|
- master
|
9
9
|
|
10
|
+
permissions:
|
11
|
+
contents: read
|
12
|
+
|
10
13
|
jobs:
|
11
14
|
rubocop_and_matrix:
|
12
15
|
runs-on: ubuntu-24.04
|
13
16
|
outputs:
|
14
17
|
ruby: ${{ steps.ruby.outputs.versions }}
|
15
18
|
steps:
|
16
|
-
- uses: actions/checkout@
|
19
|
+
- uses: actions/checkout@v5
|
17
20
|
- name: Install Ruby ${{ matrix.ruby }}
|
18
21
|
uses: ruby/setup-ruby@v1
|
19
22
|
with:
|
@@ -35,7 +38,7 @@ jobs:
|
|
35
38
|
env:
|
36
39
|
BEAKER_HYPERVISOR: docker
|
37
40
|
steps:
|
38
|
-
- uses: actions/checkout@
|
41
|
+
- uses: actions/checkout@v5
|
39
42
|
- name: Install Ruby ${{ matrix.ruby }}
|
40
43
|
uses: ruby/setup-ruby@v1
|
41
44
|
with:
|
data/.rubocop.yml
CHANGED
@@ -4,6 +4,9 @@ inherit_from: .rubocop_todo.yml
|
|
4
4
|
inherit_gem:
|
5
5
|
voxpupuli-rubocop: rubocop.yml
|
6
6
|
|
7
|
+
AllCops:
|
8
|
+
TargetRubyVersion: 3.2
|
9
|
+
|
7
10
|
Layout/LineLength:
|
8
11
|
Exclude:
|
9
12
|
- acceptance/**/*.rb
|
@@ -19,7 +22,7 @@ Naming/FileName:
|
|
19
22
|
Naming/MethodParameterName:
|
20
23
|
MinNameLength: 1
|
21
24
|
|
22
|
-
Naming/
|
25
|
+
Naming/PredicatePrefix:
|
23
26
|
Enabled: false
|
24
27
|
|
25
28
|
RSpec/DescribeClass:
|
data/.rubocop_todo.yml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config --no-auto-gen-timestamp`
|
3
|
-
# using RuboCop version 1.
|
3
|
+
# using RuboCop version 1.79.2.
|
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
|
@@ -43,16 +43,10 @@ Lint/NonAtomicFileOperation:
|
|
43
43
|
Exclude:
|
44
44
|
- 'acceptance/tests/base/dsl/helpers/host_helpers/archive_file_from_test.rb'
|
45
45
|
|
46
|
-
# Offense count:
|
47
|
-
Lint/
|
46
|
+
# Offense count: 1
|
47
|
+
Lint/UselessOr:
|
48
48
|
Exclude:
|
49
|
-
- 'lib/beaker/
|
50
|
-
- 'lib/beaker/dsl/helpers/web_helpers.rb'
|
51
|
-
- 'lib/beaker/dsl/wrappers.rb'
|
52
|
-
- 'lib/beaker/host/pswindows/exec.rb'
|
53
|
-
- 'lib/beaker/host/unix/pkg.rb'
|
54
|
-
- 'lib/beaker/host_prebuilt_steps.rb'
|
55
|
-
- 'lib/beaker/perf.rb'
|
49
|
+
- 'lib/beaker/test_suite_result.rb'
|
56
50
|
|
57
51
|
# Offense count: 5
|
58
52
|
# This cop supports unsafe autocorrection (--autocorrect-all).
|
@@ -100,6 +94,25 @@ Naming/MemoizedInstanceVariableName:
|
|
100
94
|
- 'lib/beaker/host.rb'
|
101
95
|
- 'lib/beaker/options/presets.rb'
|
102
96
|
|
97
|
+
# Offense count: 22
|
98
|
+
# Configuration parameters: Mode, AllowedMethods, AllowedPatterns, AllowBangMethods, WaywardPredicates.
|
99
|
+
# AllowedMethods: call
|
100
|
+
# WaywardPredicates: nonzero?
|
101
|
+
Naming/PredicateMethod:
|
102
|
+
Exclude:
|
103
|
+
- 'lib/beaker/dsl/helpers/host_helpers.rb'
|
104
|
+
- 'lib/beaker/dsl/roles.rb'
|
105
|
+
- 'lib/beaker/host/freebsd/pkg.rb'
|
106
|
+
- 'lib/beaker/host/mac/pkg.rb'
|
107
|
+
- 'lib/beaker/host/pswindows/exec.rb'
|
108
|
+
- 'lib/beaker/host/pswindows/pkg.rb'
|
109
|
+
- 'lib/beaker/host/unix.rb'
|
110
|
+
- 'lib/beaker/host/unix/exec.rb'
|
111
|
+
- 'lib/beaker/host/unix/pkg.rb'
|
112
|
+
- 'lib/beaker/host/windows/exec.rb'
|
113
|
+
- 'lib/beaker/host/windows/pkg.rb'
|
114
|
+
- 'lib/beaker/ssh_connection.rb'
|
115
|
+
|
103
116
|
# Offense count: 4
|
104
117
|
# Configuration parameters: MinSize.
|
105
118
|
Performance/CollectionLiteralInLoop:
|
@@ -294,12 +307,6 @@ RSpec/UnspecifiedException:
|
|
294
307
|
RSpec/VerifiedDoubles:
|
295
308
|
Enabled: false
|
296
309
|
|
297
|
-
# Offense count: 2
|
298
|
-
# This cop supports safe autocorrection (--autocorrect).
|
299
|
-
Rake/Desc:
|
300
|
-
Exclude:
|
301
|
-
- 'Rakefile'
|
302
|
-
|
303
310
|
# Offense count: 7
|
304
311
|
Security/Eval:
|
305
312
|
Exclude:
|
@@ -318,7 +325,7 @@ Security/Open:
|
|
318
325
|
|
319
326
|
# Offense count: 104
|
320
327
|
# This cop supports safe autocorrection (--autocorrect).
|
321
|
-
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
|
328
|
+
# Configuration parameters: AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
|
322
329
|
# URISchemes: http, https
|
323
330
|
Layout/LineLength:
|
324
331
|
Max: 225
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,26 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [7.0.1](https://github.com/voxpupuli/beaker/tree/7.0.1) (2025-08-14)
|
4
|
+
|
5
|
+
[Full Changelog](https://github.com/voxpupuli/beaker/compare/7.0.0...7.0.1)
|
6
|
+
|
7
|
+
**Fixed bugs:**
|
8
|
+
|
9
|
+
- Update verify\_host\_key usage to :never, fixes deprecation warning [\#1945](https://github.com/voxpupuli/beaker/pull/1945) ([silug](https://github.com/silug))
|
10
|
+
- Merge ssh settings [\#1944](https://github.com/voxpupuli/beaker/pull/1944) ([silug](https://github.com/silug))
|
11
|
+
|
12
|
+
## [7.0.0](https://github.com/voxpupuli/beaker/tree/7.0.0) (2025-08-07)
|
13
|
+
|
14
|
+
[Full Changelog](https://github.com/voxpupuli/beaker/compare/6.8.1...7.0.0)
|
15
|
+
|
16
|
+
**Breaking changes:**
|
17
|
+
|
18
|
+
- Require Ruby 3.2 [\#1906](https://github.com/voxpupuli/beaker/pull/1906) ([bastelfreak](https://github.com/bastelfreak))
|
19
|
+
|
20
|
+
**Implemented enhancements:**
|
21
|
+
|
22
|
+
- beaker-hostgenerator: Switch to 3.x [\#1937](https://github.com/voxpupuli/beaker/pull/1937) ([bastelfreak](https://github.com/bastelfreak))
|
23
|
+
|
3
24
|
## [6.8.1](https://github.com/voxpupuli/beaker/tree/6.8.1) (2025-06-16)
|
4
25
|
|
5
26
|
[Full Changelog](https://github.com/voxpupuli/beaker/compare/6.8.0...6.8.1)
|
data/Rakefile
CHANGED
@@ -6,10 +6,12 @@ HOSTS_PRESERVED = 'log/latest/hosts_preserved.yml'
|
|
6
6
|
|
7
7
|
task :default => ['test:spec']
|
8
8
|
|
9
|
+
desc 'Run unit tests'
|
9
10
|
task :test do
|
10
11
|
Rake::Task['test:spec'].invoke
|
11
12
|
end
|
12
13
|
|
14
|
+
desc 'run unit tests'
|
13
15
|
task :spec do
|
14
16
|
Rake::Task['test:spec'].invoke
|
15
17
|
end
|
@@ -186,7 +188,7 @@ begin
|
|
186
188
|
require 'github_changelog_generator/task'
|
187
189
|
|
188
190
|
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
|
189
|
-
config.exclude_labels = %w{duplicate question invalid wontfix wont-fix skip-changelog}
|
191
|
+
config.exclude_labels = %w{duplicate question invalid wontfix wont-fix skip-changelog github_actions}
|
190
192
|
config.user = 'voxpupuli'
|
191
193
|
config.project = 'beaker'
|
192
194
|
gem_version = Gem::Specification.load("#{config.project}.gemspec").version
|
data/beaker.gemspec
CHANGED
@@ -16,13 +16,13 @@ Gem::Specification.new do |s|
|
|
16
16
|
s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
|
17
17
|
s.require_paths = ["lib"]
|
18
18
|
|
19
|
-
s.required_ruby_version = Gem::Requirement.new('>= 2
|
19
|
+
s.required_ruby_version = Gem::Requirement.new('>= 3.2')
|
20
20
|
|
21
21
|
# Testing dependencies
|
22
22
|
s.add_development_dependency 'fakefs', '>= 2.4', '< 4'
|
23
23
|
s.add_development_dependency 'rake', '~> 13.0'
|
24
24
|
s.add_development_dependency 'rspec', '~> 3.0'
|
25
|
-
s.add_development_dependency 'voxpupuli-rubocop', '~>
|
25
|
+
s.add_development_dependency 'voxpupuli-rubocop', '~> 4.2.0'
|
26
26
|
|
27
27
|
# Run time dependencies
|
28
28
|
# Required for Ruby 3.3+ support
|
@@ -47,6 +47,6 @@ Gem::Specification.new do |s|
|
|
47
47
|
s.add_dependency 'thor', ['>= 1.0.1', '< 2.0']
|
48
48
|
|
49
49
|
# Run time dependencies that are Beaker libraries
|
50
|
-
s.add_dependency 'beaker-hostgenerator', '~>
|
50
|
+
s.add_dependency 'beaker-hostgenerator', '~> 3.0'
|
51
51
|
s.add_dependency 'stringify-hash', '~> 0.0'
|
52
52
|
end
|
@@ -257,7 +257,7 @@ Values already included in Beaker as defaults for required arguments.
|
|
257
257
|
:run_in_parallel => [],
|
258
258
|
:ssh => {
|
259
259
|
:config => false,
|
260
|
-
:verify_host_key =>
|
260
|
+
:verify_host_key => :never,
|
261
261
|
:auth_methods => ["publickey"],
|
262
262
|
:port => 22,
|
263
263
|
:forward_agent => true,
|
@@ -26,7 +26,7 @@ The log will then read as:
|
|
26
26
|
_snip_
|
27
27
|
```
|
28
28
|
pe-centos6 20:19:16$ echo hello!
|
29
|
-
Attempting ssh connection to pe-centos6, user: anode, opts: {:config=>false, :verify_host_key
|
29
|
+
Attempting ssh connection to pe-centos6, user: anode, opts: {:config=>false, :verify_host_key=>:never, :timeout=>300, :auth_methods=>["password"], :port=>22, :forward_agent=>true, :keys=>["/Users/anode/.ssh/id_rsa"], :user_known_hosts_file=>"/Users/anode/.ssh/known_hosts", :password=>"anode", :user=>"anode"}
|
30
30
|
```
|
31
31
|
_/snip_
|
32
32
|
|
@@ -3,6 +3,7 @@ require 'minitest/test'
|
|
3
3
|
module Beaker
|
4
4
|
module CommandFactory
|
5
5
|
include Minitest::Assertions
|
6
|
+
|
6
7
|
# Why do we need this accessor?
|
7
8
|
# https://github.com/seattlerb/minitest/blob/master/lib/minitest/assertions.rb#L8-L12
|
8
9
|
# Protocol: Nearly everything here boils up to +assert+, which
|
@@ -118,8 +118,8 @@ module Beaker
|
|
118
118
|
#
|
119
119
|
# @return [Result] An object representing the outcome of *command*.
|
120
120
|
# @raise [FailTest] Raises an exception if *command* obviously fails.
|
121
|
-
def shell(command, opts = {}, &
|
122
|
-
on(default, command, opts, &
|
121
|
+
def shell(command, opts = {}, &)
|
122
|
+
on(default, command, opts, &)
|
123
123
|
end
|
124
124
|
|
125
125
|
# Move a file from a remote to a local path
|
@@ -307,7 +307,7 @@ module Beaker
|
|
307
307
|
# @param [Proc] block Additional tests to run after script has executed
|
308
308
|
#
|
309
309
|
# @return [Result] Returns the result of the underlying SCP operation.
|
310
|
-
def run_script_on(host, script, opts = {}, &
|
310
|
+
def run_script_on(host, script, opts = {}, &)
|
311
311
|
# this is unsafe as it uses the File::SEPARATOR will be set to that
|
312
312
|
# of the coordinator node. This works for us because we use cygwin
|
313
313
|
# which will properly convert the paths. Otherwise this would not
|
@@ -317,13 +317,13 @@ module Beaker
|
|
317
317
|
remote_path = File.join("", "tmp", File.basename(script))
|
318
318
|
|
319
319
|
scp_to host, script, remote_path
|
320
|
-
on
|
320
|
+
on(host, remote_path, opts, &)
|
321
321
|
end
|
322
322
|
|
323
323
|
# Move a local script to default host and execute it
|
324
324
|
# @see #run_script_on
|
325
|
-
def run_script(script, opts = {}, &
|
326
|
-
run_script_on(default, script, opts, &
|
325
|
+
def run_script(script, opts = {}, &)
|
326
|
+
run_script_on(default, script, opts, &)
|
327
327
|
end
|
328
328
|
|
329
329
|
# Install a package on a host
|
@@ -515,8 +515,8 @@ module Beaker
|
|
515
515
|
# @param [Proc] block Additional actions or assertions.
|
516
516
|
# @!macro common_opts
|
517
517
|
#
|
518
|
-
def curl_on(host, cmd, opts = {}, &
|
519
|
-
on
|
518
|
+
def curl_on(host, cmd, opts = {}, &)
|
519
|
+
on(host, "curl --tlsv1 %s" % cmd, opts, &)
|
520
520
|
end
|
521
521
|
|
522
522
|
def curl_with_retries(_desc, host, url, desired_exit_codes, max_retries = 60, retry_interval = 1)
|
@@ -547,7 +547,7 @@ module Beaker
|
|
547
547
|
# @option opts [Boolean] :verbose (false)
|
548
548
|
#
|
549
549
|
# @return [Result] Result object of the last command execution
|
550
|
-
def retry_on(host, command, opts = {}, &
|
550
|
+
def retry_on(host, command, opts = {}, &)
|
551
551
|
option_exit_codes = opts[:desired_exit_codes]
|
552
552
|
option_max_retries = opts[:max_retries].to_i
|
553
553
|
option_retry_interval = opts[:retry_interval].to_f
|
@@ -562,11 +562,11 @@ module Beaker
|
|
562
562
|
logger.debug " Trying command #{max_retries} times."
|
563
563
|
logger.debug ".", add_newline: false
|
564
564
|
|
565
|
-
result = on
|
565
|
+
result = on(host, command, { :accept_all_exit_codes => true, :silent => !verbose }, &)
|
566
566
|
num_retries = 0
|
567
567
|
until desired_exit_codes.include?(result.exit_code)
|
568
568
|
sleep retry_interval
|
569
|
-
result = on
|
569
|
+
result = on(host, command, { :accept_all_exit_codes => true, :silent => !verbose }, &)
|
570
570
|
num_retries += 1
|
571
571
|
logger.debug ".", add_newline: false
|
572
572
|
if (num_retries > max_retries)
|
data/lib/beaker/dsl/patterns.rb
CHANGED
@@ -22,7 +22,7 @@ module Beaker
|
|
22
22
|
#
|
23
23
|
# @return [Array<Result>, Result, nil] An array of results, a result object, or nil.
|
24
24
|
# Check {Beaker::Shared::HostManager#run_block_on} for more details on this.
|
25
|
-
def block_on
|
25
|
+
def block_on(hosts_or_filter, opts = {}, &)
|
26
26
|
block_hosts = nil
|
27
27
|
if defined? hosts
|
28
28
|
block_hosts = hosts
|
@@ -33,7 +33,7 @@ module Beaker
|
|
33
33
|
else
|
34
34
|
block_hosts = hosts_or_filter
|
35
35
|
end
|
36
|
-
run_block_on
|
36
|
+
run_block_on(block_hosts, filter, opts, &)
|
37
37
|
end
|
38
38
|
end
|
39
39
|
end
|
data/lib/beaker/dsl/structure.rb
CHANGED
@@ -107,10 +107,10 @@ module Beaker
|
|
107
107
|
# @param [String] manual_test_name The name of the test to be logged.
|
108
108
|
# @param [Proc] block The actions to be performed during this test.
|
109
109
|
#
|
110
|
-
def manual_test
|
110
|
+
def manual_test(manual_test_name, &)
|
111
111
|
if @options.has_key?(:exec_manual_tests) && @options[:exec_manual_tests] == true
|
112
112
|
# here the option is set so we run the test as normal
|
113
|
-
test_name
|
113
|
+
test_name(manual_test_name, &)
|
114
114
|
else
|
115
115
|
# here no option was set so we log the test name and skip it
|
116
116
|
test_name manual_test_name
|
@@ -261,13 +261,13 @@ module Beaker
|
|
261
261
|
# targets for this tests case.
|
262
262
|
# @raise [SkipTest] Raises skip test if there are no valid hosts for
|
263
263
|
# this test case after confinement.
|
264
|
-
def confine(type, criteria, host_array = nil, &
|
264
|
+
def confine(type, criteria, host_array = nil, &)
|
265
265
|
hosts_to_modify = Array(host_array || hosts)
|
266
266
|
hosts_not_modified = hosts - hosts_to_modify # we aren't examining these hosts
|
267
267
|
case type
|
268
268
|
when :except
|
269
269
|
hosts_to_modify = if criteria and (not criteria.empty?)
|
270
|
-
hosts_to_modify - select_hosts(criteria, hosts_to_modify, &
|
270
|
+
hosts_to_modify - select_hosts(criteria, hosts_to_modify, &) + hosts_not_modified
|
271
271
|
else
|
272
272
|
# confining to all hosts *except* provided array of hosts
|
273
273
|
hosts_not_modified
|
@@ -278,7 +278,7 @@ module Beaker
|
|
278
278
|
end
|
279
279
|
when :to
|
280
280
|
if criteria and (not criteria.empty?)
|
281
|
-
hosts_to_modify = select_hosts(criteria, hosts_to_modify, &
|
281
|
+
hosts_to_modify = select_hosts(criteria, hosts_to_modify, &) + hosts_not_modified
|
282
282
|
else
|
283
283
|
# confining to only hosts in provided array of hosts
|
284
284
|
end
|
@@ -26,11 +26,11 @@ module Aix::Group
|
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
|
-
def group_present(name, &
|
30
|
-
execute("if ! lsgroup #{name}; then mkgroup #{name}; fi", {}, &
|
29
|
+
def group_present(name, &)
|
30
|
+
execute("if ! lsgroup #{name}; then mkgroup #{name}; fi", {}, &)
|
31
31
|
end
|
32
32
|
|
33
|
-
def group_absent(name, &
|
34
|
-
execute("if lsgroup #{name}; then rmgroup #{name}; fi", {}, &
|
33
|
+
def group_absent(name, &)
|
34
|
+
execute("if lsgroup #{name}; then rmgroup #{name}; fi", {}, &)
|
35
35
|
end
|
36
36
|
end
|
data/lib/beaker/host/aix/user.rb
CHANGED
@@ -23,11 +23,11 @@ module Aix::User
|
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
-
def user_present(name, &
|
27
|
-
execute("if ! lsuser #{name}; then mkuser #{name}; fi", {}, &
|
26
|
+
def user_present(name, &)
|
27
|
+
execute("if ! lsuser #{name}; then mkuser #{name}; fi", {}, &)
|
28
28
|
end
|
29
29
|
|
30
|
-
def user_absent(name, &
|
31
|
-
execute("if lsuser #{name}; then rmuser #{name}; fi", {}, &
|
30
|
+
def user_absent(name, &)
|
31
|
+
execute("if lsuser #{name}; then rmuser #{name}; fi", {}, &)
|
32
32
|
end
|
33
33
|
end
|
@@ -83,8 +83,8 @@ module Mac::Group
|
|
83
83
|
#
|
84
84
|
# @param [String] name Name of the group
|
85
85
|
# @param [Proc] block Additional actions or insertions
|
86
|
-
def group_absent(name, &
|
87
|
-
execute("if dscl . -list /Groups/#{name}; then dscl . -delete /Groups/#{name}; fi", {}, &
|
86
|
+
def group_absent(name, &)
|
87
|
+
execute("if dscl . -list /Groups/#{name}; then dscl . -delete /Groups/#{name}; fi", {}, &)
|
88
88
|
end
|
89
89
|
|
90
90
|
# Gives the next gid not used on the system
|
data/lib/beaker/host/mac/user.rb
CHANGED
@@ -66,8 +66,8 @@ module Mac::User
|
|
66
66
|
#
|
67
67
|
# @param [String] name Name of the user
|
68
68
|
# @param [Proc] block Additional actions or insertions
|
69
|
-
def user_absent(name, &
|
70
|
-
execute("if dscl . -list /Users/#{name}; then dscl . -delete /Users/#{name}; fi", {}, &
|
69
|
+
def user_absent(name, &)
|
70
|
+
execute("if dscl . -list /Users/#{name}; then dscl . -delete /Users/#{name}; fi", {}, &)
|
71
71
|
end
|
72
72
|
|
73
73
|
# Gives the next uid not used on the system
|
@@ -27,11 +27,11 @@ module PSWindows::Group
|
|
27
27
|
raise NotImplementedError, "Can't retrieve group gid on a Windows host"
|
28
28
|
end
|
29
29
|
|
30
|
-
def group_present(name, &
|
31
|
-
execute("net localgroup /add \"#{name}\"", { :acceptable_exit_codes => [0, 2] }, &
|
30
|
+
def group_present(name, &)
|
31
|
+
execute("net localgroup /add \"#{name}\"", { :acceptable_exit_codes => [0, 2] }, &)
|
32
32
|
end
|
33
33
|
|
34
|
-
def group_absent(name, &
|
35
|
-
execute("net localgroup /delete \"#{name}\"", { :acceptable_exit_codes => [0, 2] }, &
|
34
|
+
def group_absent(name, &)
|
35
|
+
execute("net localgroup /delete \"#{name}\"", { :acceptable_exit_codes => [0, 2] }, &)
|
36
36
|
end
|
37
37
|
end
|
@@ -23,11 +23,11 @@ module PSWindows::User
|
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
-
def user_present(name, &
|
27
|
-
execute("net user /add \"#{name}\"", { :acceptable_exit_codes => [0, 2] }, &
|
26
|
+
def user_present(name, &)
|
27
|
+
execute("net user /add \"#{name}\"", { :acceptable_exit_codes => [0, 2] }, &)
|
28
28
|
end
|
29
29
|
|
30
|
-
def user_absent(name, &
|
31
|
-
execute("net user /delete \"#{name}\"", { :acceptable_exit_codes => [0, 2] }, &
|
30
|
+
def user_absent(name, &)
|
31
|
+
execute("net user /delete \"#{name}\"", { :acceptable_exit_codes => [0, 2] }, &)
|
32
32
|
end
|
33
33
|
end
|
@@ -31,11 +31,11 @@ module Unix::Group
|
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
|
-
def group_present(name, &
|
35
|
-
execute("if ! getent group #{name}; then groupadd #{name}; fi", {}, &
|
34
|
+
def group_present(name, &)
|
35
|
+
execute("if ! getent group #{name}; then groupadd #{name}; fi", {}, &)
|
36
36
|
end
|
37
37
|
|
38
|
-
def group_absent(name, &
|
39
|
-
execute("if getent group #{name}; then groupdel #{name}; fi", {}, &
|
38
|
+
def group_absent(name, &)
|
39
|
+
execute("if getent group #{name}; then groupdel #{name}; fi", {}, &)
|
40
40
|
end
|
41
41
|
end
|
@@ -23,11 +23,11 @@ module Unix::User
|
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
-
def user_present(name, &
|
27
|
-
execute("if ! getent passwd #{name}; then useradd #{name}; fi", {}, &
|
26
|
+
def user_present(name, &)
|
27
|
+
execute("if ! getent passwd #{name}; then useradd #{name}; fi", {}, &)
|
28
28
|
end
|
29
29
|
|
30
|
-
def user_absent(name, &
|
31
|
-
execute("if getent passwd #{name}; then userdel #{name}; fi", {}, &
|
30
|
+
def user_absent(name, &)
|
31
|
+
execute("if getent passwd #{name}; then userdel #{name}; fi", {}, &)
|
32
32
|
end
|
33
33
|
end
|
@@ -41,11 +41,11 @@ module Windows::Group
|
|
41
41
|
raise NotImplementedError, "Can't retrieve group gid on a Windows host"
|
42
42
|
end
|
43
43
|
|
44
|
-
def group_present(name, &
|
45
|
-
execute("net localgroup /add \"#{name}\"", { :acceptable_exit_codes => [0, 2] }, &
|
44
|
+
def group_present(name, &)
|
45
|
+
execute("net localgroup /add \"#{name}\"", { :acceptable_exit_codes => [0, 2] }, &)
|
46
46
|
end
|
47
47
|
|
48
|
-
def group_absent(name, &
|
49
|
-
execute("net localgroup /delete \"#{name}\"", { :acceptable_exit_codes => [0, 2] }, &
|
48
|
+
def group_absent(name, &)
|
49
|
+
execute("net localgroup /delete \"#{name}\"", { :acceptable_exit_codes => [0, 2] }, &)
|
50
50
|
end
|
51
51
|
end
|
@@ -37,11 +37,11 @@ module Windows::User
|
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
|
-
def user_present(name, &
|
41
|
-
execute("net user /add \"#{name}\"", { :acceptable_exit_codes => [0, 2] }, &
|
40
|
+
def user_present(name, &)
|
41
|
+
execute("net user /add \"#{name}\"", { :acceptable_exit_codes => [0, 2] }, &)
|
42
42
|
end
|
43
43
|
|
44
|
-
def user_absent(name, &
|
45
|
-
execute("net user /delete \"#{name}\"", { :acceptable_exit_codes => [0, 2] }, &
|
44
|
+
def user_absent(name, &)
|
45
|
+
execute("net user /delete \"#{name}\"", { :acceptable_exit_codes => [0, 2] }, &)
|
46
46
|
end
|
47
47
|
end
|
data/lib/beaker/host.rb
CHANGED
@@ -141,7 +141,19 @@ module Beaker
|
|
141
141
|
|
142
142
|
# Does this host have this key? Either as defined in the host itself, or globally?
|
143
143
|
def [] k
|
144
|
-
|
144
|
+
if k == 'ssh' || k == :ssh
|
145
|
+
# Merge global and host-level ssh options, host-level wins
|
146
|
+
global_ssh = options[k] || {}
|
147
|
+
host_ssh = host_hash[k] || {}
|
148
|
+
# Use OptionsHash if available for deep merge
|
149
|
+
if defined?(Beaker::Options::OptionsHash)
|
150
|
+
Beaker::Options::OptionsHash.new.merge(global_ssh).merge(host_ssh)
|
151
|
+
else
|
152
|
+
global_ssh.merge(host_ssh)
|
153
|
+
end
|
154
|
+
else
|
155
|
+
host_hash[k] || options[k]
|
156
|
+
end
|
145
157
|
end
|
146
158
|
|
147
159
|
# Does this host have this key? Either as defined in the host itself, or globally?
|
@@ -1,9 +1,9 @@
|
|
1
1
|
module Beaker
|
2
2
|
module Shared
|
3
3
|
module Repetition
|
4
|
-
def repeat_for
|
4
|
+
def repeat_for(seconds, &)
|
5
5
|
# do not peg CPU if &block takes less than 1 second
|
6
|
-
repeat_for_and_wait
|
6
|
+
repeat_for_and_wait(seconds, 1, &)
|
7
7
|
end
|
8
8
|
|
9
9
|
def repeat_for_and_wait seconds, wait
|
@@ -29,14 +29,14 @@ module Beaker
|
|
29
29
|
# Sets up the predefine task checking
|
30
30
|
# @param args [Array] First argument is always the name of the task
|
31
31
|
# if no additonal arguments are defined such as parameters it will default to [:hosts,:type]
|
32
|
-
def initialize(*args, &
|
32
|
+
def initialize(*args, &)
|
33
33
|
super
|
34
34
|
|
35
35
|
@name = args.shift || 'beaker:test'
|
36
36
|
args = %i[hosts type] if args.empty?
|
37
37
|
@acceptance_root = DEFAULT_ACCEPTANCE_ROOT
|
38
38
|
@options_file = nil
|
39
|
-
define(args, &
|
39
|
+
define(args, &)
|
40
40
|
end
|
41
41
|
|
42
42
|
private
|
data/lib/beaker/version.rb
CHANGED
@@ -380,14 +380,14 @@ describe Beaker do
|
|
380
380
|
let(:cygwin) { true }
|
381
381
|
let(:cat) { "cat /cygdrive/c/Windows/System32/drivers/etc/hosts" }
|
382
382
|
|
383
|
-
|
383
|
+
it_behaves_like 'find domain name'
|
384
384
|
end
|
385
385
|
|
386
386
|
context "without cygwin" do
|
387
387
|
let(:cygwin) { false }
|
388
388
|
let(:cat) { 'type C:\Windows\System32\drivers\etc\hosts' }
|
389
389
|
|
390
|
-
|
390
|
+
it_behaves_like 'find domain name'
|
391
391
|
end
|
392
392
|
end
|
393
393
|
|
@@ -399,25 +399,25 @@ describe Beaker do
|
|
399
399
|
context "with a domain entry" do
|
400
400
|
let(:stdout) { "domain labs.lan d.labs.net dc1.labs.net labs.com\nnameserver 10.16.22.10\nnameserver 10.16.22.11" }
|
401
401
|
|
402
|
-
|
402
|
+
it_behaves_like 'find domain name'
|
403
403
|
end
|
404
404
|
|
405
405
|
context "with a search entry" do
|
406
406
|
let(:stdout) { "search labs.lan d.labs.net dc1.labs.net labs.com\nnameserver 10.16.22.10\nnameserver 10.16.22.11" }
|
407
407
|
|
408
|
-
|
408
|
+
it_behaves_like 'find domain name'
|
409
409
|
end
|
410
410
|
|
411
411
|
context "with a both a domain and a search entry" do
|
412
412
|
let(:stdout) { "domain labs.lan\nsearch d.labs.net dc1.labs.net labs.com\nnameserver 10.16.22.10\nnameserver 10.16.22.11" }
|
413
413
|
|
414
|
-
|
414
|
+
it_behaves_like 'find domain name'
|
415
415
|
end
|
416
416
|
|
417
417
|
context "with a both a domain and a search entry, the search entry first" do
|
418
418
|
let(:stdout) { "search foo.example.net\ndomain labs.lan d.labs.net dc1.labs.net labs.com\nnameserver 10.16.22.10\nnameserver 10.16.22.11" }
|
419
419
|
|
420
|
-
|
420
|
+
it_behaves_like 'find domain name'
|
421
421
|
end
|
422
422
|
end
|
423
423
|
end
|
data/spec/beaker/host_spec.rb
CHANGED
@@ -629,7 +629,7 @@ module Beaker
|
|
629
629
|
# since were using fakefs we need to create the file and directories
|
630
630
|
FileUtils.mkdir_p('/var/folders/v0/')
|
631
631
|
FileUtils.touch('/var/folders/v0/centos-64-x6420150625-48025-lu3u86')
|
632
|
-
rsync_args = ['source', 'target', ['-az', "-e \"ssh -F /var/folders/v0/centos-64-x6420150625-48025-lu3u86 -o 'StrictHostKeyChecking no'\"", "--exclude '.bundle'"]]
|
632
|
+
rsync_args = ['source', 'target', ['-az', "-e \"ssh -F /var/folders/v0/centos-64-x6420150625-48025-lu3u86 -p 22 -o 'StrictHostKeyChecking no'\"", "--exclude '.bundle'"]]
|
633
633
|
expect(Rsync).to receive(:run).with(*rsync_args).and_return(Rsync::Result.new('raw rsync output', 0))
|
634
634
|
expect(host.do_rsync_to(*args).success?).to eq(true)
|
635
635
|
end
|
@@ -639,7 +639,7 @@ module Beaker
|
|
639
639
|
create_files(['source'])
|
640
640
|
args = ['source', 'target',
|
641
641
|
{ :ignore => ['.bundle'] },]
|
642
|
-
rsync_args = ['source', 'target', ['-az', "-e \"ssh -o 'StrictHostKeyChecking no'\"", "--exclude '.bundle'"]]
|
642
|
+
rsync_args = ['source', 'target', ['-az', "-e \"ssh -p 22 -o 'StrictHostKeyChecking no'\"", "--exclude '.bundle'"]]
|
643
643
|
expect(Rsync).to receive(:run).with(*rsync_args).and_return(Rsync::Result.new('raw rsync output', 0))
|
644
644
|
expect(host.do_rsync_to(*args).success?).to eq(true)
|
645
645
|
end
|
@@ -72,7 +72,7 @@
|
|
72
72
|
:use_fog_credentials: true
|
73
73
|
:ssh: !ruby/hash:Beaker::Options::OptionsHash
|
74
74
|
:config: true
|
75
|
-
:verify_host_key:
|
75
|
+
:verify_host_key: :never
|
76
76
|
:auth_methods: &7
|
77
77
|
- publickey
|
78
78
|
:port: 22
|
@@ -360,7 +360,7 @@
|
|
360
360
|
:use_fog_credentials: true
|
361
361
|
:ssh: !ruby/hash:Beaker::Options::OptionsHash
|
362
362
|
:config: true
|
363
|
-
:verify_host_key:
|
363
|
+
:verify_host_key: :never
|
364
364
|
:auth_methods: *7
|
365
365
|
:port: 22
|
366
366
|
:forward_agent: 'true'
|
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:
|
4
|
+
version: 7.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Puppet
|
@@ -63,14 +63,14 @@ dependencies:
|
|
63
63
|
requirements:
|
64
64
|
- - "~>"
|
65
65
|
- !ruby/object:Gem::Version
|
66
|
-
version:
|
66
|
+
version: 4.2.0
|
67
67
|
type: :development
|
68
68
|
prerelease: false
|
69
69
|
version_requirements: !ruby/object:Gem::Requirement
|
70
70
|
requirements:
|
71
71
|
- - "~>"
|
72
72
|
- !ruby/object:Gem::Version
|
73
|
-
version:
|
73
|
+
version: 4.2.0
|
74
74
|
- !ruby/object:Gem::Dependency
|
75
75
|
name: base64
|
76
76
|
requirement: !ruby/object:Gem::Requirement
|
@@ -327,14 +327,14 @@ dependencies:
|
|
327
327
|
requirements:
|
328
328
|
- - "~>"
|
329
329
|
- !ruby/object:Gem::Version
|
330
|
-
version: '
|
330
|
+
version: '3.0'
|
331
331
|
type: :runtime
|
332
332
|
prerelease: false
|
333
333
|
version_requirements: !ruby/object:Gem::Requirement
|
334
334
|
requirements:
|
335
335
|
- - "~>"
|
336
336
|
- !ruby/object:Gem::Version
|
337
|
-
version: '
|
337
|
+
version: '3.0'
|
338
338
|
- !ruby/object:Gem::Dependency
|
339
339
|
name: stringify-hash
|
340
340
|
requirement: !ruby/object:Gem::Requirement
|
@@ -685,14 +685,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
685
685
|
requirements:
|
686
686
|
- - ">="
|
687
687
|
- !ruby/object:Gem::Version
|
688
|
-
version: '2
|
688
|
+
version: '3.2'
|
689
689
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
690
690
|
requirements:
|
691
691
|
- - ">="
|
692
692
|
- !ruby/object:Gem::Version
|
693
693
|
version: '0'
|
694
694
|
requirements: []
|
695
|
-
rubygems_version: 3.6.
|
695
|
+
rubygems_version: 3.6.9
|
696
696
|
specification_version: 4
|
697
697
|
summary: Let's test Puppet!
|
698
698
|
test_files: []
|