rspec-puppet-facts 1.9.0 → 1.9.1

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
- SHA1:
3
- metadata.gz: 601e63e42c9bd47dcfa7a4595770e4b2f75638f1
4
- data.tar.gz: 86c454040c79b8dc060e197fa0ca2a810edafaa7
2
+ SHA256:
3
+ metadata.gz: 7dbd52f624b211b89fe821e11bb4b0b06f027990544d3fcab0670ed43649dc04
4
+ data.tar.gz: 590ab056e1834379ff220aa28bd0f84dd3190f52b9bca2d0621432c29c7333ec
5
5
  SHA512:
6
- metadata.gz: fba02b4a1a05373922f6686bd606e328918f443e528934fd0b056c128d51f01c60a3fdb70c2db309f697cdcbe7a0a538eb8e3e0dee3558940311955977bc01d0
7
- data.tar.gz: 62e87c175fd6280657886628b371b457cde4a6452f9558f931db0f83be3ceaecba05340e728f39003246a57e191c927b612ad64e6ad9be5384a86a62dbc7a67c
6
+ metadata.gz: ae3e87f28130b1729435a68bd58573e091a0be404e0c666f5eba49c319308374f183b5312d3336ea37a684764b100696d32970cc0d45b16fb404c5eef7f7b967
7
+ data.tar.gz: 7c44c5f98f60b92b117129c52f1acedd4b355196db417267547be85cee91f261fe0703f3861b380360af1c2e75589bfb28084d29e8c90ad4cb736f3bfa1ccb7e
@@ -1,3 +1,6 @@
1
+ ## 2018-10-24 - Release 1.9.1
2
+ - Do not rely on features of Augeas because Puppet 6
3
+
1
4
  ## 2018-01-31 - Release 1.9.0
2
5
  - Bumps facterdb requirement to 0.5.0
3
6
  - Adds docs for using custom external facts
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 [metatdata](https://docs.puppet.com/puppet/latest/modules_metadata.html) documentation.
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
 
@@ -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
- if Puppet.features.augeas?
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
@@ -2,6 +2,6 @@ module RspecPuppetFacts
2
2
  # This module contains the current version constant
3
3
  module Version
4
4
  # The current version of this gem
5
- STRING = '1.9.0'
5
+ STRING = '1.9.1'
6
6
  end
7
7
  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.0
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-02-01 00:00:00.000000000 Z
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.5.2.2
195
+ rubygems_version: 2.7.6
196
196
  signing_key:
197
197
  specification_version: 4
198
198
  summary: Standard facts fixtures for Puppet