beaker 5.1.0 → 5.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/release.yml +1 -1
  3. data/.github/workflows/test.yml +1 -1
  4. data/.rubocop.yml +7 -3
  5. data/.rubocop_todo.yml +55 -3
  6. data/CHANGELOG.md +30 -0
  7. data/Gemfile +1 -7
  8. data/Rakefile +0 -122
  9. data/acceptance/tests/base/dsl/helpers/configuration_test.rb +1 -0
  10. data/acceptance/tests/base/dsl/helpers/hocon_helpers_test.rb +5 -2
  11. data/acceptance/tests/base/dsl/helpers/host_helpers/archive_file_from_test.rb +5 -1
  12. data/acceptance/tests/base/dsl/helpers/host_helpers/backup_the_file_test.rb +3 -0
  13. data/acceptance/tests/base/dsl/helpers/host_helpers/check_for_package_test.rb +6 -0
  14. data/acceptance/tests/base/dsl/helpers/host_helpers/create_remote_file_test.rb +6 -0
  15. data/acceptance/tests/base/dsl/helpers/host_helpers/curl_on_test.rb +2 -0
  16. data/acceptance/tests/base/dsl/helpers/host_helpers/echo_on_test.rb +3 -1
  17. data/acceptance/tests/base/dsl/helpers/host_helpers/on_test.rb +10 -1
  18. data/acceptance/tests/base/dsl/helpers/host_helpers/retry_on_test.rb +1 -0
  19. data/acceptance/tests/base/dsl/helpers/host_helpers/rsync_to_test.rb +2 -0
  20. data/acceptance/tests/base/dsl/helpers/host_helpers/run_cron_on_test.rb +13 -0
  21. data/acceptance/tests/base/dsl/helpers/host_helpers/run_script_on_test.rb +2 -0
  22. data/acceptance/tests/base/dsl/helpers/host_helpers/run_script_test.rb +2 -0
  23. data/acceptance/tests/base/dsl/helpers/host_helpers/scp_from_test.rb +2 -0
  24. data/acceptance/tests/base/dsl/helpers/host_helpers/scp_to_test.rb +2 -0
  25. data/acceptance/tests/base/dsl/helpers/host_helpers/shell_test.rb +5 -0
  26. data/acceptance/tests/base/dsl/helpers/host_helpers/upgrade_package_test.rb +2 -0
  27. data/acceptance/tests/base/host/file_test.rb +7 -0
  28. data/acceptance/tests/base/host/host_test.rb +27 -4
  29. data/acceptance/tests/base/host_prebuilt_steps/ssh_environment_test.rb +3 -3
  30. data/acceptance/tests/hypervisor/communication_test.rb +1 -1
  31. data/beaker.gemspec +8 -7
  32. data/docs/tutorials/creating_a_test_environment.md +2 -1
  33. data/lib/beaker/host/aix/file.rb +2 -2
  34. data/lib/beaker/host/freebsd/pkg.rb +1 -1
  35. data/lib/beaker/host/pswindows/file.rb +7 -1
  36. data/lib/beaker/host/unix/exec.rb +1 -1
  37. data/lib/beaker/host/unix/file.rb +2 -2
  38. data/lib/beaker/host/windows/file.rb +2 -2
  39. data/lib/beaker/host.rb +24 -0
  40. data/lib/beaker/version.rb +1 -1
  41. metadata +50 -18
@@ -1,7 +1,13 @@
1
1
  module PSWindows::File
2
2
  include Beaker::CommandFactory
3
3
 
4
- def tmpfile(_name = '')
4
+ def tmpfile(_name = '', extension = nil)
5
+ if extension
6
+ # TODO: I do not have access to Windows, but the internet suggests this
7
+ # $newname = [System.IO.Path]::ChangeExtension($filename, "#{extension}") ; MoveItem $filename $newname
8
+ raise NotImplementedError, 'Passing an extension is not implemented'
9
+ end
10
+
5
11
  result = exec(powershell('[System.IO.Path]::GetTempFileName()'))
6
12
  result.stdout.chomp
7
13
  end
@@ -280,7 +280,7 @@ module Unix::Exec
280
280
  case self['platform']
281
281
  when /debian|ubuntu|cumulus|huaweios/
282
282
  exec(Beaker::Command.new("service ssh restart"))
283
- when /el-7|centos-7|redhat-7|oracle-7|scientific-7|eos-7|el-8|centos-8|redhat-8|oracle-8|fedora-(1[4-9]|2[0-9]|3[0-9])|archlinux-/
283
+ when /(el|centos|redhat|oracle|scientific)-[7-9]|eos-7|fedora-(1[4-9]|2[0-9]|3[0-9])|archlinux-/
284
284
  exec(Beaker::Command.new("systemctl restart sshd.service"))
285
285
  when /el-|centos|fedora|redhat|oracle|scientific|eos/
286
286
  exec(Beaker::Command.new("/sbin/service sshd restart"))
@@ -1,8 +1,8 @@
1
1
  module Unix::File
2
2
  include Beaker::CommandFactory
3
3
 
4
- def tmpfile(name = '')
5
- execute("mktemp -t #{name}.XXXXXX")
4
+ def tmpfile(name = '', extension = nil)
5
+ execute("mktemp -t #{name}.XXXXXX#{extension}")
6
6
  end
7
7
 
8
8
  def tmpdir(name = '')
@@ -1,8 +1,8 @@
1
1
  module Windows::File
2
2
  include Beaker::CommandFactory
3
3
 
4
- def tmpfile(name = '')
5
- execute("cygpath -m $(mktemp -t #{name}.XXXXXX)")
4
+ def tmpfile(name = '', extension = nil)
5
+ execute("cygpath -m $(mktemp -t #{name}.XXXXXX#{extension})")
6
6
  end
7
7
 
8
8
  def tmpdir(name = '')
data/lib/beaker/host.rb CHANGED
@@ -547,6 +547,30 @@ module Beaker
547
547
 
548
548
  raise Beaker::Host::CommandFailure, result.error
549
549
  end
550
+
551
+ def tmpfile(name = '')
552
+ raise NotImplementedError
553
+ end
554
+
555
+ def tmpdir(name = '')
556
+ raise NotImplementedError
557
+ end
558
+
559
+ def path_split(paths)
560
+ raise NotImplementedError
561
+ end
562
+
563
+ def rm_rf(path)
564
+ raise NotImplementedError
565
+ end
566
+
567
+ def install_package(package, cmdline_args = nil, _version = nil, opts = {})
568
+ raise NotImplementedError
569
+ end
570
+
571
+ def add_env_var(key, val)
572
+ raise NotImplementedError
573
+ end
550
574
  end
551
575
 
552
576
  %w[
@@ -1,5 +1,5 @@
1
1
  module Beaker
2
2
  module Version
3
- STRING = '5.1.0'
3
+ STRING = '5.3.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beaker
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.0
4
+ version: 5.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-27 00:00:00.000000000 Z
11
+ date: 2023-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fakefs
@@ -53,19 +53,19 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3.0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: yard
56
+ name: voxpupuli-rubocop
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 0.9.11
61
+ version: '1.1'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 0.9.11
68
+ version: '1.1'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: minitar
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -98,30 +98,62 @@ dependencies:
98
98
  name: rexml
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '3.2'
101
104
  - - ">="
102
105
  - !ruby/object:Gem::Version
103
- version: '0'
106
+ version: 3.2.5
104
107
  type: :runtime
105
108
  prerelease: false
106
109
  version_requirements: !ruby/object:Gem::Requirement
107
110
  requirements:
111
+ - - "~>"
112
+ - !ruby/object:Gem::Version
113
+ version: '3.2'
108
114
  - - ">="
109
115
  - !ruby/object:Gem::Version
110
- version: '0'
116
+ version: 3.2.5
111
117
  - !ruby/object:Gem::Dependency
112
- name: ed25519
118
+ name: bcrypt_pbkdf
113
119
  requirement: !ruby/object:Gem::Requirement
114
120
  requirements:
115
- - - "~>"
121
+ - - ">="
116
122
  - !ruby/object:Gem::Version
117
123
  version: '1.0'
124
+ - - "<"
125
+ - !ruby/object:Gem::Version
126
+ version: '2.0'
118
127
  type: :runtime
119
128
  prerelease: false
120
129
  version_requirements: !ruby/object:Gem::Requirement
121
130
  requirements:
122
- - - "~>"
131
+ - - ">="
123
132
  - !ruby/object:Gem::Version
124
133
  version: '1.0'
134
+ - - "<"
135
+ - !ruby/object:Gem::Version
136
+ version: '2.0'
137
+ - !ruby/object:Gem::Dependency
138
+ name: ed25519
139
+ requirement: !ruby/object:Gem::Requirement
140
+ requirements:
141
+ - - ">="
142
+ - !ruby/object:Gem::Version
143
+ version: '1.2'
144
+ - - "<"
145
+ - !ruby/object:Gem::Version
146
+ version: '2.0'
147
+ type: :runtime
148
+ prerelease: false
149
+ version_requirements: !ruby/object:Gem::Requirement
150
+ requirements:
151
+ - - ">="
152
+ - !ruby/object:Gem::Version
153
+ version: '1.2'
154
+ - - "<"
155
+ - !ruby/object:Gem::Version
156
+ version: '2.0'
125
157
  - !ruby/object:Gem::Dependency
126
158
  name: hocon
127
159
  requirement: !ruby/object:Gem::Requirement
@@ -174,16 +206,16 @@ dependencies:
174
206
  name: net-ssh
175
207
  requirement: !ruby/object:Gem::Requirement
176
208
  requirements:
177
- - - ">="
209
+ - - "~>"
178
210
  - !ruby/object:Gem::Version
179
- version: '5.0'
211
+ version: '7.1'
180
212
  type: :runtime
181
213
  prerelease: false
182
214
  version_requirements: !ruby/object:Gem::Requirement
183
215
  requirements:
184
- - - ">="
216
+ - - "~>"
185
217
  - !ruby/object:Gem::Version
186
- version: '5.0'
218
+ version: '7.1'
187
219
  - !ruby/object:Gem::Dependency
188
220
  name: in-parallel
189
221
  requirement: !ruby/object:Gem::Requirement
@@ -242,16 +274,16 @@ dependencies:
242
274
  name: beaker-hostgenerator
243
275
  requirement: !ruby/object:Gem::Requirement
244
276
  requirements:
245
- - - ">="
277
+ - - "~>"
246
278
  - !ruby/object:Gem::Version
247
- version: '0'
279
+ version: '2.0'
248
280
  type: :runtime
249
281
  prerelease: false
250
282
  version_requirements: !ruby/object:Gem::Requirement
251
283
  requirements:
252
- - - ">="
284
+ - - "~>"
253
285
  - !ruby/object:Gem::Version
254
- version: '0'
286
+ version: '2.0'
255
287
  - !ruby/object:Gem::Dependency
256
288
  name: stringify-hash
257
289
  requirement: !ruby/object:Gem::Requirement