simp-beaker-helpers 1.14.5 → 1.14.6

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: 1f1908432bd03c448aa27313d77556a1dea6e7c228f672cff99c67aceeb9c308
4
- data.tar.gz: d5556f6d36ac4d9cb951062ff8647ba3c12b7f6a0c2e721fee1c27c52055f97c
3
+ metadata.gz: f28b475b5b09702f9b3d263fc5b614101d49d86ebb85917865112083eedd646e
4
+ data.tar.gz: e32eab2aefc888c2cc3627235504f1df1433561fe50788ccb6a70714a0d4a756
5
5
  SHA512:
6
- metadata.gz: ec3f1a10a50c2613e4ab83334a006794af68d1e036c6f0ad176ee7d694480f6b0b736b72acbd8c6df2a6d065f73891ee84cf230a291cbf554a1e8dde9caf4ad7
7
- data.tar.gz: 00ba85614b6352c17d4ad08d5aa1ebfb7c2b674daa9f3f97e0b95b5534a273bfc811847b2c3c64aebe0e5eec33c78ab05c9d0fc3aa503e277fbe8310149a579e
6
+ metadata.gz: 9de41c37f6ca213ed06d465e8db1722d1006c11621b0dd9078535eb065f35b52f883491a3179ccb7ad5da69c45700ce2f3b87ed7f7b419b95ac7eccdebcf3b77
7
+ data.tar.gz: 35d8c62641e3403396732824e222177017c9a6692dff3ad01aff67218ce3169e6005e1ba1a18c71b8b10ddf71bc6c205144de844698a93ff3d3024bf6803226f
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ### 1.14.6 / 2019-08-15
2
+ * Add Windows client support to the beaker helpers functions
3
+ * Added an `is_windows?(sut)` function
4
+ * Work around issues with calling `sut.puppet` on Windows SUTs
5
+ * Update `copy_fixture_modules_to` to support Windows (slow copy)
6
+ * Add Windows support to `puppet_modulepath_on`
7
+
1
8
  ### 1.14.5 / 2019-08-14
2
9
  * Update the CentOS SSG hooks to properly work with CentOS 6
3
10
 
@@ -1,5 +1,5 @@
1
1
  module Simp; end
2
2
 
3
3
  module Simp::BeakerHelpers
4
- VERSION = '1.14.5'
4
+ VERSION = '1.14.6'
5
5
  end
@@ -18,6 +18,10 @@ module Simp::BeakerHelpers
18
18
  "simp-beaker-helpers-#{t}-#{$$}-#{rand(0x100000000).to_s(36)}.tmp"
19
19
  end
20
20
 
21
+ def is_windows?(sut)
22
+ fact_on(sut, 'osfamily').casecmp?('windows')
23
+ end
24
+
21
25
  # We can't cache this because it may change during a run
22
26
  def fips_enabled(sut)
23
27
  return on( sut,
@@ -95,7 +99,10 @@ module Simp::BeakerHelpers
95
99
 
96
100
  # Returns the modulepath on the SUT, as an Array
97
101
  def puppet_modulepath_on(sut, environment='production')
98
- sut.puppet['modulepath'].split(':')
102
+ splitchar = ':'
103
+ splitchar = ';' if is_windows?(sut)
104
+
105
+ sut.puppet_configprint['modulepath'].split(splitchar)
99
106
  end
100
107
 
101
108
  # Return the path to the 'spec/fixtures' directory
@@ -203,24 +210,37 @@ module Simp::BeakerHelpers
203
210
  mod_root = File.expand_path( "spec/fixtures/modules", File.dirname( fixtures_yml_path ))
204
211
 
205
212
  Dir.chdir(mod_root) do
206
- begin
207
- tarfile = "#{Simp::BeakerHelpers.tmpname}.tar"
213
+ # Have to do things the slow way on Windows
214
+ if is_windows?(sut)
215
+ Dir.glob('*') do |module_dir|
216
+ if File.directory?(module_dir)
217
+ copy_module_to( sut, {
218
+ :source => module_dir,
219
+ :module_name => module_dir,
220
+ :target_module_path => target_module_path
221
+ })
222
+ end
223
+ end
224
+ else
225
+ begin
226
+ tarfile = "#{Simp::BeakerHelpers.tmpname}.tar"
208
227
 
209
- excludes = PUPPET_MODULE_INSTALL_IGNORE.map do |x|
210
- x = "--exclude '*/#{x}'"
211
- end.join(' ')
228
+ excludes = PUPPET_MODULE_INSTALL_IGNORE.map do |x|
229
+ x = "--exclude '*/#{x}'"
230
+ end.join(' ')
212
231
 
213
- %x(tar -ch #{excludes} -f #{tarfile} *)
232
+ %x(tar -ch #{excludes} -f #{tarfile} *)
214
233
 
215
- if File.exist?(tarfile)
216
- copy_to(sut, tarfile, target_module_path, opts)
217
- else
218
- fail("Error: module tar file '#{tarfile}' could not be created at #{mod_root}")
219
- end
234
+ if File.exist?(tarfile)
235
+ copy_to(sut, tarfile, target_module_path, opts)
236
+ else
237
+ fail("Error: module tar file '#{tarfile}' could not be created at #{mod_root}")
238
+ end
220
239
 
221
- on(sut, "cd #{target_module_path} && tar -xf #{File.basename(tarfile)}")
222
- ensure
223
- FileUtils.remove_entry(tarfile, true)
240
+ on(sut, "cd #{target_module_path} && tar -xf #{File.basename(tarfile)}")
241
+ ensure
242
+ FileUtils.remove_entry(tarfile, true)
243
+ end
224
244
  end
225
245
  end
226
246
  end
@@ -735,11 +755,11 @@ done
735
755
  # This output lets us know where Hiera is configured to look on the system
736
756
  puppet_lookup_info = on(sut, 'puppet lookup --explain test__simp__test').output.strip.lines
737
757
 
738
- if sut.puppet['manifest'].nil? || sut.puppet['manifest'].empty?
758
+ if sut.puppet_configprint['manifest'].nil? || sut.puppet_configprint['manifest'].empty?
739
759
  fail("No output returned from `puppet config print manifest` on #{sut}")
740
760
  end
741
761
 
742
- puppet_env_path = File.dirname(sut.puppet['manifest'])
762
+ puppet_env_path = File.dirname(sut.puppet_configprint['manifest'])
743
763
 
744
764
  # We'll just take the first match since Hiera will find things there
745
765
  puppet_lookup_info = puppet_lookup_info.grep(/Path "/).grep(Regexp.new(puppet_env_path))
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.14.5
4
+ version: 1.14.6
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: 2019-08-14 00:00:00.000000000 Z
12
+ date: 2019-08-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: beaker