beaker 6.8.1 → 7.0.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 +4 -4
- data/.github/workflows/release.yml +4 -4
- data/.rubocop.yml +3 -0
- data/.rubocop_todo.yml +2 -8
- data/CHANGELOG.md +12 -0
- data/Rakefile +3 -1
- data/beaker.gemspec +3 -3
- 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/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/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: a52a04e5317c78954859cef26c1988cf66a832ad0f62de9d78c69ffbe23c108c
|
4
|
+
data.tar.gz: 4de10d9e282aaa62986410393d440278c5821d042505436131ba5d6ac92a2fdd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 155935fc22c9dd129c5c54c6179709b330048f85f6048aa4f67430b61402bbdc1934856138f23e159aaa40c306024208b7ad18ca9d9628df9c17326b20725e31
|
7
|
+
data.tar.gz: 92508f324729fde5238743beabd46b89c98921d5bd28321240ae73aebb06690cceae28db7a403ed4f385812353f650e01a82d6a67d35592d82673f6b6d7322bc
|
@@ -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/.rubocop.yml
CHANGED
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.75.
|
3
|
+
# using RuboCop version 1.75.8.
|
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
|
@@ -294,12 +294,6 @@ RSpec/UnspecifiedException:
|
|
294
294
|
RSpec/VerifiedDoubles:
|
295
295
|
Enabled: false
|
296
296
|
|
297
|
-
# Offense count: 2
|
298
|
-
# This cop supports safe autocorrection (--autocorrect).
|
299
|
-
Rake/Desc:
|
300
|
-
Exclude:
|
301
|
-
- 'Rakefile'
|
302
|
-
|
303
297
|
# Offense count: 7
|
304
298
|
Security/Eval:
|
305
299
|
Exclude:
|
@@ -316,7 +310,7 @@ Security/Open:
|
|
316
310
|
Exclude:
|
317
311
|
- 'lib/beaker/dsl/helpers/web_helpers.rb'
|
318
312
|
|
319
|
-
# Offense count:
|
313
|
+
# Offense count: 105
|
320
314
|
# This cop supports safe autocorrection (--autocorrect).
|
321
315
|
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
|
322
316
|
# URISchemes: http, https
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [7.0.0](https://github.com/voxpupuli/beaker/tree/7.0.0) (2025-08-07)
|
4
|
+
|
5
|
+
[Full Changelog](https://github.com/voxpupuli/beaker/compare/6.8.1...7.0.0)
|
6
|
+
|
7
|
+
**Breaking changes:**
|
8
|
+
|
9
|
+
- Require Ruby 3.2 [\#1906](https://github.com/voxpupuli/beaker/pull/1906) ([bastelfreak](https://github.com/bastelfreak))
|
10
|
+
|
11
|
+
**Implemented enhancements:**
|
12
|
+
|
13
|
+
- beaker-hostgenerator: Switch to 3.x [\#1937](https://github.com/voxpupuli/beaker/pull/1937) ([bastelfreak](https://github.com/bastelfreak))
|
14
|
+
|
3
15
|
## [6.8.1](https://github.com/voxpupuli/beaker/tree/6.8.1) (2025-06-16)
|
4
16
|
|
5
17
|
[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.1.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
|
@@ -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
|
@@ -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
|
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.0
|
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.1.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.1.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: []
|