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 +4 -4
- data/CHANGELOG.md +7 -0
- data/lib/simp/beaker_helpers/version.rb +1 -1
- data/lib/simp/beaker_helpers.rb +37 -17
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f28b475b5b09702f9b3d263fc5b614101d49d86ebb85917865112083eedd646e
|
4
|
+
data.tar.gz: e32eab2aefc888c2cc3627235504f1df1433561fe50788ccb6a70714a0d4a756
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
|
data/lib/simp/beaker_helpers.rb
CHANGED
@@ -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
|
-
|
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
|
-
|
207
|
-
|
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
|
-
|
210
|
-
|
211
|
-
|
228
|
+
excludes = PUPPET_MODULE_INSTALL_IGNORE.map do |x|
|
229
|
+
x = "--exclude '*/#{x}'"
|
230
|
+
end.join(' ')
|
212
231
|
|
213
|
-
|
232
|
+
%x(tar -ch #{excludes} -f #{tarfile} *)
|
214
233
|
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
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
|
-
|
222
|
-
|
223
|
-
|
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.
|
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.
|
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.
|
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-
|
12
|
+
date: 2019-08-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: beaker
|