beaker 5.8.1 → 6.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/.rspec +0 -1
  3. data/.rubocop.yml +4 -4
  4. data/.rubocop_todo.yml +15 -17
  5. data/CHANGELOG.md +31 -1
  6. data/Rakefile +2 -10
  7. data/acceptance/fixtures/module/spec/acceptance/demo_spec.rb +6 -6
  8. data/acceptance/tests/base/host/packages.rb +0 -2
  9. data/acceptance/tests/base/host_prebuilt_steps/ssh_environment_test.rb +1 -1
  10. data/beaker.gemspec +1 -1
  11. data/docs/concepts/argument_processing_and_precedence.md +1 -1
  12. data/lib/beaker/command.rb +1 -5
  13. data/lib/beaker/host/unix/exec.rb +8 -10
  14. data/lib/beaker/host/unix/file.rb +4 -13
  15. data/lib/beaker/host/unix/pkg.rb +12 -21
  16. data/lib/beaker/host/unix.rb +0 -12
  17. data/lib/beaker/host.rb +0 -6
  18. data/lib/beaker/host_prebuilt_steps.rb +13 -23
  19. data/lib/beaker/network_manager.rb +0 -1
  20. data/lib/beaker/options/command_line_parser.rb +1 -1
  21. data/lib/beaker/options/parser.rb +2 -2
  22. data/lib/beaker/perf.rb +3 -3
  23. data/lib/beaker/platform.rb +3 -31
  24. data/lib/beaker/version.rb +1 -1
  25. data/spec/beaker/host/unix/exec_spec.rb +6 -22
  26. data/spec/beaker/host/unix/file_spec.rb +3 -31
  27. data/spec/beaker/host/unix/pkg_spec.rb +26 -41
  28. data/spec/beaker/host/unix_spec.rb +0 -8
  29. data/spec/beaker/host_prebuilt_steps_spec.rb +11 -71
  30. data/spec/beaker/options/parser_spec.rb +0 -1
  31. data/spec/beaker/platform_spec.rb +20 -50
  32. data/spec/helpers.rb +13 -28
  33. metadata +4 -20
  34. data/acceptance/fixtures/module/spec/acceptance/nodesets/fedora-18-x64.yml +0 -10
  35. data/acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-fedora-20-i386.repo +0 -6
  36. data/acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-fedora-20-x86_64.repo +0 -6
  37. data/acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-fedora-21-i386.repo +0 -6
  38. data/acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-fedora-21-x86_64.repo +0 -6
  39. data/acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-fedora-22-i386.repo +0 -6
  40. data/acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-fedora-22-x86_64.repo +0 -6
  41. data/acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-fedora-23-i386.repo +0 -6
  42. data/acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-fedora-23-x86_64.repo +0 -6
  43. data/acceptance/fixtures/package/rpm/pl-puppetserver-latest-repos-pe-fedora-24-x86_64.repo +0 -6
  44. data/docs/how_to/hosts/cisco.md +0 -40
  45. data/docs/how_to/hosts/eos.md +0 -11
  46. data/lib/beaker/host/cisco.rb +0 -159
  47. data/lib/beaker/host/eos.rb +0 -33
  48. data/spec/beaker/host/cisco_spec.rb +0 -332
  49. data/spec/beaker/host/eos_spec.rb +0 -44
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 747514fd1bc4b06447745e41139acb933595b96b683c721abc95239b94e142e3
4
- data.tar.gz: bcd6d4cfe1c4b98af67ed652598829d0075b364d0a0dd6035087536f2a77d36d
3
+ metadata.gz: a57ed9140c38bb9b99f44eccf0f30a892213eb1e7014ded3cbb424bebc3ec26b
4
+ data.tar.gz: 25e1254d10f91d1deb9d28780cac16871b57ff570bd67978df38666a961592bc
5
5
  SHA512:
6
- metadata.gz: a9e791460368f7cf86d4bcbfacf0af5ca711d59d2943c0e93070468eb33793bd117dcf788b35eae1fa70a73a5e222522031b42ffc1bf416fc5b69f4efcfbf9e3
7
- data.tar.gz: 4daaa7c530f9053600ea808e490a7c930ab77e38d1097db5b6f2310d240198cffea7c7d15c239011157d2b1c2d19a611ab354b8b3e51c333422a5ac326363e9f
6
+ metadata.gz: a7d2bab439fbe31b20df6417453e66bb5e148489c605946c11f1f3ac2eb637c4bfe4a2d2ac81420866184c1fa491825e1918ae84c56f3b9c446aa0eae76d6d4c
7
+ data.tar.gz: 41b577a099d6441fe6c95d8fe8a6c6885ca9d8276ae09b1d98e2efa5f8a5c050f2e7e94313e10d3397c42e3fab8c792e93af1d47843812150dd5c6389afdc289
data/.rspec CHANGED
@@ -1,4 +1,3 @@
1
1
  --format documentation
2
2
  --color
3
3
  --tty
4
- --fail-fast
data/.rubocop.yml CHANGED
@@ -17,14 +17,11 @@ Naming/FileName:
17
17
  - acceptance/**/acceptance-options.rb
18
18
 
19
19
  Naming/MethodParameterName:
20
- Enabled: false
20
+ MinNameLength: 1
21
21
 
22
22
  Naming/PredicateName:
23
23
  Enabled: false
24
24
 
25
- Naming/VariableNumber:
26
- Enabled: false
27
-
28
25
  RSpec/DescribeClass:
29
26
  Exclude:
30
27
  - acceptance/fixtures/module/spec/**/*.rb
@@ -49,3 +46,6 @@ RSpec/NestedGroups:
49
46
 
50
47
  Style:
51
48
  Enabled: false
49
+
50
+ Naming/VariableNumber:
51
+ AllowedPatterns: ['x86_64']
data/.rubocop_todo.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2024-03-12 17:49:37 UTC using RuboCop version 1.62.1.
3
+ # on 2024-05-11 14:14:06 UTC using RuboCop version 1.62.1.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
@@ -92,14 +92,13 @@ Minitest/RefuteFalse:
92
92
  - 'acceptance/tests/base/dsl/helpers/host_helpers/check_for_package_test.rb'
93
93
  - 'acceptance/tests/base/host/host_test.rb'
94
94
 
95
- # Offense count: 20
95
+ # Offense count: 19
96
96
  # Configuration parameters: ForbiddenDelimiters.
97
97
  # ForbiddenDelimiters: (?i-mx:(^|\s)(EO[A-Z]{1}|END)(\s|$))
98
98
  Naming/HeredocDelimiterNaming:
99
99
  Exclude:
100
100
  - 'Rakefile'
101
101
  - 'acceptance/tests/base/dsl/helpers/hocon_helpers_test.rb'
102
- - 'lib/beaker/host/cisco.rb'
103
102
  - 'spec/beaker/host/mac/group_spec.rb'
104
103
  - 'spec/beaker/host/mac/user_spec.rb'
105
104
  - 'spec/beaker/host/pswindows/user_spec.rb'
@@ -144,7 +143,7 @@ RSpec/BeEq:
144
143
  - 'spec/beaker/subcommand/subcommand_util_spec.rb'
145
144
  - 'spec/beaker/test_suite_spec.rb'
146
145
 
147
- # Offense count: 121
146
+ # Offense count: 113
148
147
  # Configuration parameters: Prefixes, AllowedPatterns.
149
148
  # Prefixes: when, with, without
150
149
  RSpec/ContextWording:
@@ -156,7 +155,7 @@ RSpec/Eq:
156
155
  Exclude:
157
156
  - 'spec/beaker/logger_spec.rb'
158
157
 
159
- # Offense count: 241
158
+ # Offense count: 231
160
159
  # Configuration parameters: CountAsOne.
161
160
  RSpec/ExampleLength:
162
161
  Max: 44
@@ -214,13 +213,13 @@ RSpec/MultipleDescribes:
214
213
  RSpec/MultipleMemoizedHelpers:
215
214
  Max: 18
216
215
 
217
- # Offense count: 502
216
+ # Offense count: 495
218
217
  # Configuration parameters: EnforcedStyle, IgnoreSharedExamples.
219
218
  # SupportedStyles: always, named_only
220
219
  RSpec/NamedSubject:
221
220
  Enabled: false
222
221
 
223
- # Offense count: 42
222
+ # Offense count: 41
224
223
  # Configuration parameters: AllowedPatterns.
225
224
  # AllowedPatterns: ^expect_, ^assert_
226
225
  RSpec/NoExpectationExample:
@@ -231,12 +230,6 @@ RSpec/NoExpectationExample:
231
230
  - 'spec/beaker/logger_spec.rb'
232
231
  - 'spec/beaker/options/subcommand_options_parser_spec.rb'
233
232
 
234
- # Offense count: 1
235
- # This cop supports safe autocorrection (--autocorrect).
236
- RSpec/Rails/MinitestAssertions:
237
- Exclude:
238
- - 'spec/beaker/dsl/structure_spec.rb'
239
-
240
233
  # Offense count: 60
241
234
  # This cop supports unsafe autocorrection (--autocorrect-all).
242
235
  RSpec/ReceiveMessages:
@@ -251,11 +244,10 @@ RSpec/ReceiveMessages:
251
244
  - 'spec/beaker/test_suite_spec.rb'
252
245
  - 'spec/helpers.rb'
253
246
 
254
- # Offense count: 7
247
+ # Offense count: 4
255
248
  RSpec/RepeatedDescription:
256
249
  Exclude:
257
250
  - 'spec/beaker/cli_spec.rb'
258
- - 'spec/beaker/host/unix/exec_spec.rb'
259
251
  - 'spec/beaker/host/unix/pkg_spec.rb'
260
252
 
261
253
  # Offense count: 4
@@ -284,7 +276,7 @@ RSpec/SpecFilePathFormat:
284
276
  - 'spec/beaker/host/windows/user_spec.rb'
285
277
  - 'spec/beaker/host_prebuilt_steps_spec.rb'
286
278
 
287
- # Offense count: 178
279
+ # Offense count: 175
288
280
  RSpec/SubjectStub:
289
281
  Exclude:
290
282
  - 'spec/beaker/dsl/assertions_spec.rb'
@@ -314,6 +306,12 @@ RSpec/UnspecifiedException:
314
306
  RSpec/VerifiedDoubles:
315
307
  Enabled: false
316
308
 
309
+ # Offense count: 1
310
+ # This cop supports safe autocorrection (--autocorrect).
311
+ RSpecRails/MinitestAssertions:
312
+ Exclude:
313
+ - 'spec/beaker/dsl/structure_spec.rb'
314
+
317
315
  # Offense count: 2
318
316
  # This cop supports safe autocorrection (--autocorrect).
319
317
  Rake/Desc:
@@ -336,7 +334,7 @@ Security/Open:
336
334
  Exclude:
337
335
  - 'lib/beaker/dsl/helpers/web_helpers.rb'
338
336
 
339
- # Offense count: 106
337
+ # Offense count: 104
340
338
  # This cop supports safe autocorrection (--autocorrect).
341
339
  # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
342
340
  # URISchemes: http, https
data/CHANGELOG.md CHANGED
@@ -1,10 +1,40 @@
1
1
  # Changelog
2
2
 
3
+ ## [6.1.0](https://github.com/voxpupuli/beaker/tree/6.1.0) (2024-06-04)
4
+
5
+ **Implemented enhancements:**
6
+
7
+ - Add package logic for Amazon Linux 2 [\#1887](https://github.com/voxpupuli/beaker/pull/1884) ([mhashizume](https://github.com/joshcooper))
8
+
9
+ ## [6.0.0](https://github.com/voxpupuli/beaker/tree/6.0.0) (2024-05-24)
10
+
11
+ **Breaking changes:**
12
+
13
+ - Drop EoL F5 support [\#1866](https://github.com/voxpupuli/beaker/pull/1866) ([bastelfreak](https://github.com/bastelfreak))
14
+ - Drop EoL cumulus support [\#1867](https://github.com/voxpupuli/beaker/pull/1867) ([bastelfreak](https://github.com/bastelfreak))
15
+ - drop sys-v leftovers; assume systemctl is available for unknown platforms [\#1868](https://github.com/voxpupuli/beaker/pull/1868) ([bastelfreak](https://github.com/bastelfreak))
16
+ - Drop EoL huaweios support [\#1869](https://github.com/voxpupuli/beaker/pull/1869) ([bastelfreak](https://github.com/bastelfreak))
17
+ - Drop EoL EL4 support [\#1870](https://github.com/voxpupuli/beaker/pull/1870) ([bastelfreak](https://github.com/bastelfreak))
18
+ - Drop support for EoL Debian/Ubuntu versions [\#1871](https://github.com/voxpupuli/beaker/pull/1871) ([bastelfreak](https://github.com/bastelfreak))
19
+ - Drop EoL cisco support [\#1872](https://github.com/voxpupuli/beaker/pull/1872) ([bastelfreak](https://github.com/bastelfreak))
20
+ - Drop Fedora < 22 support [\#1873](https://github.com/voxpupuli/beaker/pull/1873) ([ekohl](https://github.com/ekohl))
21
+ - Drop EoL Arista EOS support [\#1874](https://github.com/voxpupuli/beaker/pull/1874) ([bastelfreak](https://github.com/bastelfreak))
22
+ - drop validate_setup method [\#1875](https://github.com/voxpupuli/beaker/pull/1875) ([bastelfreak](https://github.com/bastelfreak))
23
+ - Drop EoL netscaler support [\#1876](https://github.com/voxpupuli/beaker/pull/1876) ([bastelfreak](https://github.com/bastelfreak))
24
+
25
+ **Implemented enhancements:**
26
+
27
+ - Add package logic for Amazon Linux 2 [\#1884](https://github.com/voxpupuli/beaker/pull/1884) ([mhashizume](https://github.com/mhashizume))
28
+
29
+ **Fixed bugs:**
30
+
31
+ - Add ssh restart for Ubuntu [\#1885](https://github.com/voxpupuli/beaker/pull/1885) ([skyamgarp](https://github.com/skyamgarp))
32
+
3
33
  ## [5.8.1](https://github.com/voxpupuli/beaker/tree/5.8.1) (2024-05-06)
4
34
 
5
35
  **Fixed bugs:**
6
36
 
7
- - Add extension parameter to parent tmpfile method signature [\#1863](https://github.com/voxpupuli/beaker/pull/1854) ([ekohl](https://github.com/ekohl))
37
+ - Add extension parameter to parent tmpfile method signature [\#1863](https://github.com/voxpupuli/beaker/pull/1863) ([ekohl](https://github.com/ekohl))
8
38
 
9
39
  ## [5.8.0](https://github.com/voxpupuli/beaker/tree/5.8.0) (2024-03-23)
10
40
 
data/Rakefile CHANGED
@@ -197,15 +197,7 @@ rescue LoadError
197
197
  end
198
198
 
199
199
  begin
200
- require 'rubocop/rake_task'
200
+ require 'voxpupuli/rubocop/rake'
201
201
  rescue LoadError
202
- # RuboCop is an optional group
203
- else
204
- RuboCop::RakeTask.new(:rubocop) do |task|
205
- # These make the rubocop experience maybe slightly less terrible
206
- task.options = ['--display-cop-names', '--display-style-guide', '--extra-details']
207
-
208
- # Use Rubocop's Github Actions formatter if possible
209
- task.formatters << 'github' if ENV['GITHUB_ACTIONS'] == 'true'
210
- end
202
+ # the voxpupuli-rubocop gem is optional
211
203
  end
@@ -22,15 +22,15 @@ describe "my tests" do
22
22
  end
23
23
 
24
24
  it "is able to apply manifests" do
25
- manifest_1 = "user {'foo':
25
+ manifest1 = "user {'foo':
26
26
  ensure => present,}"
27
- manifest_2 = "user {'foo':
27
+ manifest2 = "user {'foo':
28
28
  ensure => absent,}"
29
- manifest_3 = "user {'root':
29
+ manifest3 = "user {'root':
30
30
  ensure => present,}"
31
- apply_manifest(manifest_1, :expect_changes => true)
32
- apply_manifest(manifest_2, :expect_changes => true)
33
- apply_manifest(manifest_3)
31
+ apply_manifest(manifest1, :expect_changes => true)
32
+ apply_manifest(manifest2, :expect_changes => true)
33
+ apply_manifest(manifest3)
34
34
  end
35
35
 
36
36
  describe service('sshd') do
@@ -9,8 +9,6 @@ def get_host_pkg(host)
9
9
  Beaker::HostPrebuiltSteps::SLES_PACKAGES
10
10
  when /debian/
11
11
  Beaker::HostPrebuiltSteps::DEBIAN_PACKAGES
12
- when /cumulus/
13
- Beaker::HostPrebuiltSteps::CUMULUS_PACKAGES
14
12
  when /windows/
15
13
  host.is_cygwin? ? Beaker::HostPrebuiltSteps::WINDOWS_PACKAGES : Beaker::HostPrebuiltSteps::PSWINDOWS_PACKAGES
16
14
  when /freebsd/
@@ -1,5 +1,5 @@
1
1
  test_name "confirm host prebuilt steps behave correctly" do
2
- confine_block :except, :platform => /f5|windows/ do
2
+ confine_block :except, :platform => /windows/ do
3
3
  step "confirm ssh environment file existence" do
4
4
  hosts.each do |host|
5
5
  assert(host.file_exist?(host[:ssh_env_file]))
data/beaker.gemspec CHANGED
@@ -22,7 +22,7 @@ Gem::Specification.new do |s|
22
22
  s.add_development_dependency 'fakefs', '~> 2.4'
23
23
  s.add_development_dependency 'rake', '~> 13.0'
24
24
  s.add_development_dependency 'rspec', '~> 3.0'
25
- s.add_development_dependency 'voxpupuli-rubocop', '~> 2.6.0'
25
+ s.add_development_dependency 'voxpupuli-rubocop', '~> 2.7.0'
26
26
 
27
27
  # Run time dependencies
28
28
  s.add_runtime_dependency 'minitar', '~> 0.6'
@@ -147,7 +147,7 @@ Usage: beaker [options...]
147
147
  (default: slow)
148
148
  --[no-]ntp Sync time on SUTs before testing
149
149
  (default: false)
150
- --repo-proxy Proxy packaging repositories on ubuntu, debian, cumulus and solaris-11
150
+ --repo-proxy Proxy packaging repositories on ubuntu, debian and solaris-11
151
151
  (default: false)
152
152
  --package-proxy URL Set proxy url for package managers (yum and apt)
153
153
  --[no-]validate Validate that SUTs are correctly provisioned before running tests
@@ -72,11 +72,7 @@ module Beaker
72
72
  append_commands = host.append_commands(cmd, ac, :cmd_exe => @cmdexe)
73
73
 
74
74
  # This will cause things like `puppet -t -v agent` which is maybe bad.
75
- cmd_line_array = if host[:platform]&.include?('cisco_ios_xr')
76
- [prepend_commands, env_string, cmd, options_string, args_string, append_commands]
77
- else
78
- [env_string, prepend_commands, cmd, options_string, args_string, append_commands]
79
- end
75
+ cmd_line_array = [env_string, prepend_commands, cmd, options_string, args_string, append_commands]
80
76
  cmd_line_array.compact.reject(&:empty?).join(' ')
81
77
  end
82
78
 
@@ -278,20 +278,18 @@ module Unix::Exec
278
278
  # @return [Result] result of restarting the SSH service
279
279
  def ssh_service_restart
280
280
  case self['platform']
281
- when /debian|ubuntu|cumulus|huaweios/
282
- exec(Beaker::Command.new("service ssh restart"))
283
- when /amazon|(el|centos|redhat|oracle|scientific)-[7-9]|eos-7|fedora-(1[4-9]|2[0-9]|3[0-9])|archlinux-/
284
- exec(Beaker::Command.new("systemctl restart sshd.service"))
285
- when /el-|centos|fedora|redhat|oracle|scientific|eos/
281
+ when /debian|ubuntu/
282
+ exec(Beaker::Command.new("systemctl restart ssh"))
283
+ when /(el|centos|redhat|oracle|scientific)-[0-6]/
286
284
  exec(Beaker::Command.new("/sbin/service sshd restart"))
287
- when /opensuse|sles/
288
- exec(Beaker::Command.new("/usr/sbin/rcsshd restart"))
289
285
  when /solaris/
290
286
  exec(Beaker::Command.new("svcadm restart svc:/network/ssh:default"))
291
287
  when /(free|open)bsd/
292
288
  exec(Beaker::Command.new("sudo /etc/rc.d/sshd restart"))
289
+ when /opensuse|sles/
290
+ exec(Beaker::Command.new("/usr/sbin/rcsshd restart"))
293
291
  else
294
- raise ArgumentError, "Unsupported Platform: '#{self['platform']}'"
292
+ exec(Beaker::Command.new("systemctl restart sshd.service"))
295
293
  end
296
294
  end
297
295
 
@@ -302,11 +300,11 @@ module Unix::Exec
302
300
  # (from {#ssh_service_restart}).
303
301
  def ssh_permit_user_environment
304
302
  case self['platform']
305
- when /amazon|debian|ubuntu|cumulus|huaweios|archlinux|el-|centos|fedora|redhat|oracle|scientific|eos|opensuse|sles|solaris/
303
+ when /amazon|debian|ubuntu|archlinux|el-|centos|fedora|redhat|oracle|scientific|opensuse|sles|solaris/
306
304
  directory = tmpdir
307
305
  exec(Beaker::Command.new("echo 'PermitUserEnvironment yes' | cat - /etc/ssh/sshd_config > #{directory}/sshd_config.permit"))
308
306
  exec(Beaker::Command.new("mv #{directory}/sshd_config.permit /etc/ssh/sshd_config"))
309
- exec(Beaker::Command.new("echo '' >/etc/environment")) if /ubuntu-2(0|2).04/.match?(self['platform'])
307
+ exec(Beaker::Command.new("echo '' >/etc/environment")) if self['platform'].include?('ubuntu-')
310
308
  when /(free|open)bsd/
311
309
  exec(Beaker::Command.new("sudo perl -pi -e 's/^#?PermitUserEnvironment no/PermitUserEnvironment yes/' /etc/ssh/sshd_config"), { :pty => true })
312
310
  else
@@ -92,7 +92,7 @@ module Unix::File
92
92
  '/etc/yum.repos.d/'
93
93
  when /opensuse|sles/
94
94
  '/etc/zypp/repos.d/'
95
- when /debian|ubuntu|cumulus|huaweios/
95
+ when /debian|ubuntu/
96
96
  '/etc/apt/sources.list.d'
97
97
  else
98
98
  msg = "package config dir unknown for platform '#{self['platform']}'"
@@ -113,26 +113,17 @@ module Unix::File
113
113
  repo_filename = format("pl-%s-%s-", package_name, build_version)
114
114
 
115
115
  case variant
116
- when /amazon|fedora|el|redhat|centos|cisco_nexus|cisco_ios_xr|opensuse|sles/
116
+ when /amazon|fedora|el|redhat|centos|opensuse|sles/
117
117
  variant = 'el' if %w[centos redhat].include?(variant)
118
118
 
119
119
  variant = 'redhatfips' if self['packaging_platform']&.include?('redhatfips')
120
120
 
121
- if variant == 'cisco_nexus'
122
- variant = 'cisco-wrlinux'
123
- version = '5'
124
- end
125
- if variant == 'cisco_ios_xr'
126
- variant = 'cisco-wrlinux'
127
- version = '7'
128
- end
129
121
  fedora_prefix = (variant == 'fedora' ? 'f' : '')
130
122
 
131
123
  pattern = "%s-%s%s-%s.repo"
132
124
 
133
125
  repo_filename << (format(pattern, variant, fedora_prefix, version, arch))
134
- when /debian|ubuntu|cumulus|huaweios/
135
- codename = variant if variant == 'cumulus' || variant == 'huaweios'
126
+ when /debian|ubuntu/
136
127
  repo_filename << (format("%s.list", codename))
137
128
  else
138
129
  msg = "#repo_filename: repo filename pattern not known for platform '#{self['platform']}'"
@@ -151,7 +142,7 @@ module Unix::File
151
142
  case self['platform']
152
143
  when /amazon|fedora|el-|redhat|centos|opensuse|sles/
153
144
  'rpm'
154
- when /debian|ubuntu|cumulus|huaweios/
145
+ when /debian|ubuntu/
155
146
  'deb'
156
147
  else
157
148
  msg = "#repo_type: repo type not known for platform '#{self['platform']}'"
@@ -37,12 +37,9 @@ module Unix::Pkg
37
37
  self[:sles_rpmkeys_nightly_pl_imported] = true
38
38
  end
39
39
  result = execute("zypper --gpg-auto-import-keys se -i --match-exact #{name}", opts) { |result| result }
40
- when /el-4/
41
- @logger.debug("Package query not supported on rhel4")
42
- return false
43
- when /amazon|cisco|fedora|centos|redhat|eos|el-/
40
+ when /amazon|fedora|centos|redhat|el-/
44
41
  result = execute("rpm -q #{name}", opts) { |result| result }
45
- when /ubuntu|debian|cumulus|huaweios/
42
+ when /ubuntu|debian/
46
43
  result = execute("dpkg -s #{name}", opts) { |result| result }
47
44
  when /solaris-11/
48
45
  result = execute("pkg info #{name}", opts) { |result| result }
@@ -62,7 +59,7 @@ module Unix::Pkg
62
59
  # If apt has not been updated since the last repo deployment it is
63
60
  # updated. Otherwise this is a noop
64
61
  def update_apt_if_needed
65
- return unless /debian|ubuntu|cumulus|huaweios/.match?(self['platform'])
62
+ return unless /debian|ubuntu/.match?(self['platform'])
66
63
  return unless @apt_needs_update
67
64
 
68
65
  execute("apt-get update")
@@ -85,15 +82,13 @@ module Unix::Pkg
85
82
  case self['platform']
86
83
  when /opensuse|sles-/
87
84
  execute("zypper --non-interactive --gpg-auto-import-keys in #{name}", opts)
88
- when /el-4/
89
- @logger.debug("Package installation not supported on rhel4")
90
85
  when /amazon-2023|el-(8|9|1[0-9])|fedora/
91
86
  name = "#{name}-#{version}" if version
92
87
  execute("dnf -y #{cmdline_args} install #{name}", opts)
93
- when /cisco|centos|redhat|eos|el-[1-7]-/
88
+ when /amazon-(2|7)|centos|redhat|el-[1-7]-/
94
89
  name = "#{name}-#{version}" if version
95
90
  execute("yum -y #{cmdline_args} install #{name}", opts)
96
- when /ubuntu|debian|cumulus|huaweios/
91
+ when /ubuntu|debian/
97
92
  name = "#{name}=#{version}" if version
98
93
  update_apt_if_needed
99
94
  execute("apt-get install --force-yes #{cmdline_args} -y #{name}", opts)
@@ -170,13 +165,11 @@ module Unix::Pkg
170
165
  case self['platform']
171
166
  when /opensuse|sles-/
172
167
  execute("zypper --non-interactive rm #{name}", opts)
173
- when /el-4/
174
- @logger.debug("Package uninstallation not supported on rhel4")
175
168
  when /amazon-2023|el-(8|9|1[0-9])|fedora/
176
169
  execute("dnf -y #{cmdline_args} remove #{name}", opts)
177
- when /cisco|centos|redhat|eos|el-[1-7]-/
170
+ when /amazon-(2|7)|centos|redhat|el-[1-7]-/
178
171
  execute("yum -y #{cmdline_args} remove #{name}", opts)
179
- when /ubuntu|debian|cumulus|huaweios/
172
+ when /ubuntu|debian/
180
173
  execute("apt-get purge #{cmdline_args} -y #{name}", opts)
181
174
  when /solaris-11/
182
175
  execute("pkg #{cmdline_args} uninstall #{name}", opts)
@@ -200,13 +193,11 @@ module Unix::Pkg
200
193
  case self['platform']
201
194
  when /opensuse|sles-/
202
195
  execute("zypper --non-interactive --no-gpg-checks up #{name}", opts)
203
- when /el-4/
204
- @logger.debug("Package upgrade is not supported on rhel4")
205
- when /fedora-(2[2-9]|3[0-9])/
196
+ when /fedora/
206
197
  execute("dnf -y #{cmdline_args} update #{name}", opts)
207
- when /cisco|fedora|centos|redhat|eos|el-/
198
+ when /centos|redhat|el-/
208
199
  execute("yum -y #{cmdline_args} update #{name}", opts)
209
- when /ubuntu|debian|cumulus|huaweios/
200
+ when /ubuntu|debian/
210
201
  update_apt_if_needed
211
202
  execute("apt-get install -o Dpkg::Options::='--force-confold' #{cmdline_args} -y --force-yes #{name}", opts)
212
203
  when /solaris-11/
@@ -270,7 +261,7 @@ module Unix::Pkg
270
261
  execute("#{command_name} --nogpgcheck localinstall -y #{onhost_package_file}")
271
262
  when /^(opensuse|sles)$/
272
263
  execute("zypper --non-interactive --no-gpg-checks in #{onhost_package_file}")
273
- when /^(debian|ubuntu|cumulus)$/
264
+ when /^(debian|ubuntu)$/
274
265
  execute("dpkg -i --force-all #{onhost_package_file}")
275
266
  execute("apt-get update")
276
267
  when /^solaris$/
@@ -294,7 +285,7 @@ module Unix::Pkg
294
285
  def uncompress_local_tarball(onhost_tar_file, onhost_base_dir, download_file)
295
286
  variant, version, _arch, _codename = self['platform'].to_array
296
287
  case variant
297
- when /^(amazon|fedora|el|centos|redhat|opensuse|sles|debian|ubuntu|cumulus)$/
288
+ when /^(amazon|fedora|el|centos|redhat|opensuse|sles|debian|ubuntu)$/
298
289
  execute("tar -zxvf #{onhost_tar_file} -C #{onhost_base_dir}")
299
290
  when /^solaris$/
300
291
  # uncompress PE puppet-agent tarball
@@ -51,18 +51,6 @@ module Unix
51
51
  # @return [String,nil] Reason message if set_env should be skipped,
52
52
  # nil if it should run.
53
53
  def skip_set_env?
54
- case self['platform'].variant
55
- when /^(f5|netscaler)$/
56
- "no puppet-agent package for network device platform '#{self['platform'].variant}'"
57
- end
58
- end
59
-
60
- # Validates that the host was setup correctly
61
- #
62
- # @return nil
63
- # @raise [ArgumentError] If the host is setup incorrectly,
64
- # this will be raised with the appropriate message
65
- def validate_setup
66
54
  nil
67
55
  end
68
56
 
data/lib/beaker/host.rb CHANGED
@@ -57,10 +57,6 @@ module Beaker
57
57
  Mac::Host.new name, host_hash, options
58
58
  when /freebsd/
59
59
  FreeBSD::Host.new name, host_hash, options
60
- when /eos/
61
- Eos::Host.new name, host_hash, options
62
- when /cisco/
63
- Cisco::Host.new name, host_hash, options
64
60
  else
65
61
  Unix::Host.new name, host_hash, options
66
62
  end
@@ -576,8 +572,6 @@ module Beaker
576
572
  freebsd
577
573
  windows
578
574
  pswindows
579
- eos
580
- cisco
581
575
  ].each do |lib|
582
576
  require "beaker/host/#{lib}"
583
577
  end
@@ -22,7 +22,6 @@ module Beaker
22
22
  SLES10_PACKAGES = ['curl']
23
23
  SLES_PACKAGES = %w[curl ntp]
24
24
  DEBIAN_PACKAGES = %w[curl ntpdate lsb-release apt-transport-https]
25
- CUMULUS_PACKAGES = %w[curl ntpdate]
26
25
  SOLARIS10_PACKAGES = %w[CSWcurl CSWntp wget]
27
26
  SOLARIS11_PACKAGES = %w[curl ntp]
28
27
  ETC_HOSTS_PATH = "/etc/hosts"
@@ -53,9 +52,6 @@ module Beaker
53
52
  ntp_command = "chronyc add server #{ntp_server} prefer trust;chronyc makestep;chronyc burst 1/2"
54
53
  elsif /opensuse-|sles-/.match?(host['platform'])
55
54
  ntp_command = "sntp #{ntp_server}"
56
- elsif host['platform'].include?('cisco_nexus')
57
- ntp_server = host.exec(Command.new("getent hosts #{NTPSERVER} | head -n1 |cut -d \" \" -f1"), :acceptable_exit_codes => [0]).stdout
58
- ntp_command = "sudo -E sh -c 'export DCOS_CONTEXT=2;/isan/bin/ntpdate -u -t 20 #{ntp_server}'"
59
55
  else
60
56
  ntp_command = "ntpdate -u -t 20 #{ntp_server}"
61
57
  end
@@ -86,7 +82,6 @@ module Beaker
86
82
  # Verifies the presence of #{HostPrebuiltSteps::UNIX_PACKAGES} on unix platform hosts,
87
83
  # {HostPrebuiltSteps::SLES_PACKAGES} on SUSE platform hosts,
88
84
  # {HostPrebuiltSteps::DEBIAN_PACKAGES} on debian platform hosts,
89
- # {HostPrebuiltSteps::CUMULUS_PACKAGES} on cumulus platform hosts,
90
85
  # {HostPrebuiltSteps::WINDOWS_PACKAGES} on cygwin-installed windows platform hosts,
91
86
  # and {HostPrebuiltSteps::PSWINDOWS_PACKAGES} on non-cygwin windows platform hosts.
92
87
  #
@@ -118,8 +113,6 @@ module Beaker
118
113
  SLES_PACKAGES
119
114
  when /debian/
120
115
  DEBIAN_PACKAGES
121
- when /cumulus/
122
- CUMULUS_PACKAGES
123
116
  when /windows/
124
117
  if host.is_cygwin?
125
118
  raise RuntimeError, "cygwin is not installed on #{host}" if !host.cygwin_installed?
@@ -141,7 +134,7 @@ module Beaker
141
134
  when /fedora/
142
135
  FEDORA_PACKAGES
143
136
  else
144
- if !/aix|solaris|osx-|f5-|netscaler|cisco_/.match?(host['platform'])
137
+ if !/aix|solaris|osx-/.match?(host['platform'])
145
138
  UNIX_PACKAGES
146
139
  else
147
140
  []
@@ -193,7 +186,7 @@ module Beaker
193
186
  block_on host do |host|
194
187
  logger.notify "Sync root authorized_keys from github on #{host.name}"
195
188
  # Allow all exit code, as this operation is unlikely to cause problems if it fails.
196
- if /solaris|eos/.match?(host['platform'])
189
+ if host['platform'].include?('solaris')
197
190
  host.exec(Command.new(ROOT_KEYS_SYNC_CMD % "bash"), :accept_all_exit_codes => true)
198
191
  elsif host['platform'].include?('aix')
199
192
  host.exec(Command.new(ROOT_KEYS_SYNC_CMD_AIX % "env PATH=/usr/gnu/bin:$PATH bash"), :accept_all_exit_codes => true)
@@ -206,12 +199,12 @@ module Beaker
206
199
  end
207
200
 
208
201
  # Run 'apt-get update' on the provided host or hosts.
209
- # If the platform of the provided host is not ubuntu, debian or cumulus: do nothing.
202
+ # If the platform of the provided host is not ubuntu or debian: do nothing.
210
203
  #
211
204
  # @param [Host, Array<Host>] hosts One or more hosts to act upon
212
205
  def apt_get_update hosts
213
206
  block_on hosts do |host|
214
- host.exec(Command.new("apt-get update")) if /ubuntu|debian|cumulus/.match?(host[:platform])
207
+ host.exec(Command.new("apt-get update")) if /ubuntu|debian/.match?(host[:platform])
215
208
  end
216
209
  end
217
210
 
@@ -342,14 +335,12 @@ module Beaker
342
335
  def disable_updates hosts, opts
343
336
  logger = opts[:logger]
344
337
  hosts.each do |host|
345
- next if host['platform'].include?('netscaler')
346
-
347
338
  logger.notify "Disabling updates.puppetlabs.com by modifying hosts file to resolve updates to 127.0.0.1 on #{host}"
348
339
  set_etc_hosts(host, "127.0.0.1\tupdates.puppetlabs.com\n")
349
340
  end
350
341
  end
351
342
 
352
- # Update sshd_config on debian, ubuntu, centos, el, redhat, cumulus, and fedora boxes to allow for root login
343
+ # Update sshd_config on debian, ubuntu, centos, el, redhat and fedora boxes to allow for root login
353
344
  #
354
345
  # Does nothing on other platfoms.
355
346
  #
@@ -376,8 +367,7 @@ module Beaker
376
367
  elsif host['platform'].include?('solaris-11')
377
368
  host.exec(Command.new("if grep \"root::::type=role\" /etc/user_attr; then sudo rolemod -K type=normal root; else echo \"root user already type=normal\"; fi"), { :pty => true })
378
369
  host.exec(Command.new("sudo gsed -i -e 's/PermitRootLogin no/PermitRootLogin yes/g' /etc/ssh/sshd_config"), { :pty => true })
379
- elsif host['platform'].include?('f5') || host.is_powershell?
380
- # interacting with f5 should using tmsh
370
+ elsif host.is_powershell?
381
371
  logger.warn("Attempting to enable root login non-supported platform: #{host.name}: #{host['platform']}")
382
372
  elsif host.is_cygwin?
383
373
  host.exec(Command.new("sed -ri 's/^#?PermitRootLogin /PermitRootLogin yes/' /etc/sshd_config"), { :pty => true })
@@ -385,11 +375,11 @@ module Beaker
385
375
  host.exec(Command.new("sudo su -c \"sed -ri 's/^#?PermitRootLogin no|^#?PermitRootLogin yes/PermitRootLogin yes/' /etc/ssh/sshd_config\""), { :pty => true })
386
376
  end
387
377
  # restart sshd
388
- if /debian|ubuntu|cumulus/.match?(host['platform'])
378
+ if /debian|ubuntu/.match?(host['platform'])
389
379
  host.exec(Command.new("sudo su -c \"service ssh restart\""), { :pty => true })
390
- elsif /amazon|arch|(centos|el|redhat)-[789]|fedora-(1[4-9]|2[0-9]|3[0-9])/.match?(host['platform'])
380
+ elsif /amazon|arch|(centos|el|redhat)-[789]|fedora/.match?(host['platform'])
391
381
  host.exec(Command.new("sudo -E systemctl restart sshd.service"), { :pty => true })
392
- elsif /centos|el-|redhat|fedora|eos/.match?(host['platform'])
382
+ elsif /centos|el-|redhat/.match?(host['platform'])
393
383
  host.exec(Command.new("sudo -E /sbin/service sshd reload"), { :pty => true })
394
384
  elsif /(free|open)bsd/.match?(host['platform'])
395
385
  host.exec(Command.new("sudo /etc/rc.d/sshd restart"))
@@ -408,7 +398,7 @@ module Beaker
408
398
  def disable_se_linux host, opts
409
399
  logger = opts[:logger]
410
400
  block_on host do |host|
411
- if /centos|el-|redhat|fedora|eos/.match?(host['platform'])
401
+ if /centos|el-|redhat|fedora/.match?(host['platform'])
412
402
  logger.debug("Disabling se_linux on #{host.name}")
413
403
  host.exec(Command.new("sudo su -c \"setenforce 0\""), { :pty => true })
414
404
  else
@@ -418,7 +408,7 @@ module Beaker
418
408
  end
419
409
 
420
410
  # Setup files for enabling requests to pass to a proxy server
421
- # This works for the APT package manager on debian, ubuntu, and cumulus
411
+ # This works for the APT package manager on debian and ubuntu
422
412
  # and YUM package manager on el, centos, fedora and redhat.
423
413
  # @param [Host, Array<Host>, String, Symbol] host One or more hosts to act upon
424
414
  # @param [Hash{Symbol=>String}] opts Options to alter execution.
@@ -429,9 +419,9 @@ module Beaker
429
419
  block_on host do |host|
430
420
  logger.debug("enabling proxy support on #{host.name}")
431
421
  case host['platform']
432
- when /ubuntu/, /debian/, /cumulus/
422
+ when /ubuntu/, /debian/
433
423
  host.exec(Command.new("echo 'Acquire::http::Proxy \"#{opts[:package_proxy]}/\";' >> /etc/apt/apt.conf.d/10proxy"))
434
- when /amazon/, /^el-/, /centos/, /fedora/, /redhat/, /eos/
424
+ when /amazon/, /^el-/, /centos/, /fedora/, /redhat/
435
425
  host.exec(Command.new("echo 'proxy=#{opts[:package_proxy]}/' >> /etc/yum.conf"))
436
426
  when /solaris-11/
437
427
  host.exec(Command.new("/usr/bin/pkg unset-publisher solaris || :"))