fauxhai 3.5.0 → 3.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (139) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +41 -13
  3. data/lib/fauxhai/platforms/aix/6.1.json +8 -5
  4. data/lib/fauxhai/platforms/aix/7.1.json +8 -7
  5. data/lib/fauxhai/platforms/amazon/2012.09.json +8 -5
  6. data/lib/fauxhai/platforms/amazon/2013.09.json +8 -5
  7. data/lib/fauxhai/platforms/amazon/2014.03.json +8 -5
  8. data/lib/fauxhai/platforms/amazon/2014.09.json +8 -5
  9. data/lib/fauxhai/platforms/amazon/2015.03.json +8 -5
  10. data/lib/fauxhai/platforms/amazon/2015.09.json +8 -5
  11. data/lib/fauxhai/platforms/amazon/2016.03.json +8 -5
  12. data/lib/fauxhai/platforms/arch/3.10.5-1-ARCH.json +8 -8
  13. data/lib/fauxhai/platforms/arch/4.5.4-1-ARCH.json +8 -5
  14. data/lib/fauxhai/platforms/centos/5.0.json +8 -5
  15. data/lib/fauxhai/platforms/centos/5.1.json +8 -5
  16. data/lib/fauxhai/platforms/centos/5.10.json +8 -5
  17. data/lib/fauxhai/platforms/centos/5.11.json +8 -5
  18. data/lib/fauxhai/platforms/centos/5.2.json +8 -5
  19. data/lib/fauxhai/platforms/centos/5.3.json +8 -5
  20. data/lib/fauxhai/platforms/centos/5.4.json +8 -5
  21. data/lib/fauxhai/platforms/centos/5.5.json +8 -5
  22. data/lib/fauxhai/platforms/centos/5.6.json +8 -5
  23. data/lib/fauxhai/platforms/centos/5.7.json +8 -5
  24. data/lib/fauxhai/platforms/centos/5.8.json +8 -5
  25. data/lib/fauxhai/platforms/centos/5.9.json +8 -5
  26. data/lib/fauxhai/platforms/centos/6.0.json +8 -5
  27. data/lib/fauxhai/platforms/centos/6.1.json +8 -5
  28. data/lib/fauxhai/platforms/centos/6.2.json +8 -5
  29. data/lib/fauxhai/platforms/centos/6.3.json +8 -5
  30. data/lib/fauxhai/platforms/centos/6.4.json +8 -5
  31. data/lib/fauxhai/platforms/centos/6.5.json +8 -5
  32. data/lib/fauxhai/platforms/centos/6.6.json +8 -5
  33. data/lib/fauxhai/platforms/centos/6.7.json +8 -5
  34. data/lib/fauxhai/platforms/centos/6.8.json +8 -5
  35. data/lib/fauxhai/platforms/centos/7.0.1406.json +8 -5
  36. data/lib/fauxhai/platforms/centos/7.0.json +8 -5
  37. data/lib/fauxhai/platforms/centos/7.1.1503.json +8 -5
  38. data/lib/fauxhai/platforms/centos/7.2.1511.json +8 -5
  39. data/lib/fauxhai/platforms/debian/6.0.5.json +10 -6
  40. data/lib/fauxhai/platforms/debian/7.0.json +10 -6
  41. data/lib/fauxhai/platforms/debian/7.1.json +10 -7
  42. data/lib/fauxhai/platforms/debian/7.10.json +8 -5
  43. data/lib/fauxhai/platforms/debian/7.2.json +8 -5
  44. data/lib/fauxhai/platforms/debian/7.4.json +8 -5
  45. data/lib/fauxhai/platforms/debian/7.5.json +8 -5
  46. data/lib/fauxhai/platforms/debian/7.6.json +8 -5
  47. data/lib/fauxhai/platforms/debian/7.7.json +8 -5
  48. data/lib/fauxhai/platforms/debian/7.8.json +8 -5
  49. data/lib/fauxhai/platforms/debian/7.9.json +8 -5
  50. data/lib/fauxhai/platforms/debian/8.0.json +8 -5
  51. data/lib/fauxhai/platforms/debian/8.1.json +8 -5
  52. data/lib/fauxhai/platforms/debian/8.2.json +8 -5
  53. data/lib/fauxhai/platforms/debian/8.4.json +8 -5
  54. data/lib/fauxhai/platforms/debian/jessie/sid.json +8 -5
  55. data/lib/fauxhai/platforms/debian/stretch/sid.json +8 -5
  56. data/lib/fauxhai/platforms/dragonfly4/4.2-RELEASE.json +8 -5
  57. data/lib/fauxhai/platforms/fedora/18.json +8 -5
  58. data/lib/fauxhai/platforms/fedora/19.json +8 -5
  59. data/lib/fauxhai/platforms/fedora/20.json +8 -5
  60. data/lib/fauxhai/platforms/fedora/21.json +8 -5
  61. data/lib/fauxhai/platforms/fedora/22.json +8 -5
  62. data/lib/fauxhai/platforms/fedora/23.json +8 -5
  63. data/lib/fauxhai/platforms/freebsd/10.0.json +9 -5
  64. data/lib/fauxhai/platforms/freebsd/10.1.json +9 -5
  65. data/lib/fauxhai/platforms/freebsd/10.2.json +9 -5
  66. data/lib/fauxhai/platforms/freebsd/10.3.json +8 -5
  67. data/lib/fauxhai/platforms/freebsd/8.4.json +9 -5
  68. data/lib/fauxhai/platforms/freebsd/9.1.json +9 -5
  69. data/lib/fauxhai/platforms/freebsd/9.2.json +9 -5
  70. data/lib/fauxhai/platforms/freebsd/9.3.json +9 -5
  71. data/lib/fauxhai/platforms/gentoo/2.1.json +10 -6
  72. data/lib/fauxhai/platforms/gentoo/2.2.json +8 -5
  73. data/lib/fauxhai/platforms/ios_xr/6.0.0.14I.json +8 -5
  74. data/lib/fauxhai/platforms/mac_os_x/10.10.json +8 -7
  75. data/lib/fauxhai/platforms/mac_os_x/10.11.1.json +8 -5
  76. data/lib/fauxhai/platforms/mac_os_x/10.6.8.json +10 -6
  77. data/lib/fauxhai/platforms/mac_os_x/10.7.4.json +10 -6
  78. data/lib/fauxhai/platforms/mac_os_x/10.8.2.json +10 -6
  79. data/lib/fauxhai/platforms/mac_os_x/10.9.2.json +7 -4
  80. data/lib/fauxhai/platforms/nexus/5.json +8 -5
  81. data/lib/fauxhai/platforms/omnios/151002.json +10 -6
  82. data/lib/fauxhai/platforms/omnios/151006.json +8 -5
  83. data/lib/fauxhai/platforms/omnios/151008.json +8 -5
  84. data/lib/fauxhai/platforms/omnios/151014.json +8 -5
  85. data/lib/fauxhai/platforms/omnios/151018.json +8 -5
  86. data/lib/fauxhai/platforms/openbsd/5.4.json +8 -5
  87. data/lib/fauxhai/platforms/opensuse/12.3.json +8 -5
  88. data/lib/fauxhai/platforms/opensuse/13.1.json +8 -5
  89. data/lib/fauxhai/platforms/opensuse/13.2.json +8 -5
  90. data/lib/fauxhai/platforms/opensuse/42.1.json +8 -5
  91. data/lib/fauxhai/platforms/oracle/5.10.json +8 -5
  92. data/lib/fauxhai/platforms/oracle/6.5.json +8 -5
  93. data/lib/fauxhai/platforms/oracle/6.6.json +8 -5
  94. data/lib/fauxhai/platforms/oracle/7.0.json +8 -5
  95. data/lib/fauxhai/platforms/oracle/7.1.json +8 -5
  96. data/lib/fauxhai/platforms/redhat/5.10.json +8 -5
  97. data/lib/fauxhai/platforms/redhat/5.6.json +8 -5
  98. data/lib/fauxhai/platforms/redhat/5.7.json +8 -5
  99. data/lib/fauxhai/platforms/redhat/5.8.json +10 -6
  100. data/lib/fauxhai/platforms/redhat/5.9.json +8 -5
  101. data/lib/fauxhai/platforms/redhat/6.0.json +8 -5
  102. data/lib/fauxhai/platforms/redhat/6.1.json +8 -5
  103. data/lib/fauxhai/platforms/redhat/6.2.json +8 -5
  104. data/lib/fauxhai/platforms/redhat/6.3.json +8 -5
  105. data/lib/fauxhai/platforms/redhat/6.4.json +8 -5
  106. data/lib/fauxhai/platforms/redhat/6.5.json +8 -5
  107. data/lib/fauxhai/platforms/redhat/6.6.json +8 -5
  108. data/lib/fauxhai/platforms/redhat/7.0.json +8 -5
  109. data/lib/fauxhai/platforms/redhat/7.1.json +8 -5
  110. data/lib/fauxhai/platforms/slackware/14.1.json +8 -8
  111. data/lib/fauxhai/platforms/smartos/5.11.json +8 -5
  112. data/lib/fauxhai/platforms/smartos/joyent_20130111T180733Z.json +9 -5
  113. data/lib/fauxhai/platforms/solaris2/5.10.json +8 -5
  114. data/lib/fauxhai/platforms/solaris2/5.11.json +8 -5
  115. data/lib/fauxhai/platforms/suse/11.1.json +8 -5
  116. data/lib/fauxhai/platforms/suse/11.2.json +8 -5
  117. data/lib/fauxhai/platforms/suse/11.3.json +8 -5
  118. data/lib/fauxhai/platforms/suse/12.0.json +8 -5
  119. data/lib/fauxhai/platforms/ubuntu/10.04.json +10 -6
  120. data/lib/fauxhai/platforms/ubuntu/12.04.json +8 -5
  121. data/lib/fauxhai/platforms/ubuntu/13.04.json +10 -6
  122. data/lib/fauxhai/platforms/ubuntu/13.10.json +8 -5
  123. data/lib/fauxhai/platforms/ubuntu/14.04.json +8 -5
  124. data/lib/fauxhai/platforms/ubuntu/14.10.json +8 -6
  125. data/lib/fauxhai/platforms/ubuntu/15.04.json +8 -5
  126. data/lib/fauxhai/platforms/ubuntu/15.10.json +8 -5
  127. data/lib/fauxhai/platforms/ubuntu/16.04.json +8 -5
  128. data/lib/fauxhai/platforms/windows/10.json +92 -27
  129. data/lib/fauxhai/platforms/windows/2003R2.json +92 -28
  130. data/lib/fauxhai/platforms/windows/2008R2.json +92 -27
  131. data/lib/fauxhai/platforms/windows/2012.json +92 -27
  132. data/lib/fauxhai/platforms/windows/2012R2.json +92 -27
  133. data/lib/fauxhai/platforms/windows/8.1.json +92 -27
  134. data/lib/fauxhai/platforms/windows/8.json +92 -27
  135. data/lib/fauxhai/runner.rb +9 -234
  136. data/lib/fauxhai/runner/default.rb +240 -0
  137. data/lib/fauxhai/runner/windows.rb +101 -0
  138. data/lib/fauxhai/version.rb +1 -1
  139. metadata +4 -2
@@ -0,0 +1,240 @@
1
+ module Fauxhai
2
+ class Runner
3
+ module Default
4
+ def bin_dir
5
+ '/usr/local/bin'
6
+ end
7
+
8
+ def chef_packages
9
+ return {} if @system.data['chef_packages'].nil?
10
+
11
+ chef_version = @system.data['chef_packages']['chef']['version']
12
+ ohai_version = @system.data['chef_packages']['ohai']['version']
13
+
14
+ {
15
+ 'chef' => {
16
+ 'version' => chef_version,
17
+ 'chef_root' => ['/opt/chef/embedded/lib/ruby/gems/2.1.0/gems', "chef-#{chef_version}", 'lib'].join('/')
18
+ },
19
+ 'ohai' => {
20
+ 'version' => ohai_version,
21
+ 'ohai_root' => ['/opt/chef/embedded/lib/ruby/gems/2.1.0/gems', "ohai-#{ohai_version}", 'lib', 'ohai'].join('/')
22
+ }
23
+ }
24
+ end
25
+
26
+ def counters
27
+ {
28
+ 'network' => {
29
+ 'interfaces' => {
30
+ 'eth0' => {
31
+ 'rx' => {
32
+ 'bytes' => '0',
33
+ 'packets' => '0',
34
+ 'errors' => '0',
35
+ 'drop' => 0,
36
+ 'overrun' => 0,
37
+ 'frame' => 0,
38
+ 'compressed' => 0,
39
+ 'multicast' => 0
40
+ },
41
+ 'tx' => {
42
+ 'bytes' => '342',
43
+ 'packets' => '0',
44
+ 'errors' => '0',
45
+ 'drop' => 0,
46
+ 'overrun' => 0,
47
+ 'collisions' => '0',
48
+ 'carrier' => 0,
49
+ 'compressed' => 0
50
+ }
51
+ }
52
+ }
53
+ }
54
+ }
55
+ end
56
+
57
+ def current_user
58
+ 'fauxhai'
59
+ end
60
+
61
+ def default_gateway
62
+ '10.0.0.1'
63
+ end
64
+
65
+ def default_interface
66
+ 'eth0'
67
+ end
68
+
69
+ def domain
70
+ 'local'
71
+ end
72
+
73
+ def etc
74
+ {
75
+ 'passwd' => {
76
+ 'fauxhai' => {
77
+ 'dir' => '/home/fauxhai',
78
+ 'gid' => 0,
79
+ 'uid' => 0,
80
+ 'shell' => '/bin/bash',
81
+ 'gecos' => 'Fauxhai'
82
+ }
83
+ },
84
+ 'group' => {
85
+ 'fauxhai' => {
86
+ 'gid' => 0,
87
+ 'members' => [
88
+ 'fauxhai'
89
+ ]
90
+ }
91
+ }
92
+ }
93
+ end
94
+
95
+ def fqdn
96
+ 'fauxhai.local'
97
+ end
98
+
99
+ def gem_bin
100
+ '/usr/local/bin/gem'
101
+ end
102
+
103
+ def gems_dir
104
+ '/usr/local/gems'
105
+ end
106
+
107
+ def hostname
108
+ 'Fauxhai'
109
+ end
110
+
111
+ def ipaddress
112
+ '10.0.0.2'
113
+ end
114
+
115
+ def ip6address
116
+ 'fe80:0:0:0:0:0:a00:2'
117
+ end
118
+
119
+ def keys
120
+ {
121
+ 'ssh' => ssh
122
+ }
123
+ end
124
+
125
+ def languages
126
+ {
127
+ 'ruby' => @system.data['languages']['ruby'].merge('bin_dir' => bin_dir,
128
+ 'gem_bin' => gem_bin,
129
+ 'gems_dir' => gems_dir,
130
+ 'ruby_bin' => ruby_bin),
131
+ 'powershell' => @system.data['languages']['powershell']
132
+ }
133
+ end
134
+
135
+ def macaddress
136
+ '11:11:11:11:11:11'
137
+ end
138
+
139
+ def network
140
+ {
141
+ 'default_gateway' => default_gateway,
142
+ 'default_interface' => default_interface,
143
+ 'settings' => {},
144
+ 'interfaces' => {
145
+ "#{default_interface}" => {
146
+ 'addresses' => {
147
+ "#{ipaddress}" => {
148
+ 'broadcast' => '10.0.0.255',
149
+ 'family' => 'inet',
150
+ 'netmask' => '255.255.255.0',
151
+ 'prefixlen' => '24',
152
+ 'scope' => 'Global'
153
+ }
154
+ },
155
+ 'arp' => {
156
+ '10.0.0.1' => 'fe:ff:ff:ff:ff:ff'
157
+ },
158
+ 'encapsulation' => 'Ethernet',
159
+ 'flags' => %w(BROADCAST MULTICAST UP LOWER_UP),
160
+ 'mtu' => '1500',
161
+ 'number' => '0',
162
+ 'routes' => [
163
+ {
164
+ 'destination' => '10.0.0.0/24',
165
+ 'family' => 'inet',
166
+ 'scope' => 'link',
167
+ 'proto' => 'kernel',
168
+ 'src' => ipaddress,
169
+ },
170
+ ],
171
+ 'state' => 'up',
172
+ 'type' => 'eth'
173
+ }
174
+ }
175
+ }
176
+ end
177
+
178
+ def ruby_bin
179
+ '/usr/local/bin/ruby'
180
+ end
181
+
182
+ def ssh
183
+ {
184
+ 'host_dsa_public' => File.read( File.join(Fauxhai.root, 'lib', 'fauxhai', 'keys', 'id_dsa.pub') ).strip,
185
+ 'host_rsa_public' => File.read( File.join(Fauxhai.root, 'lib', 'fauxhai', 'keys', 'id_rsa.pub') ).strip
186
+ }
187
+ end
188
+
189
+ def uptime
190
+ '30 days 15 hours 07 minutes 30 seconds'
191
+ end
192
+
193
+ def uptime_seconds
194
+ 2646450
195
+ end
196
+
197
+ def cpu
198
+ {
199
+ 'real' => 1,
200
+ 'total' => 1,
201
+ 'cores' => 1
202
+ }
203
+ end
204
+
205
+ def memory
206
+ {
207
+ 'total' => '1048576kB'
208
+ }
209
+ end
210
+
211
+ def virtualization
212
+ {
213
+ 'systems' => {}
214
+ }
215
+ end
216
+
217
+ # Whitelist attributes are attributes that we *actually* want from the node. Other attributes are
218
+ # either ignored or overridden, but we ensure these are returned with the command.
219
+ #
220
+ # @return [Array] - the key of whitelisted attributes
221
+ def whitelist_attributes
222
+ %w(
223
+ command
224
+ dmi
225
+ filesystem
226
+ kernel
227
+ lsb
228
+ ohai_time
229
+ os
230
+ os_version
231
+ platform
232
+ platform_version
233
+ platform_build
234
+ platform_family
235
+ init_package
236
+ root_group)
237
+ end
238
+ end
239
+ end
240
+ end
@@ -0,0 +1,101 @@
1
+ module Fauxhai
2
+ class Runner
3
+ module Windows
4
+ require 'fauxhai/runner/default'
5
+ include ::Fauxhai::Runner::Default
6
+
7
+ def default_interface
8
+ '0xe'
9
+ end
10
+
11
+ def network
12
+ {
13
+ 'interfaces' => {
14
+ "#{default_interface}" => {
15
+ 'configuration' => {
16
+ 'caption' => '[00000012] Ethernet Adapter',
17
+ 'database_path' => '%SystemRoot%\\System32\\drivers\\etc',
18
+ 'default_ip_gateway' => %w(default_gateway),
19
+ 'description' => 'Ethernet Adapter',
20
+ 'dhcp_enabled' => false,
21
+ 'dns_domain_suffix_search_order' => [],
22
+ 'dns_enabled_for_wins_resolution' => false,
23
+ 'dns_host_name' => hostname,
24
+ 'domain_dns_registration_enabled' => false,
25
+ 'full_dns_registration_enabled' => true,
26
+ 'gateway_cost_metric' => [0],
27
+ 'index' => 12,
28
+ 'interface_index' => 14,
29
+ 'ip_address' => [ipaddress],
30
+ 'ip_connection_metric' => 5,
31
+ 'ip_enabled' => true,
32
+ 'ip_filter_security_enabled' => false,
33
+ 'ip_sec_permit_ip_protocols' => [],
34
+ 'ip_sec_permit_tcp_ports' => [],
35
+ 'ip_sec_permit_udp_ports' => [],
36
+ 'ip_subnet' => %w(255.255.255.0 64),
37
+ 'mac_address' => macaddress,
38
+ 'service_name' => 'netkvm',
39
+ 'setting_id' => '{00000000-0000-0000-0000-000000000000}',
40
+ 'tcpip_netbios_options' => 0,
41
+ 'tcp_window_size' => 64240,
42
+ 'wins_enable_lm_hosts_lookup' => true,
43
+ 'wins_scope_id' => '',
44
+ },
45
+ 'instance' => {
46
+ 'adapter_type' => 'Ethernet 802.3',
47
+ 'adapter_type_id' => 0,
48
+ 'availability' => 3,
49
+ 'caption' => '[00000012] Ethernet Adapter',
50
+ 'config_manager_error_code' => 0,
51
+ 'config_manager_user_config' => false,
52
+ 'creation_class_name' => 'Win32_NetworkAdapter',
53
+ 'description' => 'Ethernet Adapter',
54
+ 'device_id' => '12',
55
+ 'guid' => '{00000000-0000-0000-0000-000000000000}',
56
+ 'index' => 12,
57
+ 'installed' => true,
58
+ 'interface_index' => 14,
59
+ 'mac_address' => macaddress,
60
+ 'manufacturer' => '',
61
+ 'max_number_controlled' => 0,
62
+ 'name' => 'Ethernet Adapter',
63
+ 'net_connection_id' => 'Ethernet',
64
+ 'net_connection_status' => 2,
65
+ 'net_enabled' => true,
66
+ 'physical_adapter' => true,
67
+ 'pnp_device_id' => 'PCI\\VEN_0000&DEV_0000&SUBSYS_000000000&REV_00\\0&0000000000&00',
68
+ 'power_management_supported' => false,
69
+ 'product_name' => 'Ethernet Adapter',
70
+ 'service_name' => 'netkvm',
71
+ 'speed' => '10000000000',
72
+ 'system_creation_class_name' => 'Win32_ComputerSystem',
73
+ 'system_name' => hostname,
74
+ 'time_of_last_reset' => '20000101000001.000000+000'
75
+ },
76
+ 'counters' => {},
77
+ 'addresses' => {
78
+ "#{ipaddress}" => {
79
+ 'prefixlen' => '24',
80
+ 'netmask' => '255.255.255.0',
81
+ 'broadcast' => '10.0.0.255',
82
+ 'family' => 'inet'
83
+ },
84
+ "#{macaddress}" => {
85
+ 'family' => 'lladdr'
86
+ }
87
+ },
88
+ 'type' => 'Ethernet 802.3',
89
+ 'arp' => {
90
+ '10.0.0.1' => 'fe:ff:ff:ff:ff:ff'
91
+ },
92
+ 'encapsulation' => 'Ethernet'
93
+ }
94
+ },
95
+ 'default_gateway' => default_gateway,
96
+ 'default_interface' => default_interface
97
+ }
98
+ end
99
+ end
100
+ end
101
+ end
@@ -1,3 +1,3 @@
1
1
  module Fauxhai
2
- VERSION = '3.5.0'
2
+ VERSION = '3.6.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fauxhai
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.0
4
+ version: 3.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seth Vargo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-31 00:00:00.000000000 Z
11
+ date: 2016-06-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-ssh
@@ -228,6 +228,8 @@ files:
228
228
  - lib/fauxhai/platforms/windows/8.1.json
229
229
  - lib/fauxhai/platforms/windows/8.json
230
230
  - lib/fauxhai/runner.rb
231
+ - lib/fauxhai/runner/default.rb
232
+ - lib/fauxhai/runner/windows.rb
231
233
  - lib/fauxhai/version.rb
232
234
  - tmp/.gitkeep
233
235
  homepage: https://github.com/customink/fauxhai