rspec-puppet-facts 1.9.0 → 1.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/CHANGELOG.md +3 -0
- data/README.md +1 -1
- data/lib/rspec-puppet-facts.rb +11 -1
- data/lib/rspec-puppet-facts/version.rb +1 -1
- data/spec/rspec_puppet_facts_spec.rb +31 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 7dbd52f624b211b89fe821e11bb4b0b06f027990544d3fcab0670ed43649dc04
|
4
|
+
data.tar.gz: 590ab056e1834379ff220aa28bd0f84dd3190f52b9bca2d0621432c29c7333ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae3e87f28130b1729435a68bd58573e091a0be404e0c666f5eba49c319308374f183b5312d3336ea37a684764b100696d32970cc0d45b16fb404c5eef7f7b967
|
7
|
+
data.tar.gz: 7c44c5f98f60b92b117129c52f1acedd4b355196db417267547be85cee91f261fe0703f3861b380360af1c2e75589bfb28084d29e8c90ad4cb736f3bfa1ccb7e
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -38,7 +38,7 @@ include RspecPuppetFacts
|
|
38
38
|
|
39
39
|
## Specifying the supported operating systems
|
40
40
|
|
41
|
-
To determine which facts to run your tests against, `rspec-puppet-facts` checks your module's `metadata.json` to find out what operating systems your module supports. The `metadata.json` file is located in the root of your module. To learn more about this file, see Puppet's [
|
41
|
+
To determine which facts to run your tests against, `rspec-puppet-facts` checks your module's `metadata.json` to find out what operating systems your module supports. The `metadata.json` file is located in the root of your module. To learn more about this file, see Puppet's [metadata](https://docs.puppet.com/puppet/latest/modules_metadata.html) documentation.
|
42
42
|
|
43
43
|
By default, `rspec-puppet-facts` provides the facts only for `x86_64` architecture. However, you can override this default and the supported operating system list by passing a hash to `on_supported_os` in your tests. This hash must contain either or both of the following keys:
|
44
44
|
|
data/lib/rspec-puppet-facts.rb
CHANGED
@@ -60,6 +60,13 @@ module RspecPuppetFacts
|
|
60
60
|
hardwaremodel = 'amd64'
|
61
61
|
elsif os_sup['operatingsystem'] =~ /Solaris/i
|
62
62
|
hardwaremodel = 'i86pc'
|
63
|
+
elsif os_sup['operatingsystem'] =~ /AIX/i
|
64
|
+
hardwaremodel = '/^IBM,.*/'
|
65
|
+
os_release_filter = if operatingsystemmajrelease =~ /\A(\d+)\.(\d+)\Z/
|
66
|
+
"/^#{$~[1]}#{$~[2]}00-/"
|
67
|
+
else
|
68
|
+
"/^#{operatingsystemmajrelease}-/"
|
69
|
+
end
|
63
70
|
elsif os_sup['operatingsystem'] =~ /Windows/i
|
64
71
|
hardwaremodel = version =~ /^[12]\./ ? 'x64' : 'x86_64'
|
65
72
|
os_sup['operatingsystem'] = os_sup['operatingsystem'].downcase
|
@@ -209,8 +216,11 @@ module RspecPuppetFacts
|
|
209
216
|
:rubysitedir => RbConfig::CONFIG['sitelibdir'],
|
210
217
|
:rubyversion => RUBY_VERSION,
|
211
218
|
}
|
212
|
-
|
219
|
+
begin
|
220
|
+
require 'augeas'
|
213
221
|
@common_facts[:augeasversion] = Augeas.open(nil, nil, Augeas::NO_MODL_AUTOLOAD).get('/augeas/version')
|
222
|
+
rescue => e
|
223
|
+
RspecPuppetFacts.warning "Failed to retrieve Augeas version: #{e}"
|
214
224
|
end
|
215
225
|
@common_facts
|
216
226
|
end
|
@@ -265,6 +265,37 @@ describe RspecPuppetFacts do
|
|
265
265
|
end
|
266
266
|
end
|
267
267
|
|
268
|
+
context 'When testing AIX 7.1' do
|
269
|
+
subject {
|
270
|
+
on_supported_os(
|
271
|
+
{
|
272
|
+
:supported_os => [
|
273
|
+
{
|
274
|
+
"operatingsystem" => "AIX",
|
275
|
+
"operatingsystemrelease" => [
|
276
|
+
"7.1", "7100"
|
277
|
+
],
|
278
|
+
},
|
279
|
+
],
|
280
|
+
:facterversion => '3.9'
|
281
|
+
}
|
282
|
+
)
|
283
|
+
}
|
284
|
+
it 'should return a hash' do
|
285
|
+
expect(subject.class).to eq Hash
|
286
|
+
end
|
287
|
+
it 'should have 1 elements' do
|
288
|
+
expect(subject.size).to eq 1
|
289
|
+
end
|
290
|
+
it 'should return supported OS' do
|
291
|
+
# NOTE: See FACT-1827 for details on the IBM,8284-22A part
|
292
|
+
# That has to match whatever hardware generated the facts file.
|
293
|
+
expect(subject.keys.sort).to eq %w(
|
294
|
+
aix-7100-IBM,8284-22A
|
295
|
+
)
|
296
|
+
end
|
297
|
+
end
|
298
|
+
|
268
299
|
context 'When testing Windows', :if => Facter.version.to_f >= 2.4 do
|
269
300
|
subject do
|
270
301
|
on_supported_os(
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-puppet-facts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.9.
|
4
|
+
version: 1.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mickaël Canévet
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-10-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mime-types
|
@@ -192,7 +192,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
192
192
|
version: '0'
|
193
193
|
requirements: []
|
194
194
|
rubyforge_project:
|
195
|
-
rubygems_version: 2.
|
195
|
+
rubygems_version: 2.7.6
|
196
196
|
signing_key:
|
197
197
|
specification_version: 4
|
198
198
|
summary: Standard facts fixtures for Puppet
|