simp-beaker-helpers 1.27.0 → 1.29.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3e12166a33cca84b167545aee4efc3028ba09d46e1067aa00d62d6eb41a170b7
4
- data.tar.gz: 41b71fae99411f4817927d40aa7763d46ec0ba96246054768149b04e763a0fe0
3
+ metadata.gz: 25fe1e94533f021b08b45d117546d0117a068a85e2087848917554341db0bff8
4
+ data.tar.gz: 907168ef1038666cffeee8101f66471a6eda6b6a69e925c2731fa17b2cb2ef2a
5
5
  SHA512:
6
- metadata.gz: 44b3731e4953d446ddccb495934ac334b3aaee62f4d768921d8be6aae9c8425c31997334c10dea0f84b1a38d4205aa3e1ce272ffefb1ff04003ec49979691776
7
- data.tar.gz: 522e33939ad65d12416792e9241f7891eefc55dcf4f5d4fc1c02b0efffe7758a015a36c9115706e61df764e59df3a9e9d03f36c6a2ce3b449b1b7747dcc4b846
6
+ metadata.gz: f4cf5a2c52657b1d16ca89679e64c9ac5de4d82def72b4f9dd383538c77dfc7ca642f44f5db74c2cbf68700bd44f9ac3907adb8db98b4af262efa6fd7d08930d
7
+ data.tar.gz: 15ff184de51d666174c1294ae38bdc33ba662f562a4aea5cc5b0497efccc2cf9285a14e37b3e81c621754f5b26654b623787b3dc3161ee9e5b79cccb26b2f276
@@ -67,7 +67,7 @@ jobs:
67
67
  outputs:
68
68
  valid: ${{ steps.validate-glci-file.outputs.valid }}
69
69
  steps:
70
- - uses: actions/checkout@v2
70
+ - uses: actions/checkout@v3
71
71
  with:
72
72
  repository: ${{ github.event.pull_request.head.repo.full_name }}
73
73
  ref: ${{ github.event.pull_request.head.ref }}
@@ -80,11 +80,11 @@ jobs:
80
80
 
81
81
  contributor-permissions:
82
82
  name: 'PR contributor check'
83
- runs-on: ubuntu-18.04
83
+ runs-on: ubuntu-latest
84
84
  outputs:
85
85
  permitted: ${{ steps.user-repo-permissions.outputs.permitted }}
86
86
  steps:
87
- - uses: actions/github-script@v3
87
+ - uses: actions/github-script@v6
88
88
  id: user-repo-permissions
89
89
  with:
90
90
  github-token: ${{secrets.GITHUB_TOKEN}}
@@ -135,7 +135,7 @@ jobs:
135
135
  # - Not implemented: For some reason, this conditional always fails
136
136
  # - Unnecessary if on>pull_request_target>types doesn't include 'closed'
137
137
  if: github.event_name == 'pull_request_target' && ( github.event.action == 'opened' || github.event.action == 'reopened' || github.event.action == 'synchronize' ) && github.event.pull_request.merged != 'true' && needs.glci-syntax.outputs.valid == 'true' && needs.contributor-permissions.outputs.permitted == 'true'
138
- runs-on: ubuntu-18.04
138
+ runs-on: ubuntu-latest
139
139
  steps:
140
140
  # Things we'd like to do:
141
141
  # - [ ] if there's no GitLab mirror, make one
@@ -145,7 +145,7 @@ jobs:
145
145
  # - "created|waiting_for_resource|preparing|pending|running"
146
146
  # - Exception: don't cancel existing pipeline for our own commit
147
147
  # - [x] if PR: force-push branch to GitLab
148
- - uses: actions/checkout@v2
148
+ - uses: actions/checkout@v3
149
149
  if: needs.contributor-permissions.outputs.permitted == 'true'
150
150
  with:
151
151
  clean: true
@@ -40,9 +40,9 @@ jobs:
40
40
  # `on` section is inadventently modified without considering the security
41
41
  # implications.
42
42
  if: github.event_name == 'pull_request_target' && github.event.action == 'closed'
43
- runs-on: ubuntu-18.04
43
+ runs-on: ubuntu-latest
44
44
  steps:
45
- - uses: actions/checkout@v2
45
+ - uses: actions/checkout@v3
46
46
  with:
47
47
  repository: ${{ github.event.pull_request.head.repo.full_name }}
48
48
  ref: ${{ github.event.pull_request.head.ref }}
@@ -2,7 +2,7 @@
2
2
  # ------------------------------------------------------------------------------
3
3
  #
4
4
  # NOTICE: **This file is maintained with puppetsync**
5
- #
5
+
6
6
  # This file is updated automatically as part of a standardized asset baseline.
7
7
  #
8
8
  # The next baseline sync will overwrite any local changes to this file!
@@ -42,7 +42,7 @@ on:
42
42
  jobs:
43
43
  glci-syntax:
44
44
  name: '.gitlab-ci.yml Syntax'
45
- runs-on: ubuntu-18.04
45
+ runs-on: ubuntu-latest
46
46
  outputs:
47
47
  valid: ${{ steps.validate-glci-file.outputs.valid }}
48
48
  pr_head_ref: ${{ steps.get-pr.outputs.pr_head_ref }}
@@ -50,7 +50,7 @@ jobs:
50
50
  pr_head_label: ${{ steps.get-pr.outputs.pr_head_label }}
51
51
  pr_head_full_name: ${{ steps.get-pr.outputs.pr_full_name }}
52
52
  steps:
53
- - uses: actions/github-script@v3
53
+ - uses: actions/github-script@v6
54
54
  id: get-pr
55
55
  with:
56
56
  github-token: ${{secrets.NO_SCOPE_GITHUB_TOKEN}}
@@ -90,7 +90,7 @@ jobs:
90
90
  core.setOutput( 'pr_head_ref', pr.data.head.ref )
91
91
  core.setOutput( 'pr_head_label', pr.data.head.label )
92
92
  core.setOutput( 'pr_head_full_name', pr.data.head.full_name )
93
- - uses: actions/checkout@v2
93
+ - uses: actions/checkout@v3
94
94
  with:
95
95
  repository: ${{ steps.get-pr.outputs.pr_head_full_name }}
96
96
  ref: ${{ steps.get-pr.outputs.pr_head_sha }}
@@ -106,9 +106,9 @@ jobs:
106
106
  trigger-when-user-has-repo-permissions:
107
107
  name: 'Trigger CI'
108
108
  needs: [ glci-syntax ]
109
- runs-on: ubuntu-18.04
109
+ runs-on: ubuntu-latest
110
110
  steps:
111
- - uses: actions/checkout@v2
111
+ - uses: actions/checkout@v3
112
112
  with:
113
113
  repository: ${{ needs.glci-syntax.outputs.pr_head_full_name }}
114
114
  ref: ${{ needs.glci-syntax.outputs.pr_head_sha }}
@@ -129,7 +129,7 @@ jobs:
129
129
  ### needs: [ glci-syntax ]
130
130
  ### name: 'Examine Context contents'
131
131
  ### if: always()
132
- ### runs-on: ubuntu-18.04
132
+ ### runs-on: ubuntu-latest
133
133
  ### steps:
134
134
  ### - name: Dump contexts
135
135
  ### env:
@@ -33,7 +33,7 @@ on:
33
33
  types: [opened, reopened, synchronize]
34
34
 
35
35
  env:
36
- PUPPET_VERSION: '~> 6'
36
+ PUPPET_VERSION: '~> 7'
37
37
 
38
38
  jobs:
39
39
  ruby-style:
@@ -58,12 +58,9 @@ jobs:
58
58
  strategy:
59
59
  matrix:
60
60
  puppet:
61
- - label: 'Puppet 6.18 [SIMP 6.5/PE 2019.8]'
62
- puppet_version: '~> 6.18.0'
61
+ - label: 'Puppet 6.x [SIMP 6.5/PE 2019.8]'
62
+ puppet_version: '~> 6.0'
63
63
  ruby_version: '2.5'
64
- - label: 'Puppet 5.5 [SIMP 6.4/PE 2018.1]'
65
- puppet_version: '~> 5.5.22'
66
- ruby_version: '2.4'
67
64
  - label: 'Puppet 7.x'
68
65
  puppet_version: '~> 7.0'
69
66
  ruby_version: '2.7'
@@ -63,7 +63,7 @@ jobs:
63
63
  steps:
64
64
  - name: "Assert '${{ github.ref }}' is a tag"
65
65
  run: '[[ "$GITHUB_REF" =~ ^refs/tags/ ]] || { echo "::error ::GITHUB_REF is not a tag: ${GITHUB_REF}"; exit 1 ; }'
66
- - uses: actions/checkout@v2
66
+ - uses: actions/checkout@v3
67
67
  with:
68
68
  ref: ${{ github.ref }}
69
69
  clean: true
@@ -115,7 +115,7 @@ jobs:
115
115
  prerelease: ${{ steps.tag-check.outputs.prerelease }}
116
116
  steps:
117
117
  - name: Checkout code
118
- uses: actions/checkout@v2
118
+ uses: actions/checkout@v3
119
119
  with:
120
120
  ref: ${{ github.ref }}
121
121
  clean: true
@@ -177,7 +177,7 @@ jobs:
177
177
  PKG_DIR: ${{ needs.releng-checks.outputs.pkg_dir }}
178
178
  steps:
179
179
  - name: Checkout code
180
- uses: actions/checkout@v2
180
+ uses: actions/checkout@v3
181
181
  with:
182
182
  ref: ${{ github.ref }}
183
183
  clean: true
data/.gitlab-ci.yml CHANGED
@@ -25,7 +25,7 @@ variables:
25
25
  # anchors. If it is still `UNDEFINED`, all the other setting from the job's
26
26
  # anchor are also missing.
27
27
  PUPPET_VERSION: 'UNDEFINED' # <- Matrixed jobs MUST override this (or fail)
28
- BUNDLER_VERSION: '1.17.1'
28
+ BUNDLER_VERSION: '2.2.19'
29
29
  SIMP_MATRIX_LEVEL: '1'
30
30
  SIMP_FORCE_RUN_MATRIX: 'no'
31
31
 
@@ -37,22 +37,24 @@ variables:
37
37
  BUNDLE_BIN: .vendor/gem_install/bin
38
38
  BUNDLE_NO_PRUNE: 'true'
39
39
 
40
+ .snippets:
41
+ before_beaker_google:
42
+ # Logic for beaker-google environments
43
+ - echo -e "\e[0Ksection_start:`date +%s`:before_script05[collapsed=true]\r\e[0KGCP environment checks"
44
+ - "if [ \"$BEAKER_HYPERVISOR\" == google ]; then mkdir -p ~/.ssh; chmod 700 ~/.ssh; test -f ~/.ssh/google_compute_engine || ssh-keygen -f ~/.ssh/google_compute_engine < /dev/null; echo 'gem \"beaker-google\"' >> Gemfile.local ; fi"
45
+ - echo -e "\e[0Ksection_end:`date +%s`:before_script05\r\e[0K"
40
46
 
41
- # bundler dependencies + caching, optional RVM setup, with diagnostic output
42
- # --------------------------------------------------------------------------
43
- .setup_bundler_env: &setup_bundler_env
44
- cache:
45
- # Cache bundler gems between pipelines for each Ruby version
46
- key: "${CI_PROJECT_NAMESPACE}_ruby-${MATRIX_RUBY_VERSION}_bundler"
47
- paths:
48
- - '.vendor'
49
- before_script:
50
- - 'ruby -e "puts %(\n\n), %q(=)*80, %(\nSIMP-relevant Environment Variables:\n\n#{e=ENV.keys.grep(/^PUPPET|^SIMP|^BEAKER|MATRIX/); pad=e.map{|x| x.size}.max+1; e.map{|v| %( * #{%(#{v}:).ljust(pad)} #{39.chr + ENV[v] + 39.chr}\n)}.join}\n), %q(=)*80, %(\n\n)"'
47
+ before:
48
+ # Print important environment variables that may affect this job
49
+ - 'ruby -e "puts %(\n\n), %q(=)*80, %(\nSIMP-relevant Environment Variables:\n\n#{e=ENV.keys.grep(/^PUPPET|^SIMP|^BEAKER|MATRIX|GOOGLE/); pad=((e.map{|x| x.size}.max||0)+1); e.map{|v| %( * #{%(#{v}:).ljust(pad)} #{39.chr + ENV[v] + 39.chr}\n)}.join}\n), %q(=)*80, %(\n\n)" || :'
50
+
51
+ - echo -e "\e[0Ksection_start:`date +%s`:before_script10[collapsed=true]\r\e[0KDiagnostic ruby & gem information"
51
52
  # Diagnostic ruby & gem information
52
53
  - 'which ruby && ruby --version || :'
53
54
  - "[[ $- == *i* ]] && echo 'Interactive shell session' || echo 'Non-interactive shell session'"
54
55
  - "shopt -q login_shell && echo 'Login shell' || echo 'Not a login shell'"
55
56
  - 'rvm ls || :'
57
+ - echo -e "\e[0Ksection_end:`date +%s`:before_script10\r\e[0K"
56
58
 
57
59
  # If RVM is available, make SURE it's using the right Ruby:
58
60
  # * Source rvm (to run in non-login shells)
@@ -64,22 +66,40 @@ variables:
64
66
  - "command -v rvm && { LATEST_RVM_RUBY_XY=\"$(rvm ls | grep \"$MATRIX_RUBY_VERSION\" | tail -1 | sed -e 's/^.*\\([0-9]\\+\\.[0-9]\\+\\.[0-9]\\+\\).*$/\\1/g')\"; if [ -z \"$LATEST_RVM_RUBY_XY\" ]; then LATEST_RVM_RUBY_XY=\"${MATRIX_RUBY_VERSION}-head\"; rvm install \"$LATEST_RVM_RUBY\" --no-docs; else echo \"Found RVM Ruby: '${LATEST_RVM_RUBY_XY}'\"; fi; rvm use \"$LATEST_RVM_RUBY_XY\" ; }"
65
67
  - 'ruby --version || :'
66
68
  - 'gem list sync || :'
69
+ - echo -e "\e[0Ksection_end:`date +%s`:before_script20\r\e[0K"
67
70
 
68
71
  # Bundle gems (preferring cached > local > downloaded resources)
69
72
  # * Try to use cached and local resources before downloading dependencies
70
- - 'declare GEM_BUNDLER_VER=(-v "~> ${BUNDLER_VERSION:-1.17.1}")'
73
+ - echo -e "\e[0Ksection_start:`date +%s`:before_script30[collapsed=true]\r\e[0KBundle gems (preferring cached > local > downloaded resources)"
74
+ - 'declare GEM_BUNDLER_VER=(-v "~> ${BUNDLER_VERSION:-2.2.6}")'
71
75
  - 'declare GEM_INSTALL_CMD=(gem install --no-document)'
72
76
  - 'declare BUNDLER_INSTALL_CMD=(bundle install --no-binstubs --jobs $(nproc) "${FLAGS[@]}")'
73
77
  - 'mkdir -p ${GEM_HOME} ${BUNDLER_BIN}'
74
78
  - 'gem list -ie "${GEM_BUNDLER_VER[@]}" --silent bundler || "${GEM_INSTALL_CMD[@]}" --local "${GEM_BUNDLER_VER[@]}" bundler || "${GEM_INSTALL_CMD[@]}" "${GEM_BUNDLER_VER[@]}" bundler'
75
79
  - 'rm -rf pkg/ || :'
76
80
  - 'bundle check || rm -f Gemfile.lock && ("${BUNDLER_INSTALL_CMD[@]}" --local || "${BUNDLER_INSTALL_CMD[@]}" || bundle pristine || "${BUNDLER_INSTALL_CMD[@]}") || { echo "PIPELINE: Bundler could not install everything (see log output above)" && exit 99 ; }'
81
+ - echo -e "\e[0Ksection_end:`date +%s`:before_script30\r\e[0K"
77
82
 
78
83
  # Diagnostic bundler, ruby, and gem checks:
84
+ - echo -e "\e[0Ksection_start:`date +%s`:before_script40[collapsed=true]\r\e[0KDiagnostic bundler, ruby, and gem checks"
79
85
  - 'bundle exec rvm ls || :'
80
86
  - 'bundle exec which ruby || :'
81
87
  - 'bundle show sync || :'
82
88
  - 'bundle exec gem list sync || :'
89
+ - echo -e "\e[0Ksection_end:`date +%s`:before_script40\r\e[0K"
90
+
91
+ # bundler dependencies and caching
92
+ #
93
+ # - Cache bundler gems between pipelines foreach Ruby version
94
+ # - Try to use cached and local resources before downloading dependencies
95
+ # --------------------------------------
96
+ .setup_bundler_env: &setup_bundler_env
97
+ cache:
98
+ key: "${CI_PROJECT_NAMESPACE}_ruby-${MATRIX_RUBY_VERSION}_bundler"
99
+ paths:
100
+ - '.vendor'
101
+ before_script:
102
+ !reference [.snippets, before]
83
103
 
84
104
 
85
105
  # Assign a matrix level when your test will run. Heavier jobs get higher numbers
@@ -219,7 +239,7 @@ variables:
219
239
  .pup_6_pe: &pup_6_pe
220
240
  image: 'ruby:2.5'
221
241
  variables:
222
- PUPPET_VERSION: '6.18.0'
242
+ PUPPET_VERSION: '6.22.1'
223
243
  BEAKER_PUPPET_COLLECTION: 'puppet6'
224
244
  MATRIX_RUBY_VERSION: '2.5'
225
245
 
@@ -250,17 +270,27 @@ variables:
250
270
  script:
251
271
  - 'bundle exec rake spec'
252
272
 
273
+ .beaker: &beaker
274
+ image: ruby:2.7.2 # must be 2.7.2 if running in GCP
275
+ tags:
276
+ - beaker
277
+ before_script:
278
+ - !reference [.snippets, before_beaker_google]
279
+ - !reference [.snippets, before]
280
+
281
+
282
+
253
283
  .acceptance_base: &acceptance_base
254
284
  stage: 'acceptance'
255
- tags: ['beaker']
256
285
  <<: *setup_bundler_env
257
286
  <<: *with_SIMP_ACCEPTANCE_MATRIX_LEVEL_1
287
+ <<: *beaker
258
288
 
259
289
  .compliance_base: &compliance_base
260
290
  stage: 'compliance'
261
- tags: ['beaker']
262
291
  <<: *setup_bundler_env
263
292
  <<: *with_SIMP_ACCEPTANCE_MATRIX_LEVEL_1
293
+ <<: *beaker
264
294
 
265
295
 
266
296
  # Unit Tests
data/.rubocop.yml CHANGED
@@ -13,7 +13,7 @@ AllCops:
13
13
  - Rakefile
14
14
  - Guardfile
15
15
  - Vagrantfile
16
- Lint/ConditionPosition:
16
+ Layout/ConditionPosition:
17
17
  Enabled: True
18
18
 
19
19
  Lint/ElseLayout:
@@ -22,13 +22,13 @@ Lint/ElseLayout:
22
22
  Lint/UnreachableCode:
23
23
  Enabled: True
24
24
 
25
- Lint/UselessComparison:
25
+ Lint/BinaryOperatorWithIdenticalOperands:
26
26
  Enabled: True
27
27
 
28
28
  Lint/EnsureReturn:
29
29
  Enabled: True
30
30
 
31
- Lint/HandleExceptions:
31
+ Lint/SuppressedException:
32
32
  Enabled: True
33
33
 
34
34
  Lint/LiteralAsCondition:
@@ -84,13 +84,13 @@ Lint/AmbiguousRegexpLiteral:
84
84
  Security/Eval:
85
85
  Enabled: True
86
86
 
87
- Lint/BlockAlignment:
87
+ Layout/BlockAlignment:
88
88
  Enabled: True
89
89
 
90
- Lint/DefEndAlignment:
90
+ Layout/DefEndAlignment:
91
91
  Enabled: True
92
92
 
93
- Lint/EndAlignment:
93
+ Layout/EndAlignment:
94
94
  Enabled: True
95
95
 
96
96
  Lint/DeprecatedClassMethods:
@@ -105,7 +105,7 @@ Lint/ParenthesesAsGroupedExpression:
105
105
  Lint/RescueException:
106
106
  Enabled: True
107
107
 
108
- Lint/StringConversionInInterpolation:
108
+ Lint/RedundantStringCoercion:
109
109
  Enabled: True
110
110
 
111
111
  Lint/UnusedBlockArgument:
@@ -132,13 +132,13 @@ Naming/AccessorMethodName:
132
132
  Style/Alias:
133
133
  Enabled: True
134
134
 
135
- Layout/AlignArray:
135
+ Layout/ArrayAlignment:
136
136
  Enabled: True
137
137
 
138
- Layout/AlignHash:
138
+ Layout/HashAlignment:
139
139
  Enabled: True
140
140
 
141
- Layout/AlignParameters:
141
+ Layout/ParameterAlignment:
142
142
  Enabled: True
143
143
 
144
144
  Metrics/BlockNesting:
@@ -150,9 +150,6 @@ Style/AsciiComments:
150
150
  Style/Attr:
151
151
  Enabled: True
152
152
 
153
- Style/BracesAroundHashParameters:
154
- Enabled: True
155
-
156
153
  Style/CaseEquality:
157
154
  Enabled: True
158
155
 
@@ -187,16 +184,16 @@ Style/WhenThen:
187
184
  Style/WordArray:
188
185
  Enabled: True
189
186
 
190
- Style/UnneededPercentQ:
187
+ Style/RedundantPercentQ:
191
188
  Enabled: True
192
189
 
193
- Layout/Tab:
190
+ Layout/IndentationStyle:
194
191
  Enabled: True
195
192
 
196
193
  Layout/SpaceBeforeSemicolon:
197
194
  Enabled: True
198
195
 
199
- Layout/TrailingBlankLines:
196
+ Layout/TrailingEmptyLines:
200
197
  Enabled: True
201
198
 
202
199
  Layout/SpaceInsideBlockBraces:
@@ -281,10 +278,10 @@ Style/EachWithObject:
281
278
  Layout/EmptyLineBetweenDefs:
282
279
  Enabled: True
283
280
 
284
- Layout/IndentArray:
281
+ Layout/FirstArrayElementIndentation:
285
282
  Enabled: True
286
283
 
287
- Layout/IndentHash:
284
+ Layout/FirstHashElementIndentation:
288
285
  Enabled: True
289
286
 
290
287
  Layout/IndentationConsistency:
@@ -306,7 +303,7 @@ Style/EmptyLiteral:
306
303
  Layout/TrailingWhitespace:
307
304
  Enabled: True
308
305
 
309
- Metrics/LineLength:
306
+ Layout/LineLength:
310
307
  Enabled: False
311
308
 
312
309
  Naming/BinaryOperatorParameterName:
@@ -331,7 +328,10 @@ Style/StringLiterals:
331
328
  Style/TrailingCommaInArguments:
332
329
  Enabled: True
333
330
 
334
- Style/TrailingCommaInLiteral:
331
+ Style/TrailingCommaInArrayLiteral:
332
+ Enabled: True
333
+
334
+ Style/TrailingCommaInHashLiteral:
335
335
  Enabled: True
336
336
 
337
337
  Style/GlobalVars:
@@ -497,9 +497,6 @@ Metrics/AbcSize:
497
497
  Metrics/PerceivedComplexity:
498
498
  Enabled: False
499
499
 
500
- Lint/UselessAssignment:
501
- Enabled: True
502
-
503
500
  Layout/ClosingParenthesisIndentation:
504
501
  Enabled: True
505
502
 
@@ -529,7 +526,7 @@ RSpec/NestedGroups:
529
526
  Enabled: False
530
527
 
531
528
  # this is broken on ruby1.9
532
- Layout/IndentHeredoc:
529
+ Layout/HeredocIndentation:
533
530
  Enabled: False
534
531
 
535
532
  # disable Yaml safe_load. This is needed to support ruby2.0.0 development envs
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ### 1.29.0 / 2022-10-25
2
+ * Fixed:
3
+ * Compress fixtures before copy to Windows nodes
4
+
5
+ ### 1.28.0 / 2022-08-05
6
+ * Added:
7
+ * Support RHEL versions without RHN credentials
8
+ * Supports pay-as-you-go cloud services
9
+
1
10
  ### 1.27.0 / 2022-07-30
2
11
  * Added:
3
12
  * Add EPEL support for Amazon, Rocky, and Alma distributions
@@ -1,5 +1,5 @@
1
1
  module Simp; end
2
2
 
3
3
  module Simp::BeakerHelpers
4
- VERSION = '1.27.0'
4
+ VERSION = '1.29.0'
5
5
  end
@@ -11,6 +11,7 @@ module Simp::BeakerHelpers
11
11
  require 'simp/beaker_helpers/snapshot'
12
12
  require 'simp/beaker_helpers/ssg'
13
13
  require 'simp/beaker_helpers/version'
14
+ require 'find'
14
15
 
15
16
  @run_in_parallel = (ENV['BEAKER_SIMP_parallel'] == 'yes')
16
17
 
@@ -395,14 +396,44 @@ module Simp::BeakerHelpers
395
396
  Dir.chdir(mod_root) do
396
397
  # Have to do things the slow way on Windows
397
398
  if is_windows?(sut)
398
- Dir.glob('*') do |module_dir|
399
- if File.directory?(module_dir)
400
- copy_module_to( sut, {
401
- :source => module_dir,
402
- :module_name => module_dir,
403
- :target_module_path => target_module_path
404
- })
399
+ begin
400
+ zipfile = "#{Simp::BeakerHelpers.tmpname}.zip"
401
+ files = []
402
+
403
+ # 'zip -x' does not reliably exclude paths, so we need to remove them from
404
+ # the list of files to zip
405
+ Dir.glob('*') do |module_root|
406
+ next unless Dir.exist?(module_root)
407
+ Find.find("#{module_root}/") do |path|
408
+ if PUPPET_MODULE_INSTALL_IGNORE.any? { |ignore| path.include?(ignore) }
409
+ Find.prune
410
+ next
411
+ end
412
+
413
+ files << path
414
+ end
415
+ end
416
+
417
+ command = ['zip', zipfile] + files
418
+ Kernel.system(*command)
419
+
420
+ raise("Error: module zip file '#{zipfile}' could not be created at #{mod_root}") unless File.exist?(zipfile)
421
+ copy_to(sut, zipfile, target_module_path, opts)
422
+
423
+ # Windows 2012 and R2 does not natively include PowerShell 5, in which
424
+ # the Expand-Archive cmdlet was introduced
425
+ if fact_on(sut, 'os.release.major').include?('2012')
426
+ unzip_cmd = [
427
+ "\"[System.Reflection.Assembly]::LoadWithPartialName(\'System.IO.Compression.FileSystem\')",
428
+ "[System.IO.Compression.ZipFile]::OpenRead(\'#{target_module_path}\\#{File.basename(zipfile)}\').Entries.FullName \| %{Remove-Item -Path (\"\"\"#{target_module_path}\\$_\"\"\") -Recurse -Force -Confirm:$false -ErrorAction SilentlyContinue}", # rubocop:disable Layout/LineLength
429
+ "[System.IO.Compression.ZipFile]::ExtractToDirectory(\'#{target_module_path}\\#{File.basename(zipfile)}\', \'#{target_module_path}\')\"",
430
+ ].join(';')
431
+ else
432
+ unzip_cmd = "$ProgressPreference='SilentlyContinue';Expand-Archive -Path #{target_module_path}\\#{File.basename(zipfile)} -DestinationPath #{target_module_path} -Force"
405
433
  end
434
+ on(sut, powershell(unzip_cmd))
435
+ ensure
436
+ FileUtils.remove_entry(zipfile, true)
406
437
  end
407
438
  else
408
439
  begin
@@ -643,7 +674,7 @@ module Simp::BeakerHelpers
643
674
  "https://dl.fedoraproject.org/pub/epel/epel-release-latest-#{os_maj_rel}.noarch.rpm",
644
675
  )
645
676
 
646
- if os_info['name'] == 'RedHat'
677
+ if os_info['name'] == 'RedHat' && ENV['BEAKER_RHSM_USER'] && ENV['BEAKER_RHSM_PASS']
647
678
  if os_maj_rel == '7'
648
679
  on sut, %{subscription-manager repos --enable "rhel-*-optional-rpms"}
649
680
  on sut, %{subscription-manager repos --enable "rhel-*-extras-rpms"}
@@ -836,7 +867,8 @@ module Simp::BeakerHelpers
836
867
 
837
868
  if os == 'RedHat'
838
869
  unless rhsm_opts[:username] && rhsm_opts[:password]
839
- fail("You must set BEAKER_RHSM_USER and BEAKER_RHSM_PASS environment variables to register RHEL systems")
870
+ warn("BEAKER_RHSM_USER and/or BEAKER_RHSM_PASS not set on RHEL system.", "Assuming that subscription-manager is not needed. This may prevent packages from installing")
871
+ return
840
872
  end
841
873
 
842
874
  sub_status = on(sut, 'subscription-manager status', :accept_all_exit_codes => true)
@@ -874,24 +906,30 @@ module Simp::BeakerHelpers
874
906
  end
875
907
 
876
908
  def rhel_repo_enable(suts, repos)
877
- block_on(suts, :run_in_parallel => @run_in_parallel) do |sut|
878
- Array(repos).each do |repo|
879
- on(sut, %{subscription-manager repos --enable #{repo}})
909
+ if ENV['BEAKER_RHSM_USER'] && ENV['BEAKER_RHSM_PASS']
910
+ block_on(suts, :run_in_parallel => @run_in_parallel) do |sut|
911
+ Array(repos).each do |repo|
912
+ on(sut, %{subscription-manager repos --enable #{repo}})
913
+ end
880
914
  end
881
915
  end
882
916
  end
883
917
 
884
918
  def rhel_repo_disable(suts, repos)
885
- block_on(suts, :run_in_parallel => @run_in_parallel) do |sut|
886
- Array(repos).each do |repo|
887
- on(sut, %{subscription-manager repos --disable #{repo}}, :accept_all_exit_codes => true)
919
+ if ENV['BEAKER_RHSM_USER'] && ENV['BEAKER_RHSM_PASS']
920
+ block_on(suts, :run_in_parallel => @run_in_parallel) do |sut|
921
+ Array(repos).each do |repo|
922
+ on(sut, %{subscription-manager repos --disable #{repo}}, :accept_all_exit_codes => true)
923
+ end
888
924
  end
889
925
  end
890
926
  end
891
927
 
892
928
  def rhel_rhsm_unsubscribe(suts)
893
- block_on(suts, :run_in_parallel => @run_in_parallel) do |sut|
894
- on(sut, %{subscription-manager unregister}, :accept_all_exit_codes => true)
929
+ if ENV['BEAKER_RHSM_USER'] && ENV['BEAKER_RHSM_PASS']
930
+ block_on(suts, :run_in_parallel => @run_in_parallel) do |sut|
931
+ on(sut, %{subscription-manager unregister}, :accept_all_exit_codes => true)
932
+ end
895
933
  end
896
934
  end
897
935
 
@@ -1,34 +1,27 @@
1
- <%
2
- if ENV['BEAKER_HYPERVISOR']
3
- hypervisor = ENV['BEAKER_HYPERVISOR']
4
- else
5
- hypervisor = 'vagrant'
6
- end
7
- -%>
1
+ ---
8
2
  HOSTS:
9
3
  el7:
10
4
  roles:
11
- - default
12
- - el7
5
+ - default
6
+ - el7
13
7
  platform: el-7-x86_64
14
8
  box: centos/7
15
- hypervisor: <%= hypervisor %>
16
-
9
+ hypervisor: "<%= ENV.fetch('BEAKER_HYPERVISOR', 'vagrant') %>"
10
+ family: centos-cloud/centos-7
11
+ gce_machine_type: n1-standard-2
17
12
  el8:
18
13
  roles:
19
- - el8
14
+ - el8
20
15
  platform: el-8-x86_64
21
16
  box: centos/stream8
22
- hypervisor: <%= hypervisor %>
23
-
17
+ hypervisor: "<%= ENV.fetch('BEAKER_HYPERVISOR', 'vagrant') %>"
18
+ family: centos-cloud/centos-stream-8
19
+ gce_machine_type: n1-standard-2
24
20
  CONFIG:
25
- multi_node: <%= ['yes','true'].include?(ENV['BEAKER_multi_node']) ? true : false %>
21
+ multi_node: false
26
22
  log_level: verbose
27
23
  type: aio
28
24
  vagrant_cpus: 2
29
- <% if ENV['BEAKER_PUPPET_COLLECTION'] -%>
30
- puppet_collection: <%= ENV['BEAKER_PUPPET_COLLECTION'] %>
31
- <% end -%>
32
25
  ssh:
33
26
  keepalive: true
34
27
  keepalive_interval: 10
@@ -40,3 +33,4 @@ CONFIG:
40
33
  - <%= Net::SSH::Transport::Algorithms::ALGORITHMS[:encryption].join("\n#{' '*6}- ") %>
41
34
  hmac:
42
35
  - <%= Net::SSH::Transport::Algorithms::ALGORITHMS[:hmac].join("\n#{' '*6}- ") %>
36
+ puppet_collection: "<%= ENV.fetch('BEAKER_PUPPET_COLLECTION', 'puppet7') %>"
@@ -6,15 +6,15 @@ HOSTS:
6
6
  platform: el-7-x86_64
7
7
  hypervisor: docker
8
8
  image: simpproject/simp_beaker_el7
9
- docker_cmd: '["/sbin/init"]'
10
-
9
+ docker_cmd: '/usr/sbin/sshd -D -E /var/log/sshd.log'
10
+
11
11
  el8.test.net:
12
12
  roles:
13
13
  - el8
14
14
  platform: el-8-x86_64
15
15
  hypervisor: docker
16
16
  image: simpproject/simp_beaker_el8
17
- docker_cmd: '["/sbin/init"]'
17
+ docker_cmd: '/usr/sbin/sshd -D -E /var/log/sshd.log'
18
18
 
19
19
  CONFIG:
20
20
  log_level: verbose
@@ -1,21 +1,14 @@
1
- <%
2
- if ENV['BEAKER_HYPERVISOR']
3
- hypervisor = ENV['BEAKER_HYPERVISOR']
4
- else
5
- hypervisor = 'vagrant'
6
- end
7
- -%>
1
+ ---
8
2
  HOSTS:
9
3
  focal:
10
4
  roles:
11
- - default
5
+ - default
12
6
  platform: ubuntu-20.04-x86_64
13
7
  box: ubuntu/focal64
14
- hypervisor: <%= hypervisor %>
15
-
8
+ hypervisor: "<%= ENV.fetch('BEAKER_HYPERVISOR', 'vagrant') %>"
9
+ family: ubuntu-os-cloud/ubuntu-2004-lts
10
+ gce_machine_type: n1-standard-2
16
11
  CONFIG:
17
12
  log_level: verbose
18
13
  type: aio
19
- <% if ENV['BEAKER_PUPPET_COLLECTION'] -%>
20
- puppet_collection: <%= ENV['BEAKER_PUPPET_COLLECTION'] %>
21
- <% end -%>
14
+ puppet_collection: "<%= ENV.fetch('BEAKER_PUPPET_COLLECTION', 'puppet7') %>"
@@ -1,34 +1,26 @@
1
- <%
2
- if ENV['BEAKER_HYPERVISOR']
3
- hypervisor = ENV['BEAKER_HYPERVISOR']
4
- else
5
- hypervisor = 'vagrant'
6
- end
7
- -%>
1
+ ---
8
2
  HOSTS:
9
3
  win:
10
4
  roles:
11
- - windows
5
+ - windows
12
6
  platform: windows-server-amd64
13
- box: devopsgroup-io/windows_server-2012r2-standard-amd64-nocm
14
- hypervisor: <%= hypervisor %>
7
+ box: gusztavvargadr/windows-server
8
+ hypervisor: "<%= ENV.fetch('BEAKER_HYPERVISOR', 'vagrant') %>"
15
9
  vagrant_memsize: 2048
16
10
  vagrant_cpus: 2
17
11
  user: vagrant
18
12
  is_cygwin: false
19
- ssh:
20
- host_key: ssh-dss
21
-
13
+ family: windows-cloud/windows-2022
14
+ gce_machine_type: n1-standard-2
22
15
  el7:
23
16
  roles:
24
- - default
17
+ - default
25
18
  platform: el-7-x86_64
26
19
  box: centos/7
27
- hypervisor: <%= hypervisor %>
28
-
20
+ hypervisor: "<%= ENV.fetch('BEAKER_HYPERVISOR', 'vagrant') %>"
21
+ family: centos-cloud/centos-7
22
+ gce_machine_type: n1-standard-2
29
23
  CONFIG:
30
24
  log_level: verbose
31
25
  type: aio
32
- <% if ENV['BEAKER_PUPPET_ENVIRONMENT'] -%>
33
- puppet_environment: <%= ENV['BEAKER_PUPPET_ENVIRONMENT'] %>
34
- <% end -%>
26
+ puppet_collection: "<%= ENV.fetch('BEAKER_PUPPET_COLLECTION', 'puppet7') %>"
@@ -0,0 +1,28 @@
1
+ ---
2
+ HOSTS:
3
+ win:
4
+ roles:
5
+ - windows
6
+ platform: windows-server-amd64
7
+ box: devopsgroup-io/windows_server-2012r2-standard-amd64-nocm
8
+ hypervisor: "<%= ENV.fetch('BEAKER_HYPERVISOR', 'vagrant') %>"
9
+ vagrant_memsize: 2048
10
+ vagrant_cpus: 2
11
+ user: vagrant
12
+ is_cygwin: false
13
+ ssh:
14
+ host_key: ssh-dss
15
+ family: windows-cloud/windows-2012-r2
16
+ gce_machine_type: n1-standard-2
17
+ el7:
18
+ roles:
19
+ - default
20
+ platform: el-7-x86_64
21
+ box: centos/7
22
+ hypervisor: "<%= ENV.fetch('BEAKER_HYPERVISOR', 'vagrant') %>"
23
+ family: centos-cloud/centos-7
24
+ gce_machine_type: n1-standard-2
25
+ CONFIG:
26
+ log_level: verbose
27
+ type: aio
28
+ puppet_collection: "<%= ENV.fetch('BEAKER_PUPPET_COLLECTION', 'puppet7') %>"
@@ -1,34 +1,27 @@
1
- <%
2
- if ENV['BEAKER_HYPERVISOR']
3
- hypervisor = ENV['BEAKER_HYPERVISOR']
4
- else
5
- hypervisor = 'vagrant'
6
- end
7
- -%>
1
+ ---
8
2
  HOSTS:
9
3
  win:
10
4
  roles:
11
- - windows
5
+ - windows
12
6
  platform: windows-server-amd64
13
- box: gusztavvargadr/windows-server
14
- box_version: 1607.0.1909
15
- hypervisor: <%= hypervisor %>
7
+ box: peru/windows-server-2016-standard-x64-eval
8
+ hypervisor: "<%= ENV.fetch('BEAKER_HYPERVISOR', 'vagrant') %>"
16
9
  vagrant_memsize: 2048
17
10
  vagrant_cpus: 2
18
11
  user: vagrant
19
12
  communicator: winrm
20
13
  is_cygwin: false
21
-
14
+ family: windows-cloud/windows-2016
15
+ gce_machine_type: n1-standard-2
22
16
  el7:
23
17
  roles:
24
- - default
18
+ - default
25
19
  platform: el-7-x86_64
26
20
  box: centos/7
27
- hypervisor: <%= hypervisor %>
28
-
21
+ hypervisor: "<%= ENV.fetch('BEAKER_HYPERVISOR', 'vagrant') %>"
22
+ family: centos-cloud/centos-7
23
+ gce_machine_type: n1-standard-2
29
24
  CONFIG:
30
25
  log_level: verbose
31
26
  type: aio
32
- <% if ENV['BEAKER_PUPPET_ENVIRONMENT'] -%>
33
- puppet_environment: <%= ENV['BEAKER_PUPPET_ENVIRONMENT'] %>
34
- <% end -%>
27
+ puppet_collection: "<%= ENV.fetch('BEAKER_PUPPET_COLLECTION', 'puppet7') %>"
@@ -1,33 +1,27 @@
1
- <%
2
- if ENV['BEAKER_HYPERVISOR']
3
- hypervisor = ENV['BEAKER_HYPERVISOR']
4
- else
5
- hypervisor = 'vagrant'
6
- end
7
- -%>
1
+ ---
8
2
  HOSTS:
9
3
  win:
10
4
  roles:
11
- - windows
5
+ - windows
12
6
  platform: windows-server-amd64
13
7
  box: gusztavvargadr/windows-server
14
- hypervisor: <%= hypervisor %>
8
+ box_version: "~> 1809"
9
+ hypervisor: "<%= ENV.fetch('BEAKER_HYPERVISOR', 'vagrant') %>"
15
10
  vagrant_memsize: 2048
16
11
  vagrant_cpus: 2
17
12
  user: vagrant
18
- communicator: winrm
19
13
  is_cygwin: false
20
-
14
+ family: windows-cloud/windows-2019
15
+ gce_machine_type: n1-standard-2
21
16
  el7:
22
17
  roles:
23
- - default
18
+ - default
24
19
  platform: el-7-x86_64
25
20
  box: centos/7
26
- hypervisor: <%= hypervisor %>
27
-
21
+ hypervisor: "<%= ENV.fetch('BEAKER_HYPERVISOR', 'vagrant') %>"
22
+ family: centos-cloud/centos-7
23
+ gce_machine_type: n1-standard-2
28
24
  CONFIG:
29
25
  log_level: verbose
30
26
  type: aio
31
- <% if ENV['BEAKER_PUPPET_ENVIRONMENT'] -%>
32
- puppet_environment: <%= ENV['BEAKER_PUPPET_ENVIRONMENT'] %>
33
- <% end -%>
27
+ puppet_collection: "<%= ENV.fetch('BEAKER_PUPPET_COLLECTION', 'puppet7') %>"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simp-beaker-helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.27.0
4
+ version: 1.29.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Tessmer
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-07-30 00:00:00.000000000 Z
12
+ date: 2023-04-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: beaker
@@ -224,6 +224,7 @@ files:
224
224
  - spec/acceptance/suites/windows/00_default_spec.rb
225
225
  - spec/acceptance/suites/windows/metadata.yml
226
226
  - spec/acceptance/suites/windows/nodesets/default.yml
227
+ - spec/acceptance/suites/windows/nodesets/win2012.yml
227
228
  - spec/acceptance/suites/windows/nodesets/win2016.yml
228
229
  - spec/acceptance/suites/windows/nodesets/win2019.yml
229
230
  - spec/fixtures/inspec_profiles/CentOS-7-disa_stig