rspec-puppet-facts 0.1.5 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -0
  3. data/README.md +98 -39
  4. data/facts/1.6/oraclelinux-5-i386.facts +66 -0
  5. data/facts/1.6/oraclelinux-5-x86_64.facts +66 -0
  6. data/facts/1.6/oraclelinux-6-i386.facts +59 -0
  7. data/facts/1.6/oraclelinux-6-x86_64.facts +59 -0
  8. data/facts/1.6/oraclelinux-7-i386.facts +50 -0
  9. data/facts/1.6/oraclelinux-7-x86_64.facts +50 -0
  10. data/facts/1.7/oraclelinux-5-i386.facts +82 -0
  11. data/facts/1.7/oraclelinux-5-x86_64.facts +82 -0
  12. data/facts/1.7/oraclelinux-6-i386.facts +77 -0
  13. data/facts/1.7/oraclelinux-6-x86_64.facts +77 -0
  14. data/facts/1.7/oraclelinux-7-i386.facts +75 -0
  15. data/facts/1.7/oraclelinux-7-x86_64.facts +75 -0
  16. data/facts/2.0/oraclelinux-5-i386.facts +81 -0
  17. data/facts/2.0/oraclelinux-5-x86_64.facts +81 -0
  18. data/facts/2.0/oraclelinux-6-i386.facts +76 -0
  19. data/facts/2.0/oraclelinux-6-x86_64.facts +76 -0
  20. data/facts/2.0/oraclelinux-7-i386.facts +74 -0
  21. data/facts/2.0/oraclelinux-7-x86_64.facts +74 -0
  22. data/facts/2.1/oraclelinux-5-i386.facts +82 -0
  23. data/facts/2.1/oraclelinux-5-x86_64.facts +82 -0
  24. data/facts/2.1/oraclelinux-6-i386.facts +77 -0
  25. data/facts/2.1/oraclelinux-6-x86_64.facts +77 -0
  26. data/facts/2.1/oraclelinux-7-i386.facts +78 -0
  27. data/facts/2.1/oraclelinux-7-x86_64.facts +78 -0
  28. data/facts/2.2/oraclelinux-5-i386.facts +87 -0
  29. data/facts/2.2/oraclelinux-5-x86_64.facts +87 -0
  30. data/facts/2.2/oraclelinux-6-i386.facts +81 -0
  31. data/facts/2.2/oraclelinux-6-x86_64.facts +81 -0
  32. data/facts/2.2/oraclelinux-7-i386.facts +82 -0
  33. data/facts/2.2/oraclelinux-7-x86_64.facts +82 -0
  34. data/facts/2.3/oraclelinux-5-i386.facts +88 -0
  35. data/facts/2.3/oraclelinux-5-x86_64.facts +88 -0
  36. data/facts/2.3/oraclelinux-6-i386.facts +82 -0
  37. data/facts/2.3/oraclelinux-6-x86_64.facts +82 -0
  38. data/facts/2.3/oraclelinux-7-i386.facts +83 -0
  39. data/facts/2.3/oraclelinux-7-x86_64.facts +83 -0
  40. data/lib/rspec-puppet-facts.rb +24 -42
  41. data/lib/rspec-puppet-facts/version.rb +1 -1
  42. metadata +38 -2
@@ -0,0 +1,83 @@
1
+ architecture => x86_64
2
+ bios_release_date => 12/01/2006
3
+ bios_vendor => innotek GmbH
4
+ bios_version => VirtualBox
5
+ blockdevice_sda_model => VBOX HARDDISK
6
+ blockdevice_sda_size => 21474836480
7
+ blockdevice_sda_vendor => ATA
8
+ blockdevices => sda
9
+ boardmanufacturer => Oracle Corporation
10
+ boardproductname => VirtualBox
11
+ boardserialnumber => 0
12
+ dhcp_servers => {"system"=>"10.0.2.2", "enp0s3"=>"10.0.2.2"}
13
+ domain => camptocamp.com
14
+ facterversion => 2.3.0
15
+ filesystems => xfs
16
+ fqdn => localhost.camptocamp.com
17
+ gem_version => ~> 2.3.0
18
+ gid => root
19
+ hardwareisa => x86_64
20
+ hardwaremodel => x86_64
21
+ hostname => localhost
22
+ id => root
23
+ interfaces => enp0s3,lo
24
+ ipaddress => 10.0.2.15
25
+ ipaddress_enp0s3 => 10.0.2.15
26
+ ipaddress_lo => 127.0.0.1
27
+ is_virtual => true
28
+ kernel => Linux
29
+ kernelmajversion => 3.10
30
+ kernelrelease => 3.10.0-123.el7.x86_64
31
+ kernelversion => 3.10.0
32
+ macaddress => 08:00:27:fd:47:eb
33
+ macaddress_enp0s3 => 08:00:27:fd:47:eb
34
+ manufacturer => innotek GmbH
35
+ memoryfree => 349.42 MB
36
+ memoryfree_mb => 349.42
37
+ memorysize => 490.41 MB
38
+ memorysize_mb => 490.41
39
+ mtu_enp0s3 => 1500
40
+ mtu_lo => 65536
41
+ netmask => 255.255.255.0
42
+ netmask_enp0s3 => 255.255.255.0
43
+ netmask_lo => 255.0.0.0
44
+ network_enp0s3 => 10.0.2.0
45
+ network_lo => 127.0.0.0
46
+ operatingsystem => OracleLinux
47
+ operatingsystemmajrelease => 7
48
+ operatingsystemrelease => 7.0.1406
49
+ os => {"name"=>"OracleLinux", "family"=>"RedHat", "release"=>{"major"=>"7", "minor"=>"0", "full"=>"7.0.1406"}}
50
+ osfamily => RedHat
51
+ partitions => {"sda1"=>{"uuid"=>"cb4a7e2a-22cc-4b61-a14b-03e04399cfc2", "size"=>"1024000", "mount"=>"/boot", "filesystem"=>"xfs"}, "sda2"=>{"size"=>"40916992", "filesystem"=>"LVM2_member"}}
52
+ path => /home/vagrant/vendor/bundler/ruby/bin:/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/var/lib/gems/1.8/bin/:/usr/local/bin
53
+ physicalprocessorcount => 1
54
+ processor0 => Intel(R) Core(TM) i7-3520M CPU @ 2.90GHz
55
+ processorcount => 1
56
+ processors => {"models"=>["Intel(R) Core(TM) i7-3520M CPU @ 2.90GHz"], "count"=>1, "physicalcount"=>1}
57
+ productname => VirtualBox
58
+ ps => ps -ef
59
+ rubyplatform => x86_64-linux
60
+ rubysitedir => /usr/local/share/ruby/site_ruby/
61
+ rubyversion => 2.0.0
62
+ selinux => false
63
+ serialnumber => 0
64
+ sshecdsakey => AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBP8Vudu2jo1JapnDmfTNYEwxUpvjiqNnHQolBa2DpPw3eIM4cdcaJIzGR6hmvngrznN0FxflH+xxpN/mAJfsOBE=
65
+ sshfp_ecdsa => SSHFP 3 1 edcd3e205ad84c39fa64278506ed1d877b7be4b9
66
+ SSHFP 3 2 4080e28e3625d4a6c5e82e336062bc672c2dd996e67dfdd53c673e2a7928d7f9
67
+ sshfp_rsa => SSHFP 1 1 24e6f938ed14ce78817cf170ce43a585deb59bf0
68
+ SSHFP 1 2 88c17ffc8565a341a3b3fe103ecfb0a5abf71928edfa0834a4384039d5e59008
69
+ sshrsakey => AAAAB3NzaC1yc2EAAAADAQABAAABAQCt6UbZ2wSzrAiNKkmG8UwqFutf7dnGIJn/DybdxO/vY7vXqlMep3wQ7gEYVkmttQu9N+PG5wanCXHzHk2cixOu1aoE/rb4PpuFt0td71smokqD5cQ0bFTJtTGJaxkE5o8XSfEcuRkAfmnFx+Cofsu8bZBONTWBfFAxA7adufsS1UFWQbFLRuju8VgTALwNGwkCN/s7QJ/FQh9Q/jxy74sGATljWf1/T5s33CKVFR8hAi9Xt3Dc+tX88/q8NSRNpMuTiaT8wwMJzbgFlkgZHpTTHQtOOq/MLTOA95CMxEaxmdKLTlBOd1aAsWWZjQpw5zIIGCNfBwLv49bhabbc0keH
70
+ swapfree => 1.03 GB
71
+ swapfree_mb => 1056.00
72
+ swapsize => 1.03 GB
73
+ swapsize_mb => 1056.00
74
+ system_uptime => {"seconds"=>348, "hours"=>0, "days"=>0, "uptime"=>"0:05 hours"}
75
+ timezone => UTC
76
+ type => Other
77
+ uniqueid => 007f0100
78
+ uptime => 0:05 hours
79
+ uptime_days => 0
80
+ uptime_hours => 0
81
+ uptime_seconds => 348
82
+ uuid => C9C5FDC4-1926-4244-A427-FC285D756B5E
83
+ virtual => virtualbox
@@ -3,19 +3,32 @@ require 'json'
3
3
 
4
4
  module RspecPuppetFacts
5
5
 
6
- def on_supported_os(supported_os = RspecPuppetFacts.meta_supported_os)
6
+ def on_supported_os(
7
+ opts = {
8
+ :hardwaremodels => ['x86_64'],
9
+ :supported_os => RspecPuppetFacts.meta_supported_os,
10
+ }
11
+ )
7
12
  h = {}
8
- supported_os.map do |os_sup|
9
- facts = {}
10
- # TODO: use SemVer here
11
- facter_minor_version = Facter.version[0..2]
12
- file = File.expand_path(File.join(File.dirname(__FILE__), "../facts/#{facter_minor_version}/#{os_sup}.facts"))
13
- File.read(file).each_line do |line|
14
- key, value = line.split(' => ')
15
- facts[key.to_sym] = value.chomp unless value.nil?
13
+
14
+ opts[:supported_os].map do |os_sup|
15
+ operatingsystem = os_sup['operatingsystem'].downcase
16
+ os_sup['operatingsystemrelease'].map do |operatingsystemmajrelease|
17
+ opts[:hardwaremodels].each do |hardwaremodel|
18
+ facts = {}
19
+ os = "#{operatingsystem}-#{operatingsystemmajrelease}-#{hardwaremodel}"
20
+ # TODO: use SemVer here
21
+ facter_minor_version = Facter.version[0..2]
22
+ file = File.expand_path(File.join(File.dirname(__FILE__), "../facts/#{facter_minor_version}/#{os}.facts"))
23
+ File.read(file).each_line do |line|
24
+ key, value = line.split(' => ')
25
+ facts[key.to_sym] = value.chomp unless value.nil?
26
+ end
27
+ h[os] = facts
28
+ end
16
29
  end
17
- h[os_sup] = facts
18
30
  end
31
+
19
32
  h
20
33
  end
21
34
 
@@ -24,44 +37,13 @@ module RspecPuppetFacts
24
37
  @meta_supported_os ||= get_meta_supported_os
25
38
  end
26
39
 
27
- # @api private
28
- def self.meta_to_facts(input)
29
- meta_to_facts = {
30
- 'RedHat' => 'redhat',
31
- 'CentOS' => 'centos',
32
- 'Ubuntu' => 'ubuntu',
33
- 'OracleLinux' => 'oracle',
34
- 'SLES' => 'sles',
35
- 'Scientific' => 'scientific',
36
- 'Debian' => 'debian',
37
- 'Fedora' => 'fedora',
38
- }
39
- ans = meta_to_facts[input]
40
- if ans
41
- ans
42
- else
43
- input
44
- end
45
- end
46
-
47
40
  # @api private
48
41
  def self.get_meta_supported_os
49
42
  metadata = get_metadata
50
43
  if metadata['operatingsystem_support'].nil?
51
44
  fail StandardError, "Unknown operatingsystem support"
52
45
  end
53
- os_sup = metadata['operatingsystem_support']
54
-
55
- os_sup.collect do |os_rel|
56
- os = meta_to_facts(os_rel['operatingsystem'])
57
- os_rel['operatingsystemrelease'].collect do |release|
58
- rel = meta_to_facts(release)
59
- [
60
- "#{os}-#{rel}-i386",
61
- "#{os}-#{rel}-x86_64"
62
- ]
63
- end
64
- end.flatten
46
+ metadata['operatingsystem_support']
65
47
  end
66
48
 
67
49
  # @api private
@@ -1,5 +1,5 @@
1
1
  module RspecPuppetFacts
2
2
  module Version
3
- STRING = '0.1.5'
3
+ STRING = '0.2.0'
4
4
  end
5
5
  end
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: 0.1.5
4
+ version: 0.2.0
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: 2014-12-12 00:00:00.000000000 Z
11
+ date: 2014-12-15 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Contains facts from many Facter version on many Operating Systems
14
14
  email:
@@ -34,6 +34,12 @@ files:
34
34
  - facts/1.6/debian-7-x86_64.facts
35
35
  - facts/1.6/fedora-19-i386.facts
36
36
  - facts/1.6/fedora-19-x86_64.facts
37
+ - facts/1.6/oraclelinux-5-i386.facts
38
+ - facts/1.6/oraclelinux-5-x86_64.facts
39
+ - facts/1.6/oraclelinux-6-i386.facts
40
+ - facts/1.6/oraclelinux-6-x86_64.facts
41
+ - facts/1.6/oraclelinux-7-i386.facts
42
+ - facts/1.6/oraclelinux-7-x86_64.facts
37
43
  - facts/1.6/redhat-5-i386.facts
38
44
  - facts/1.6/redhat-5-x86_64.facts
39
45
  - facts/1.6/redhat-6-i386.facts
@@ -62,6 +68,12 @@ files:
62
68
  - facts/1.7/debian-7-x86_64.facts
63
69
  - facts/1.7/fedora-19-i386.facts
64
70
  - facts/1.7/fedora-19-x86_64.facts
71
+ - facts/1.7/oraclelinux-5-i386.facts
72
+ - facts/1.7/oraclelinux-5-x86_64.facts
73
+ - facts/1.7/oraclelinux-6-i386.facts
74
+ - facts/1.7/oraclelinux-6-x86_64.facts
75
+ - facts/1.7/oraclelinux-7-i386.facts
76
+ - facts/1.7/oraclelinux-7-x86_64.facts
65
77
  - facts/1.7/redhat-5-i386.facts
66
78
  - facts/1.7/redhat-5-x86_64.facts
67
79
  - facts/1.7/redhat-6-i386.facts
@@ -90,6 +102,12 @@ files:
90
102
  - facts/2.0/debian-7-x86_64.facts
91
103
  - facts/2.0/fedora-19-i386.facts
92
104
  - facts/2.0/fedora-19-x86_64.facts
105
+ - facts/2.0/oraclelinux-5-i386.facts
106
+ - facts/2.0/oraclelinux-5-x86_64.facts
107
+ - facts/2.0/oraclelinux-6-i386.facts
108
+ - facts/2.0/oraclelinux-6-x86_64.facts
109
+ - facts/2.0/oraclelinux-7-i386.facts
110
+ - facts/2.0/oraclelinux-7-x86_64.facts
93
111
  - facts/2.0/redhat-5-i386.facts
94
112
  - facts/2.0/redhat-5-x86_64.facts
95
113
  - facts/2.0/redhat-6-i386.facts
@@ -118,6 +136,12 @@ files:
118
136
  - facts/2.1/debian-7-x86_64.facts
119
137
  - facts/2.1/fedora-19-i386.facts
120
138
  - facts/2.1/fedora-19-x86_64.facts
139
+ - facts/2.1/oraclelinux-5-i386.facts
140
+ - facts/2.1/oraclelinux-5-x86_64.facts
141
+ - facts/2.1/oraclelinux-6-i386.facts
142
+ - facts/2.1/oraclelinux-6-x86_64.facts
143
+ - facts/2.1/oraclelinux-7-i386.facts
144
+ - facts/2.1/oraclelinux-7-x86_64.facts
121
145
  - facts/2.1/redhat-5-i386.facts
122
146
  - facts/2.1/redhat-5-x86_64.facts
123
147
  - facts/2.1/redhat-6-i386.facts
@@ -146,6 +170,12 @@ files:
146
170
  - facts/2.2/debian-7-x86_64.facts
147
171
  - facts/2.2/fedora-19-i386.facts
148
172
  - facts/2.2/fedora-19-x86_64.facts
173
+ - facts/2.2/oraclelinux-5-i386.facts
174
+ - facts/2.2/oraclelinux-5-x86_64.facts
175
+ - facts/2.2/oraclelinux-6-i386.facts
176
+ - facts/2.2/oraclelinux-6-x86_64.facts
177
+ - facts/2.2/oraclelinux-7-i386.facts
178
+ - facts/2.2/oraclelinux-7-x86_64.facts
149
179
  - facts/2.2/redhat-5-i386.facts
150
180
  - facts/2.2/redhat-5-x86_64.facts
151
181
  - facts/2.2/redhat-6-i386.facts
@@ -174,6 +204,12 @@ files:
174
204
  - facts/2.3/debian-7-x86_64.facts
175
205
  - facts/2.3/fedora-19-i386.facts
176
206
  - facts/2.3/fedora-19-x86_64.facts
207
+ - facts/2.3/oraclelinux-5-i386.facts
208
+ - facts/2.3/oraclelinux-5-x86_64.facts
209
+ - facts/2.3/oraclelinux-6-i386.facts
210
+ - facts/2.3/oraclelinux-6-x86_64.facts
211
+ - facts/2.3/oraclelinux-7-i386.facts
212
+ - facts/2.3/oraclelinux-7-x86_64.facts
177
213
  - facts/2.3/redhat-5-i386.facts
178
214
  - facts/2.3/redhat-5-x86_64.facts
179
215
  - facts/2.3/redhat-6-i386.facts