beaker 5.1.0 → 5.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/release.yml +1 -1
- data/.github/workflows/test.yml +1 -1
- data/.rubocop.yml +7 -3
- data/.rubocop_todo.yml +55 -3
- data/CHANGELOG.md +30 -0
- data/Gemfile +1 -7
- data/Rakefile +0 -122
- data/acceptance/tests/base/dsl/helpers/configuration_test.rb +1 -0
- data/acceptance/tests/base/dsl/helpers/hocon_helpers_test.rb +5 -2
- data/acceptance/tests/base/dsl/helpers/host_helpers/archive_file_from_test.rb +5 -1
- data/acceptance/tests/base/dsl/helpers/host_helpers/backup_the_file_test.rb +3 -0
- data/acceptance/tests/base/dsl/helpers/host_helpers/check_for_package_test.rb +6 -0
- data/acceptance/tests/base/dsl/helpers/host_helpers/create_remote_file_test.rb +6 -0
- data/acceptance/tests/base/dsl/helpers/host_helpers/curl_on_test.rb +2 -0
- data/acceptance/tests/base/dsl/helpers/host_helpers/echo_on_test.rb +3 -1
- data/acceptance/tests/base/dsl/helpers/host_helpers/on_test.rb +10 -1
- data/acceptance/tests/base/dsl/helpers/host_helpers/retry_on_test.rb +1 -0
- data/acceptance/tests/base/dsl/helpers/host_helpers/rsync_to_test.rb +2 -0
- data/acceptance/tests/base/dsl/helpers/host_helpers/run_cron_on_test.rb +13 -0
- data/acceptance/tests/base/dsl/helpers/host_helpers/run_script_on_test.rb +2 -0
- data/acceptance/tests/base/dsl/helpers/host_helpers/run_script_test.rb +2 -0
- data/acceptance/tests/base/dsl/helpers/host_helpers/scp_from_test.rb +2 -0
- data/acceptance/tests/base/dsl/helpers/host_helpers/scp_to_test.rb +2 -0
- data/acceptance/tests/base/dsl/helpers/host_helpers/shell_test.rb +5 -0
- data/acceptance/tests/base/dsl/helpers/host_helpers/upgrade_package_test.rb +2 -0
- data/acceptance/tests/base/host/file_test.rb +7 -0
- data/acceptance/tests/base/host/host_test.rb +27 -4
- data/acceptance/tests/base/host_prebuilt_steps/ssh_environment_test.rb +3 -3
- data/acceptance/tests/hypervisor/communication_test.rb +1 -1
- data/beaker.gemspec +8 -7
- data/docs/tutorials/creating_a_test_environment.md +2 -1
- data/lib/beaker/host/aix/file.rb +2 -2
- data/lib/beaker/host/freebsd/pkg.rb +1 -1
- data/lib/beaker/host/pswindows/file.rb +7 -1
- data/lib/beaker/host/unix/exec.rb +1 -1
- data/lib/beaker/host/unix/file.rb +2 -2
- data/lib/beaker/host/windows/file.rb +2 -2
- data/lib/beaker/host.rb +24 -0
- data/lib/beaker/version.rb +1 -1
- metadata +50 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b4829c1a428f59340c095f78aa87331fb6a7df76854cdb4d95ed62553af19112
|
4
|
+
data.tar.gz: 0e08786ce7520319ea25c94ece1fb8f3a2a56e507035fd4ced4edeabfa1153ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ecddce8f3ffcc7fba3dceb5061667d48332808a76d88aae73b7d681e1d1f4478d99bdd464aa9ea3a6568425630a105618eb643ee6b9d9710e4e90adabb8e529
|
7
|
+
data.tar.gz: dd41043f67f6d951beb5de7739e7e9363a221ff2a09d9448edca2bdb9e054ad19200e639da3714d1c364e2fcc5c7ee6b1d17f572b5bdd7c458373301c23acf3a
|
data/.github/workflows/test.yml
CHANGED
data/.rubocop.yml
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
---
|
2
|
-
inherit_from:
|
3
|
-
|
4
|
-
|
2
|
+
inherit_from: .rubocop_todo.yml
|
3
|
+
|
4
|
+
inherit_gem:
|
5
|
+
voxpupuli-rubocop: rubocop.yml
|
5
6
|
|
6
7
|
Layout/LineLength:
|
7
8
|
Exclude:
|
@@ -40,6 +41,9 @@ RSpec/StubbedMock:
|
|
40
41
|
RSpec/MultipleExpectations:
|
41
42
|
Enabled: false
|
42
43
|
|
44
|
+
RSpec/IndexedLet:
|
45
|
+
Enabled: false
|
46
|
+
|
43
47
|
RSpec/NestedGroups:
|
44
48
|
Max: 4
|
45
49
|
|
data/.rubocop_todo.yml
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
# This configuration was generated by
|
2
|
-
# `rubocop --auto-gen-config
|
3
|
-
# using RuboCop version 1.
|
2
|
+
# `rubocop --auto-gen-config`
|
3
|
+
# on 2023-05-30 09:17:22 UTC using RuboCop version 1.50.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
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
8
8
|
|
9
|
+
# Offense count: 15
|
9
10
|
# Configuration parameters: AllowedMethods.
|
10
11
|
# AllowedMethods: enums
|
11
12
|
Lint/ConstantDefinitionInBlock:
|
@@ -26,6 +27,7 @@ Lint/ConstantDefinitionInBlock:
|
|
26
27
|
- 'spec/beaker/host/windows/pkg_spec.rb'
|
27
28
|
- 'spec/beaker/options/hosts_file_parser_spec.rb'
|
28
29
|
|
30
|
+
# Offense count: 17
|
29
31
|
# Configuration parameters: AllowComments, AllowEmptyLambdas.
|
30
32
|
Lint/EmptyBlock:
|
31
33
|
Exclude:
|
@@ -35,16 +37,19 @@ Lint/EmptyBlock:
|
|
35
37
|
- 'spec/beaker/logger_junit_spec.rb'
|
36
38
|
- 'spec/beaker/logger_spec.rb'
|
37
39
|
|
40
|
+
# Offense count: 1
|
38
41
|
# This cop supports unsafe autocorrection (--autocorrect-all).
|
39
42
|
Lint/NonAtomicFileOperation:
|
40
43
|
Exclude:
|
41
44
|
- 'acceptance/tests/base/dsl/helpers/host_helpers/archive_file_from_test.rb'
|
42
45
|
|
46
|
+
# Offense count: 2
|
43
47
|
Lint/RescueException:
|
44
48
|
Exclude:
|
45
49
|
- 'lib/beaker/dsl/structure.rb'
|
46
50
|
- 'lib/beaker/test_suite_result.rb'
|
47
51
|
|
52
|
+
# Offense count: 27
|
48
53
|
Lint/ShadowingOuterLocalVariable:
|
49
54
|
Exclude:
|
50
55
|
- 'lib/beaker/dsl/helpers/host_helpers.rb'
|
@@ -55,6 +60,7 @@ Lint/ShadowingOuterLocalVariable:
|
|
55
60
|
- 'lib/beaker/host_prebuilt_steps.rb'
|
56
61
|
- 'lib/beaker/perf.rb'
|
57
62
|
|
63
|
+
# Offense count: 12
|
58
64
|
Lint/UselessAssignment:
|
59
65
|
Exclude:
|
60
66
|
- 'acceptance/tests/base/dsl/helpers/host_helpers/curl_with_retries_test.rb'
|
@@ -62,6 +68,29 @@ Lint/UselessAssignment:
|
|
62
68
|
- 'lib/beaker/dsl/helpers/host_helpers.rb'
|
63
69
|
- 'lib/beaker/logger_junit.rb'
|
64
70
|
|
71
|
+
# Offense count: 5
|
72
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
73
|
+
Minitest/AssertTruthy:
|
74
|
+
Exclude:
|
75
|
+
- 'acceptance/tests/base/dsl/helpers/host_helpers/archive_file_from_test.rb'
|
76
|
+
- 'acceptance/tests/base/host/host_test.rb'
|
77
|
+
- 'acceptance/tests/hypervisor/communication_test.rb'
|
78
|
+
|
79
|
+
# Offense count: 2
|
80
|
+
# Configuration parameters: Severity.
|
81
|
+
Minitest/AssertWithExpectedArgument:
|
82
|
+
Exclude:
|
83
|
+
- 'acceptance/tests/base/dsl/helpers/hocon_helpers_test.rb'
|
84
|
+
|
85
|
+
# Offense count: 9
|
86
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
87
|
+
Minitest/RefuteFalse:
|
88
|
+
Exclude:
|
89
|
+
- 'acceptance/tests/base/dsl/helpers/host_helpers/archive_file_from_test.rb'
|
90
|
+
- 'acceptance/tests/base/dsl/helpers/host_helpers/check_for_package_test.rb'
|
91
|
+
- 'acceptance/tests/base/host/host_test.rb'
|
92
|
+
|
93
|
+
# Offense count: 20
|
65
94
|
# Configuration parameters: ForbiddenDelimiters.
|
66
95
|
# ForbiddenDelimiters: (?i-mx:(^|\s)(EO[A-Z]{1}|END)(\s|$))
|
67
96
|
Naming/HeredocDelimiterNaming:
|
@@ -77,6 +106,7 @@ Naming/HeredocDelimiterNaming:
|
|
77
106
|
- 'spec/beaker/host/windows_spec.rb'
|
78
107
|
- 'spec/beaker/test_case_spec.rb'
|
79
108
|
|
109
|
+
# Offense count: 2
|
80
110
|
# Configuration parameters: EnforcedStyleForLeadingUnderscores.
|
81
111
|
# SupportedStylesForLeadingUnderscores: disallowed, required, optional
|
82
112
|
Naming/MemoizedInstanceVariableName:
|
@@ -84,6 +114,7 @@ Naming/MemoizedInstanceVariableName:
|
|
84
114
|
- 'lib/beaker/host.rb'
|
85
115
|
- 'lib/beaker/options/presets.rb'
|
86
116
|
|
117
|
+
# Offense count: 4
|
87
118
|
# Configuration parameters: MinSize.
|
88
119
|
Performance/CollectionLiteralInLoop:
|
89
120
|
Exclude:
|
@@ -91,11 +122,13 @@ Performance/CollectionLiteralInLoop:
|
|
91
122
|
- 'lib/beaker/dsl/structure.rb'
|
92
123
|
- 'lib/beaker/test_suite_result.rb'
|
93
124
|
|
125
|
+
# Offense count: 17
|
94
126
|
RSpec/AnyInstance:
|
95
127
|
Exclude:
|
96
128
|
- 'spec/beaker/host/windows/file_spec.rb'
|
97
129
|
- 'spec/beaker/subcommand_spec.rb'
|
98
130
|
|
131
|
+
# Offense count: 12
|
99
132
|
# This cop supports unsafe autocorrection (--autocorrect-all).
|
100
133
|
RSpec/BeEq:
|
101
134
|
Exclude:
|
@@ -104,15 +137,18 @@ RSpec/BeEq:
|
|
104
137
|
- 'spec/beaker/host/windows/exec_spec.rb'
|
105
138
|
- 'spec/beaker/host_spec.rb'
|
106
139
|
|
140
|
+
# Offense count: 121
|
107
141
|
# Configuration parameters: Prefixes, AllowedPatterns.
|
108
142
|
# Prefixes: when, with, without
|
109
143
|
RSpec/ContextWording:
|
110
144
|
Enabled: false
|
111
145
|
|
146
|
+
# Offense count: 239
|
112
147
|
# Configuration parameters: CountAsOne.
|
113
148
|
RSpec/ExampleLength:
|
114
149
|
Max: 44
|
115
150
|
|
151
|
+
# Offense count: 27
|
116
152
|
RSpec/ExpectInHook:
|
117
153
|
Exclude:
|
118
154
|
- 'spec/beaker/cli_spec.rb'
|
@@ -124,6 +160,7 @@ RSpec/ExpectInHook:
|
|
124
160
|
- 'spec/beaker/options/parser_spec.rb'
|
125
161
|
- 'spec/beaker/ssh_connection_spec.rb'
|
126
162
|
|
163
|
+
# Offense count: 22
|
127
164
|
# Configuration parameters: AssignmentOnly.
|
128
165
|
RSpec/InstanceVariable:
|
129
166
|
Exclude:
|
@@ -133,10 +170,12 @@ RSpec/InstanceVariable:
|
|
133
170
|
- 'spec/beaker/dsl/test_tagging_spec.rb'
|
134
171
|
- 'spec/beaker/host_prebuilt_steps_spec.rb'
|
135
172
|
|
173
|
+
# Offense count: 3
|
136
174
|
RSpec/IteratedExpectation:
|
137
175
|
Exclude:
|
138
176
|
- 'spec/beaker/dsl/helpers/host_helpers_spec.rb'
|
139
177
|
|
178
|
+
# Offense count: 12
|
140
179
|
RSpec/LeakyConstantDeclaration:
|
141
180
|
Exclude:
|
142
181
|
- 'spec/beaker/host/freebsd/exec_spec.rb'
|
@@ -152,19 +191,23 @@ RSpec/LeakyConstantDeclaration:
|
|
152
191
|
- 'spec/beaker/host/windows/pkg_spec.rb'
|
153
192
|
- 'spec/beaker/options/hosts_file_parser_spec.rb'
|
154
193
|
|
194
|
+
# Offense count: 1
|
155
195
|
RSpec/MultipleDescribes:
|
156
196
|
Exclude:
|
157
197
|
- 'spec/beaker/dsl/test_tagging_spec.rb'
|
158
198
|
|
199
|
+
# Offense count: 134
|
159
200
|
# Configuration parameters: AllowSubject.
|
160
201
|
RSpec/MultipleMemoizedHelpers:
|
161
202
|
Max: 17
|
162
203
|
|
204
|
+
# Offense count: 500
|
163
205
|
# Configuration parameters: EnforcedStyle, IgnoreSharedExamples.
|
164
206
|
# SupportedStyles: always, named_only
|
165
207
|
RSpec/NamedSubject:
|
166
208
|
Enabled: false
|
167
209
|
|
210
|
+
# Offense count: 42
|
168
211
|
# Configuration parameters: AllowedPatterns.
|
169
212
|
# AllowedPatterns: ^expect_, ^assert_
|
170
213
|
RSpec/NoExpectationExample:
|
@@ -175,17 +218,20 @@ RSpec/NoExpectationExample:
|
|
175
218
|
- 'spec/beaker/logger_spec.rb'
|
176
219
|
- 'spec/beaker/options/subcommand_options_parser_spec.rb'
|
177
220
|
|
221
|
+
# Offense count: 7
|
178
222
|
RSpec/RepeatedDescription:
|
179
223
|
Exclude:
|
180
224
|
- 'spec/beaker/cli_spec.rb'
|
181
225
|
- 'spec/beaker/host/unix/exec_spec.rb'
|
182
226
|
- 'spec/beaker/host/unix/pkg_spec.rb'
|
183
227
|
|
228
|
+
# Offense count: 4
|
184
229
|
RSpec/RepeatedExample:
|
185
230
|
Exclude:
|
186
231
|
- 'spec/beaker/dsl/roles_spec.rb'
|
187
232
|
- 'spec/beaker/logger_spec.rb'
|
188
233
|
|
234
|
+
# Offense count: 178
|
189
235
|
RSpec/SubjectStub:
|
190
236
|
Exclude:
|
191
237
|
- 'spec/beaker/dsl/assertions_spec.rb'
|
@@ -202,6 +248,7 @@ RSpec/SubjectStub:
|
|
202
248
|
- 'spec/beaker/host/windows/user_spec.rb'
|
203
249
|
- 'spec/beaker/host_prebuilt_steps_spec.rb'
|
204
250
|
|
251
|
+
# Offense count: 12
|
205
252
|
RSpec/UnspecifiedException:
|
206
253
|
Exclude:
|
207
254
|
- 'spec/beaker/cli_spec.rb'
|
@@ -209,15 +256,18 @@ RSpec/UnspecifiedException:
|
|
209
256
|
- 'spec/beaker/host_spec.rb'
|
210
257
|
- 'spec/beaker/test_suite_spec.rb'
|
211
258
|
|
259
|
+
# Offense count: 86
|
212
260
|
# Configuration parameters: IgnoreNameless, IgnoreSymbolicNames.
|
213
261
|
RSpec/VerifiedDoubles:
|
214
262
|
Enabled: false
|
215
263
|
|
264
|
+
# Offense count: 2
|
216
265
|
# This cop supports safe autocorrection (--autocorrect).
|
217
266
|
Rake/Desc:
|
218
267
|
Exclude:
|
219
268
|
- 'Rakefile'
|
220
269
|
|
270
|
+
# Offense count: 7
|
221
271
|
Security/Eval:
|
222
272
|
Exclude:
|
223
273
|
- 'Rakefile'
|
@@ -228,12 +278,14 @@ Security/Eval:
|
|
228
278
|
- 'lib/beaker/options/options_file_parser.rb'
|
229
279
|
- 'lib/beaker/test_case.rb'
|
230
280
|
|
281
|
+
# Offense count: 1
|
231
282
|
Security/Open:
|
232
283
|
Exclude:
|
233
284
|
- 'lib/beaker/dsl/helpers/web_helpers.rb'
|
234
285
|
|
286
|
+
# Offense count: 104
|
235
287
|
# This cop supports safe autocorrection (--autocorrect).
|
236
288
|
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
|
237
289
|
# URISchemes: http, https
|
238
290
|
Layout/LineLength:
|
239
|
-
Max:
|
291
|
+
Max: 225
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,35 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [5.3.0] (https://github.com/voxpupuli/beaker/tree/5.3.0) (2023-06-06)
|
4
|
+
|
5
|
+
**Implemented enhancements:**
|
6
|
+
|
7
|
+
- Add bcrypt_pbkdf to fix ed25519 ssh keys support [\#1810](https://github.com/voxpupuli/beaker/pull/1810) ([jay7x](https://github.com/jay7x))
|
8
|
+
|
9
|
+
**Merged changes:**
|
10
|
+
|
11
|
+
- Build gems with verbosity and strictness [\#1811](https://github.com/voxpupuli/beaker/pull/1811) ([bastelfreak](https://github.com/bastelfreak))
|
12
|
+
- rubocop: autofix [\#1816](https://github.com/voxpupuli/beaker/pull/1816) ([bastelfreak](https://github.com/bastelfreak))
|
13
|
+
- GCG: Add missing faraday dependency [\#1815](https://github.com/voxpupuli/beaker/pull/1815) ([bastelfreak](https://github.com/bastelfreak))
|
14
|
+
|
15
|
+
## [5.2.0](https://github.com/voxpupuli/beaker/tree/5.2.0) (2023-04-28)
|
16
|
+
|
17
|
+
**Implemented enhancements:**
|
18
|
+
|
19
|
+
- Enhance documentation about roles [\#1800](https://github.com/voxpupuli/beaker/pull/1800) ([rwaffen](https://github.com/rwaffen))
|
20
|
+
- Declare API interface on Beaker::Host [\#1806](https://github.com/voxpupuli/beaker/pull/1806) ([ekohl](https://github.com/ekohl))
|
21
|
+
- Support an extension to tmpfile [\#1735](https://github.com/voxpupuli/beaker/pull/1735) ([ekohl](https://github.com/ekohl))
|
22
|
+
|
23
|
+
**Fixed bugs:**
|
24
|
+
|
25
|
+
- Use systemctl to restat SSH on EL9 [\#1808](https://github.com/voxpupuli/beaker/pull/1808) ([ekohl](https://github.com/ekohl))
|
26
|
+
|
27
|
+
**Merged changes:**
|
28
|
+
|
29
|
+
- Drop legacy yard tasks [\#1805](https://github.com/voxpupuli/beaker/pull/1805) ([bastelfreak](https://github.com/bastelfreak))
|
30
|
+
- Switch to voxpupuli-rubocop [\#1804](https://github.com/voxpupuli/beaker/pull/1804) ([bastelfreak](https://github.com/bastelfreak))
|
31
|
+
- Disable RSpec/IndexedLet [\#1807](https://github.com/voxpupuli/beaker/pull/1807) ([ekohl](https://github.com/ekohl))
|
32
|
+
|
3
33
|
## [5.1.0](https://github.com/voxpupuli/beaker/tree/5.1.0) (2023-03-27)
|
4
34
|
|
5
35
|
**Implemented enhancements:**
|
data/Gemfile
CHANGED
@@ -25,14 +25,8 @@ 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
|
29
|
+
gem 'faraday-retry', require: false
|
36
30
|
gem 'github_changelog_generator', require: false
|
37
31
|
end
|
38
32
|
|
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'
|
@@ -8,6 +8,7 @@ test_name "dsl::helpers::host_helpers test configuration validation" do
|
|
8
8
|
"dsl::helpers::host_helpers acceptance tests require at least two hosts"
|
9
9
|
|
10
10
|
agents = select_hosts(:roles => "agent")
|
11
|
+
|
11
12
|
assert (agents.size > 1),
|
12
13
|
"dsl::helpers::host_helpers acceptance tests require at least two hosts with the :agent role"
|
13
14
|
|
@@ -15,6 +15,7 @@ test_name 'Hocon Helpers Test' do
|
|
15
15
|
|
16
16
|
step '#hocon_file_read : reads doc' do
|
17
17
|
doc = hocon_file_read_on(hosts[0], hocon_filename)
|
18
|
+
|
18
19
|
assert(doc.has_value?('setting2'))
|
19
20
|
end
|
20
21
|
|
@@ -34,7 +35,7 @@ test_name 'Hocon Helpers Test' do
|
|
34
35
|
end
|
35
36
|
fail('execution should not continue in failure mode')
|
36
37
|
rescue ArgumentError => e
|
37
|
-
|
38
|
+
assert_includes(e.to_s, 'requires a filename')
|
38
39
|
else
|
39
40
|
fail('No exception raised in failure mode')
|
40
41
|
end
|
@@ -53,7 +54,7 @@ test_name 'Hocon Helpers Test' do
|
|
53
54
|
hocon_file_edit_on(hosts, hocon_filename)
|
54
55
|
fail('execution should not continue in failure mode')
|
55
56
|
rescue ArgumentError => e
|
56
|
-
|
57
|
+
assert_includes(e.to_s, 'No block was provided')
|
57
58
|
else
|
58
59
|
fail('No exception raised in failure mode')
|
59
60
|
end
|
@@ -71,6 +72,7 @@ test_name 'Hocon Helpers Test' do
|
|
71
72
|
step '#hocon_file_edit_on : independently read value to verify save' do
|
72
73
|
hocon_file_edit_on(hosts, hocon_filename) do |_host, doc|
|
73
74
|
msg_fail = 'Should have saved "a.b" value inserted in previous step'
|
75
|
+
|
74
76
|
assert(doc.has_value?('a.b'), msg_fail)
|
75
77
|
end
|
76
78
|
end
|
@@ -86,6 +88,7 @@ test_name 'Hocon Helpers Test' do
|
|
86
88
|
step '#hocon_file_edit_in_place_on : verify save' do
|
87
89
|
hocon_file_edit_on(hosts, hocon_filename) do |_host, doc|
|
88
90
|
msg_fail = 'Should have saved "c.d" value inserted in previous step'
|
91
|
+
|
89
92
|
assert(doc.has_value?('c.d'), msg_fail)
|
90
93
|
end
|
91
94
|
end
|
@@ -15,6 +15,7 @@ test_name "dsl::helpers::host_helpers #archive_file_from" do
|
|
15
15
|
assert_equal(false, Dir.exist?('archive'))
|
16
16
|
assert_equal(false, Dir.exist?('archive/sut-files'))
|
17
17
|
archive_file_from(default, filepath)
|
18
|
+
|
18
19
|
assert_equal(true, Dir.exist?('archive/sut-files'))
|
19
20
|
end
|
20
21
|
|
@@ -32,17 +33,20 @@ test_name "dsl::helpers::host_helpers #archive_file_from" do
|
|
32
33
|
# Create a remote file to archive
|
33
34
|
filepath = default.tmpfile('archive-file-test')
|
34
35
|
create_remote_file(default, filepath, 'number of the beast')
|
36
|
+
|
35
37
|
assert_equal(false, Dir.exist?(filepath))
|
36
38
|
|
37
39
|
# Test that the file is copied locally to <archiveroot>/<hostname>/<filepath>
|
38
40
|
Dir.mktmpdir do |tmpdir|
|
39
41
|
tar_path = File.join(tmpdir, default, filepath + '.tgz')
|
40
42
|
archive_file_from(default, filepath, {}, tmpdir, tar_path)
|
41
|
-
|
43
|
+
|
44
|
+
assert_path_exists(tar_path)
|
42
45
|
expected_path = File.join(tmpdir, default)
|
43
46
|
|
44
47
|
tgz = Zlib::GzipReader.new(File.open(tar_path, 'rb'))
|
45
48
|
Minitar.unpack(tgz, expected_path)
|
49
|
+
|
46
50
|
assert_equal('number of the beast', File.read(expected_path + '/' + filepath).strip)
|
47
51
|
end
|
48
52
|
end
|
@@ -6,6 +6,7 @@ test_name "dsl::helpers::host_helpers #backup_the_file" do
|
|
6
6
|
remote_source = default.tmpdir
|
7
7
|
remote_destination = default.tmpdir
|
8
8
|
result = backup_the_file default, remote_source, remote_destination
|
9
|
+
|
9
10
|
assert_nil result
|
10
11
|
end
|
11
12
|
|
@@ -29,6 +30,7 @@ test_name "dsl::helpers::host_helpers #backup_the_file" do
|
|
29
30
|
|
30
31
|
assert_equal remote_destination_filename, result
|
31
32
|
remote_contents = on(default, "cat #{remote_destination_filename}").stdout
|
33
|
+
|
32
34
|
assert_equal contents, remote_contents
|
33
35
|
end
|
34
36
|
|
@@ -43,6 +45,7 @@ test_name "dsl::helpers::host_helpers #backup_the_file" do
|
|
43
45
|
|
44
46
|
assert_equal remote_destination_filename, result
|
45
47
|
remote_contents = on(default, "cat #{remote_destination_filename}").stdout
|
48
|
+
|
46
49
|
assert_equal contents, remote_contents
|
47
50
|
end
|
48
51
|
|
@@ -25,11 +25,13 @@ test_name "dsl::helpers::host_helpers #check_for_package" do
|
|
25
25
|
|
26
26
|
step "#check_for_package will return false if the specified package is not installed on the remote host" do
|
27
27
|
result = check_for_package default, "non-existent-package-name"
|
28
|
+
|
28
29
|
assert !result
|
29
30
|
end
|
30
31
|
|
31
32
|
step "#check_for_package will return true if the specified package is installed on the remote host" do
|
32
33
|
result = check_for_package default, known_installed_package
|
34
|
+
|
33
35
|
assert result
|
34
36
|
end
|
35
37
|
|
@@ -43,11 +45,13 @@ test_name "dsl::helpers::host_helpers #check_for_package" do
|
|
43
45
|
confine_block :to, :platform => /solaris/ do
|
44
46
|
step "#check_for_package will return false if the specified package is not installed on the remote host" do
|
45
47
|
result = check_for_package default, "non-existent-package-name"
|
48
|
+
|
46
49
|
assert !result
|
47
50
|
end
|
48
51
|
|
49
52
|
step "#check_for_package will return true if the specified package is installed on the remote host" do
|
50
53
|
result = check_for_package default, known_installed_package
|
54
|
+
|
51
55
|
assert result
|
52
56
|
end
|
53
57
|
|
@@ -69,12 +73,14 @@ test_name "dsl::helpers::host_helpers #check_for_package" do
|
|
69
73
|
confine_block :except, :platform => /windows|solaris|osx/ do
|
70
74
|
step "#check_for_package will return false if the specified package is not installed on the remote host" do
|
71
75
|
result = check_for_package default, "non-existent-package-name"
|
76
|
+
|
72
77
|
assert !result
|
73
78
|
end
|
74
79
|
|
75
80
|
step "#check_for_package will return true if the specified package is installed on the remote host" do
|
76
81
|
install_package default, known_installed_package
|
77
82
|
result = check_for_package default, known_installed_package
|
83
|
+
|
78
84
|
assert result
|
79
85
|
end
|
80
86
|
|
@@ -43,6 +43,7 @@ test_name "dsl::helpers::host_helpers #create_remote_file" do
|
|
43
43
|
create_remote_file_with_backups default, remote_filename, contents
|
44
44
|
|
45
45
|
remote_contents = on(default, "cat #{remote_filename}").stdout
|
46
|
+
|
46
47
|
assert_equal contents, remote_contents
|
47
48
|
end
|
48
49
|
|
@@ -54,6 +55,7 @@ test_name "dsl::helpers::host_helpers #create_remote_file" do
|
|
54
55
|
create_remote_file_with_backups default, remote_filename, contents, { :protocol => "scp" }
|
55
56
|
|
56
57
|
remote_contents = on(default, "cat #{remote_filename}").stdout
|
58
|
+
|
57
59
|
assert_equal contents, remote_contents
|
58
60
|
end
|
59
61
|
|
@@ -72,6 +74,7 @@ test_name "dsl::helpers::host_helpers #create_remote_file" do
|
|
72
74
|
|
73
75
|
hosts.each do |host|
|
74
76
|
remote_contents = on(host, "cat #{remote_filename}").stdout
|
77
|
+
|
75
78
|
assert_equal contents, remote_contents
|
76
79
|
end
|
77
80
|
end
|
@@ -91,6 +94,7 @@ test_name "dsl::helpers::host_helpers #create_remote_file" do
|
|
91
94
|
|
92
95
|
hosts.each do |host|
|
93
96
|
remote_contents = on(host, "cat #{remote_filename}").stdout
|
97
|
+
|
94
98
|
assert_equal contents, remote_contents
|
95
99
|
end
|
96
100
|
end
|
@@ -144,6 +148,7 @@ test_name "dsl::helpers::host_helpers #create_remote_file" do
|
|
144
148
|
"contents" => contents,
|
145
149
|
"result" => result) do
|
146
150
|
remote_contents = on(default, "cat #{remote_filename}").stdout
|
151
|
+
|
147
152
|
assert_equal contents, remote_contents
|
148
153
|
end
|
149
154
|
end
|
@@ -171,6 +176,7 @@ test_name "dsl::helpers::host_helpers #create_remote_file" do
|
|
171
176
|
"contents" => contents,
|
172
177
|
"result" => result) do
|
173
178
|
remote_contents = on(host, "cat #{remote_filename}").stdout
|
179
|
+
|
174
180
|
assert_equal contents, remote_contents
|
175
181
|
end
|
176
182
|
end
|