foreman_discovery 16.1.4 → 16.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/api/v2/discovered_hosts_controller.rb +3 -10
  3. data/app/models/host/discovered.rb +10 -14
  4. data/app/models/setting/discovered.rb +3 -1
  5. data/app/services/foreman_discovery/host_fact_importer.rb +10 -0
  6. data/app/views/foreman_discovery/debian_kexec.erb +2 -1
  7. data/app/views/foreman_discovery/redhat_kexec.erb +2 -1
  8. data/lib/foreman_discovery/engine.rb +1 -1
  9. data/lib/foreman_discovery/version.rb +1 -1
  10. data/locale/ca/LC_MESSAGES/foreman_discovery.mo +0 -0
  11. data/locale/ca/foreman_discovery.edit.po +67 -99
  12. data/locale/ca/foreman_discovery.po +1 -1
  13. data/locale/de/LC_MESSAGES/foreman_discovery.mo +0 -0
  14. data/locale/de/foreman_discovery.edit.po +71 -103
  15. data/locale/de/foreman_discovery.po +1 -1
  16. data/locale/en/LC_MESSAGES/foreman_discovery.mo +0 -0
  17. data/locale/en/foreman_discovery.edit.po +65 -97
  18. data/locale/en/foreman_discovery.po +1 -1
  19. data/locale/en_GB/LC_MESSAGES/foreman_discovery.mo +0 -0
  20. data/locale/en_GB/foreman_discovery.edit.po +70 -102
  21. data/locale/en_GB/foreman_discovery.po +1 -1
  22. data/locale/es/LC_MESSAGES/foreman_discovery.mo +0 -0
  23. data/locale/es/foreman_discovery.edit.po +94 -128
  24. data/locale/es/foreman_discovery.po +1 -1
  25. data/locale/foreman_discovery.pot +85 -85
  26. data/locale/fr/LC_MESSAGES/foreman_discovery.mo +0 -0
  27. data/locale/fr/foreman_discovery.edit.po +102 -134
  28. data/locale/fr/foreman_discovery.po +1 -1
  29. data/locale/gl/LC_MESSAGES/foreman_discovery.mo +0 -0
  30. data/locale/gl/foreman_discovery.edit.po +66 -98
  31. data/locale/gl/foreman_discovery.po +1 -1
  32. data/locale/it/LC_MESSAGES/foreman_discovery.mo +0 -0
  33. data/locale/it/foreman_discovery.edit.po +71 -103
  34. data/locale/it/foreman_discovery.po +1 -1
  35. data/locale/ja/LC_MESSAGES/foreman_discovery.mo +0 -0
  36. data/locale/ja/foreman_discovery.edit.po +107 -137
  37. data/locale/ja/foreman_discovery.po +1 -1
  38. data/locale/ko/LC_MESSAGES/foreman_discovery.mo +0 -0
  39. data/locale/ko/foreman_discovery.edit.po +71 -103
  40. data/locale/ko/foreman_discovery.po +1 -1
  41. data/locale/pt_BR/LC_MESSAGES/foreman_discovery.mo +0 -0
  42. data/locale/pt_BR/foreman_discovery.edit.po +92 -127
  43. data/locale/pt_BR/foreman_discovery.po +1 -1
  44. data/locale/ru/LC_MESSAGES/foreman_discovery.mo +0 -0
  45. data/locale/ru/foreman_discovery.edit.po +71 -103
  46. data/locale/ru/foreman_discovery.po +1 -1
  47. data/locale/sv_SE/LC_MESSAGES/foreman_discovery.mo +0 -0
  48. data/locale/sv_SE/foreman_discovery.edit.po +67 -99
  49. data/locale/sv_SE/foreman_discovery.po +1 -1
  50. data/locale/zh_CN/LC_MESSAGES/foreman_discovery.mo +0 -0
  51. data/locale/zh_CN/foreman_discovery.edit.po +143 -172
  52. data/locale/zh_CN/foreman_discovery.po +1 -1
  53. data/locale/zh_TW/LC_MESSAGES/foreman_discovery.mo +0 -0
  54. data/locale/zh_TW/foreman_discovery.edit.po +71 -103
  55. data/locale/zh_TW/foreman_discovery.po +1 -1
  56. data/test/facts/only-ipv6.json +205 -0
  57. data/test/facts/skylake-ipv6.json +223 -0
  58. data/test/functional/api/v2/settings_controller_test.rb +2 -2
  59. data/test/unit/host_discovered_test.rb +0 -16
  60. metadata +19 -16
  61. data/test/facts/vmware-facter4-nolegacy.json +0 -402
@@ -0,0 +1,223 @@
1
+ {
2
+ "lib": "/usr/share/fdi/facts:/opt/extension/facts",
3
+ "processors": {
4
+ "models": [
5
+ "Intel Core Processor (Skylake, IBRS)",
6
+ "Intel Core Processor (Skylake, IBRS)"
7
+ ],
8
+ "count": 2,
9
+ "physicalcount": 2
10
+ },
11
+ "kernel": "Linux",
12
+ "ps": "ps -ef",
13
+ "partitions": {
14
+ "sda1": {
15
+ "size": "1228800",
16
+ "label": "EFI System Partition",
17
+ "filesystem": "vfat"
18
+ },
19
+ "sda2": {
20
+ "uuid": "825ebe27-ee98-4c32-8949-1ac200fc8b42",
21
+ "size": "2097152",
22
+ "filesystem": "xfs"
23
+ },
24
+ "sda3": {
25
+ "size": "38612992",
26
+ "filesystem": "LVM2_member"
27
+ }
28
+ },
29
+ "hostname": "fdi",
30
+ "blockdevice_sda_size": 21474836480,
31
+ "blockdevice_sda_vendor": "ATA",
32
+ "blockdevice_sda_model": "QEMU HARDDISK",
33
+ "blockdevices": "sda",
34
+ "architecture": "x86_64",
35
+ "hardwaremodel": "x86_64",
36
+ "operatingsystem": "CentOS",
37
+ "os": {
38
+ "name": "CentOS",
39
+ "family": "RedHat",
40
+ "release": {
41
+ "major": "7",
42
+ "minor": "8",
43
+ "full": "7.8.2003"
44
+ }
45
+ },
46
+ "processor0": "Intel Core Processor (Skylake, IBRS)",
47
+ "processor1": "Intel Core Processor (Skylake, IBRS)",
48
+ "processorcount": 2,
49
+ "uptime_days": 0,
50
+ "macaddress": "52:54:00:96:45:81",
51
+ "path": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/opt/extension/bin",
52
+ "uptime_hours": 0,
53
+ "rubyplatform": "x86_64-linux",
54
+ "netmask": "255.0.0.0",
55
+ "ipaddress6": "fd00:aaaa:bbbb:cc:5054:ff:fe96:4581",
56
+ "osfamily": "RedHat",
57
+ "kernelrelease": "3.10.0-1127.18.2.el7.x86_64",
58
+ "system_uptime": {
59
+ "seconds": 264,
60
+ "hours": 0,
61
+ "days": 0,
62
+ "uptime": "0:04 hours"
63
+ },
64
+ "bios_vendor": "EFI Development Kit II / OVMF",
65
+ "bios_version": "0.0.0",
66
+ "bios_release_date": "02/06/2015",
67
+ "manufacturer": "QEMU",
68
+ "productname": "Standard PC (Q35 + ICH9, 2009)",
69
+ "serialnumber": "Not Specified",
70
+ "uuid": "34c5be4a-2d35-4524-9471-3f7c73d1fe89",
71
+ "type": "Other",
72
+ "operatingsystemrelease": "7.8.2003",
73
+ "uptime": "0:04 hours",
74
+ "hardwareisa": "x86_64",
75
+ "virtual": "kvm",
76
+ "is_virtual": true,
77
+ "rubysitedir": "/usr/local/share/ruby/site_ruby/",
78
+ "id": "root",
79
+ "filesystems": "ext2,ext3,ext4,iso9660,squashfs",
80
+ "timezone": "UTC",
81
+ "uniqueid": "007f0200",
82
+ "sshrsakey": "AAAAB3NzaC1yc2EAAAADAQABAAABAQCiuXQicGounSVTpAIPhRkAA5ovVuLAzziUpNngr2yhb54khyzKbH51s0WDlCDXDN72vmqOK2fAUhpdRZJes/q1PAUk9BUnwpTDI2LYUhj9E0QA7GM/GxqWhrDRt/vG5WkuuUEZVKI4lyuLgGJ5fOn9p22VSHRl7PSmMfSehDPExlQWjffqwi4aKGkndRIY28IuZCWHebLno4diSkKoExin5XMc2HyGNikmPH5vwTD2HwKsHivNvmwYybpPBDmHm4n6uNvwCjr0a24JygU1fy3kFT6W/EEgEV72+J38zWwoEgAeGzca0O4mJy37xv9WBVao6mvLk1vnZRT13r4qneU5",
83
+ "sshfp_rsa": "SSHFP 1 1 df8461ddddf423f915f06f06740dad52677a9289\nSSHFP 1 2 f7f453d2bc934e235af1eab0cf0ce18fb31326475de513e0f4634b753b5cb4e8",
84
+ "sshecdsakey": "AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBDDMio789P5EtxntS/wCT/LzYaOEWJ3/TqvewlTzRYlf/zNOIlMGG12QTX1R8P2cus7K+fNWZzXZ3mdV5e/CQos=",
85
+ "sshfp_ecdsa": "SSHFP 3 1 7458744ef5488b42f08e9c506183eac9c9535ce4\nSSHFP 3 2 ee0568b1c150f62b72083674e1d88c5401156c592206ea9a16725d517f69b165",
86
+ "sshed25519key": "AAAAC3NzaC1lZDI1NTE5AAAAIGv5VKv1DuFxAWKvKozb0wYqUTESoCiOUUciHkgA6LFP",
87
+ "sshfp_ed25519": "SSHFP 4 1 4034bdf424c98467a9341f788baf11d31edf7852\nSSHFP 4 2 1c1da30f5991a573fc54ede288b53ff9494888e1eae5def0e2b3a76763a4fc46",
88
+ "network_lo": "127.0.0.0",
89
+ "physicalprocessorcount": 2,
90
+ "kernelmajversion": "3.10",
91
+ "fqdn": "fdi",
92
+ "kernelversion": "3.10.0",
93
+ "facterversion": "2.4.1",
94
+ "operatingsystemmajrelease": "7",
95
+ "interfaces": "eth0,lo",
96
+ "macaddress_eth0": "52:54:00:96:45:81",
97
+ "mtu_eth0": 1500,
98
+ "ipaddress_lo": "127.0.0.1",
99
+ "netmask_lo": "255.0.0.0",
100
+ "mtu_lo": 65536,
101
+ "gid": "root",
102
+ "memorysize": "1.95 GB",
103
+ "memoryfree": "1.74 GB",
104
+ "swapsize": "0.00 MB",
105
+ "swapfree": "0.00 MB",
106
+ "swapsize_mb": "0.00",
107
+ "swapfree_mb": "0.00",
108
+ "memorysize_mb": "1997.13",
109
+ "memoryfree_mb": "1784.67",
110
+ "selinux": false,
111
+ "rubyversion": "2.0.0",
112
+ "uptime_seconds": 264,
113
+ "efi": true,
114
+ "discovery_version": "3.6.5",
115
+ "discovery_release": "20200819.1",
116
+ "discovery_bootif": "52:54:00:96:45:81",
117
+ "link_eth0": "true",
118
+ "link_lo": "true",
119
+ "nmprimary_connection_id": "primary",
120
+ "nmprimary_connection_uuid": "d8651bb4-e2c3-11ea-816a-525400964581",
121
+ "nmprimary_connection_stable-id": "",
122
+ "nmprimary_connection_type": "802-3-ethernet",
123
+ "nmprimary_connection_interface-name": "",
124
+ "nmprimary_connection_autoconnect": "yes",
125
+ "nmprimary_connection_autoconnect-priority": "1",
126
+ "nmprimary_connection_autoconnect-retries": "-1",
127
+ "nmprimary_connection_multi-connect": "0",
128
+ "nmprimary_connection_auth-retries": "-1",
129
+ "nmprimary_connection_timestamp": "1597914143",
130
+ "nmprimary_connection_read-only": "no",
131
+ "nmprimary_connection_permissions": "",
132
+ "nmprimary_connection_zone": "",
133
+ "nmprimary_connection_master": "",
134
+ "nmprimary_connection_slave-type": "",
135
+ "nmprimary_connection_autoconnect-slaves": "-1",
136
+ "nmprimary_connection_secondaries": "",
137
+ "nmprimary_connection_gateway-ping-timeout": "0",
138
+ "nmprimary_connection_metered": "unknown",
139
+ "nmprimary_connection_lldp": "default",
140
+ "nmprimary_connection_mdns": "-1",
141
+ "nmprimary_connection_llmnr": "-1",
142
+ "nmprimary_802-3-ethernet_port": "",
143
+ "nmprimary_802-3-ethernet_speed": "0",
144
+ "nmprimary_802-3-ethernet_duplex": "",
145
+ "nmprimary_802-3-ethernet_auto-negotiate": "no",
146
+ "nmprimary_802-3-ethernet_mac-address": "52:54:00:96:45:81",
147
+ "nmprimary_802-3-ethernet_cloned-mac-address": "",
148
+ "nmprimary_802-3-ethernet_generate-mac-address-mask": "",
149
+ "nmprimary_802-3-ethernet_mac-address-blacklist": "",
150
+ "nmprimary_802-3-ethernet_mtu": "auto",
151
+ "nmprimary_802-3-ethernet_s390-subchannels": "",
152
+ "nmprimary_802-3-ethernet_s390-nettype": "",
153
+ "nmprimary_802-3-ethernet_s390-options": "",
154
+ "nmprimary_802-3-ethernet_wake-on-lan": "default",
155
+ "nmprimary_802-3-ethernet_wake-on-lan-password": "",
156
+ "nmprimary_ipv4_method": "auto",
157
+ "nmprimary_ipv4_dns": "",
158
+ "nmprimary_ipv4_dns-search": "",
159
+ "nmprimary_ipv4_dns-options": " ",
160
+ "nmprimary_ipv4_dns-priority": "0",
161
+ "nmprimary_ipv4_addresses": "",
162
+ "nmprimary_ipv4_gateway": "",
163
+ "nmprimary_ipv4_routes": "",
164
+ "nmprimary_ipv4_route-metric": "-1",
165
+ "nmprimary_ipv4_route-table": "0",
166
+ "nmprimary_ipv4_routing-rules": "",
167
+ "nmprimary_ipv4_ignore-auto-routes": "no",
168
+ "nmprimary_ipv4_ignore-auto-dns": "no",
169
+ "nmprimary_ipv4_dhcp-client-id": "",
170
+ "nmprimary_ipv4_dhcp-timeout": "300",
171
+ "nmprimary_ipv4_dhcp-send-hostname": "no",
172
+ "nmprimary_ipv4_dhcp-hostname": "",
173
+ "nmprimary_ipv4_dhcp-fqdn": "",
174
+ "nmprimary_ipv4_never-default": "no",
175
+ "nmprimary_ipv4_may-fail": "yes",
176
+ "nmprimary_ipv4_dad-timeout": "-1",
177
+ "nmprimary_ipv6_method": "auto",
178
+ "nmprimary_ipv6_dns": "",
179
+ "nmprimary_ipv6_dns-search": "",
180
+ "nmprimary_ipv6_dns-options": " ",
181
+ "nmprimary_ipv6_dns-priority": "0",
182
+ "nmprimary_ipv6_addresses": "",
183
+ "nmprimary_ipv6_gateway": "",
184
+ "nmprimary_ipv6_routes": "",
185
+ "nmprimary_ipv6_route-metric": "-1",
186
+ "nmprimary_ipv6_route-table": "0",
187
+ "nmprimary_ipv6_routing-rules": "",
188
+ "nmprimary_ipv6_ignore-auto-routes": "no",
189
+ "nmprimary_ipv6_ignore-auto-dns": "no",
190
+ "nmprimary_ipv6_never-default": "no",
191
+ "nmprimary_ipv6_may-fail": "yes",
192
+ "nmprimary_ipv6_ip6-privacy": "-1",
193
+ "nmprimary_ipv6_addr-gen-mode": "eui64",
194
+ "nmprimary_ipv6_dhcp-duid": "",
195
+ "nmprimary_ipv6_dhcp-send-hostname": "yes",
196
+ "nmprimary_ipv6_dhcp-hostname": "",
197
+ "nmprimary_ipv6_token": "",
198
+ "nmprimary_vlan_parent": "",
199
+ "nmprimary_vlan_id": "0",
200
+ "nmprimary_vlan_flags": "1",
201
+ "nmprimary_vlan_ingress-priority-map": "",
202
+ "nmprimary_vlan_egress-priority-map": "",
203
+ "nmprimary_proxy_method": "none",
204
+ "nmprimary_proxy_browser-only": "no",
205
+ "nmprimary_proxy_pac-url": "",
206
+ "nmprimary_proxy_pac-script": "",
207
+ "nmprimary_general_name": "primary",
208
+ "nmprimary_general_uuid": "d8651bb4-e2c3-11ea-816a-525400964581",
209
+ "nmprimary_general_devices": "eth0",
210
+ "nmprimary_general_state": "activated",
211
+ "nmprimary_general_default": "no",
212
+ "nmprimary_general_default6": "no",
213
+ "nmprimary_general_spec-object": "",
214
+ "nmprimary_general_vpn": "no",
215
+ "nmprimary_general_dbus-path": "/org/freedesktop/NetworkManager/ActiveConnection/1",
216
+ "nmprimary_general_con-path": "/org/freedesktop/NetworkManager/Settings/1",
217
+ "nmprimary_general_zone": "",
218
+ "nmprimary_general_master-path": "",
219
+ "nmprimary_ip6_address": "fd00:aaaa:bbbb:cc:5054:ff:fe96:4581/64",
220
+ "nmprimary_ip6_gateway": "",
221
+ "nmprimary_ip6_route": "dst = fd00:aaaa:bbbb:cc::/64, nh = ::, mt = 100",
222
+ "nmprimary_ip6_dns": "fe80::5054:ff:fe3a:6bd3"
223
+ }
@@ -6,10 +6,10 @@ class Api::V2::SettingsControllerTest < ActionController::TestCase
6
6
  end
7
7
 
8
8
  test_attributes :pid => '2c5ecb7e-87bc-4980-9620-7ae00e3f360e'
9
- test "should update hostname prefix without value" do
9
+ test "should not update hostname prefix without value" do
10
10
  setting = Setting.find_by_name("discovery_prefix")
11
11
  put :update, params: { :id => setting.id, :setting => { :value => '' } }
12
- assert_equal JSON.parse(@response.body)['value'], '', "Can't update discovery_prefix setting with empty value"
12
+ assert_nil JSON.parse(@response.body)['value']
13
13
  end
14
14
 
15
15
  test_attributes :pid => '4969994d-f934-4f0e-9a98-476b87eb0527'
@@ -260,12 +260,6 @@ class HostDiscoveredTest < ActiveSupport::TestCase
260
260
  assert_equal 'teste41f13cc3658', host.name
261
261
  end
262
262
 
263
- test "should create discovered host without prefix" do
264
- Setting[:discovery_prefix] = ''
265
- host = discover_host_from_facts(@facts)
266
- assert_equal 'e41f13cc3658',host.name
267
- end
268
-
269
263
  test "should refresh facts and NICs of an existing discovered host" do
270
264
  host1 = discover_host_from_facts(@facts)
271
265
  assert_equal 'mace41f13cc3658', host1.name
@@ -290,16 +284,6 @@ class HostDiscoveredTest < ActiveSupport::TestCase
290
284
  assert_match(/Invalid facts: hash does not contain a valid value for any of the facts in the discovery_hostname setting:/, exception.message)
291
285
  end
292
286
 
293
- test "should raise when hostname cannot be computed due to normlization and no prefix" do
294
- @facts['invalidhostnamefact'] = '...'
295
- Setting[:discovery_hostname] = 'invalidhostnamefact'
296
- Setting[:discovery_prefix] = ''
297
- exception = assert_raises(::Foreman::Exception) do
298
- discover_host_from_facts(@facts)
299
- end
300
- assert_match(/Invalid hostname: Could not normalize the hostname/, exception.message)
301
- end
302
-
303
287
  test 'discovered host can be searched in multiple taxonomies' do
304
288
  org1 = FactoryBot.create(:organization)
305
289
  org2 = FactoryBot.create(:organization)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_discovery
3
3
  version: !ruby/object:Gem::Version
4
- version: 16.1.4
4
+ version: 16.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aditi Puntambekar
@@ -68,10 +68,10 @@ authors:
68
68
  - Tom Caspy
69
69
  - Tomer Brisker
70
70
  - Yann Cézard
71
- autorequire:
71
+ autorequire:
72
72
  bindir: bin
73
73
  cert_chain: []
74
- date: 2021-03-09 00:00:00.000000000 Z
74
+ date: 2020-09-16 00:00:00.000000000 Z
75
75
  dependencies: []
76
76
  description: MaaS Discovery Plugin engine for Foreman
77
77
  email: gsutclif@redhat.com
@@ -106,6 +106,7 @@ files:
106
106
  - app/models/setting/discovered.rb
107
107
  - app/services/foreman_discovery/fact_parser.rb
108
108
  - app/services/foreman_discovery/host_converter.rb
109
+ - app/services/foreman_discovery/host_fact_importer.rb
109
110
  - app/services/foreman_discovery/import_hook.rb
110
111
  - app/services/foreman_discovery/import_hook_service.rb
111
112
  - app/services/foreman_discovery/import_hooks/discovery_attribute.rb
@@ -244,14 +245,15 @@ files:
244
245
  - test/facts/dell_vlan.json
245
246
  - test/facts/facts_with_lldp.json
246
247
  - test/facts/facts_with_lldp_bond_candidate.json
248
+ - test/facts/only-ipv6.json
247
249
  - test/facts/pxeless-vlan.json
248
250
  - test/facts/regular_host.json
249
251
  - test/facts/rhel-dl380-1kdisks.json
250
252
  - test/facts/rhel-r730.json
251
253
  - test/facts/rhel7-vlan.json
252
254
  - test/facts/simple-bond.json
255
+ - test/facts/skylake-ipv6.json
253
256
  - test/facts/suse-vmware.json
254
- - test/facts/vmware-facter4-nolegacy.json
255
257
  - test/facts/vmware_local.json
256
258
  - test/functional/api/v2/discovered_hosts_controller_test.rb
257
259
  - test/functional/api/v2/discovery_rules_controller_test.rb
@@ -280,7 +282,7 @@ homepage: https://github.com/theforeman/foreman_discovery
280
282
  licenses:
281
283
  - GPL-3.0
282
284
  metadata: {}
283
- post_install_message:
285
+ post_install_message:
284
286
  rdoc_options: []
285
287
  require_paths:
286
288
  - lib
@@ -295,8 +297,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
295
297
  - !ruby/object:Gem::Version
296
298
  version: '0'
297
299
  requirements: []
298
- rubygems_version: 3.1.4
299
- signing_key:
300
+ rubygems_version: 3.1.2
301
+ signing_key:
300
302
  specification_version: 4
301
303
  summary: MaaS Discovery Plugin for Foreman
302
304
  test_files:
@@ -315,28 +317,29 @@ test_files:
315
317
  - test/facts/rhel7-vlan.json
316
318
  - test/facts/simple-bond.json
317
319
  - test/facts/suse-vmware.json
318
- - test/facts/vmware-facter4-nolegacy.json
319
320
  - test/facts/vmware_local.json
321
+ - test/facts/only-ipv6.json
322
+ - test/facts/skylake-ipv6.json
323
+ - test/functional/api/v2/discovered_hosts_controller_test.rb
320
324
  - test/functional/api/v2/discovery_rules_controller_test.rb
321
325
  - test/functional/api/v2/fact_value_extensions_test.rb
322
- - test/functional/api/v2/discovered_hosts_controller_test.rb
323
326
  - test/functional/api/v2/settings_controller_test.rb
327
+ - test/functional/discovery_rules_controller_test.rb
324
328
  - test/functional/foreman_discovery/concerns/hosts_controller_extensions_test.rb
325
329
  - test/functional/discovered_hosts_controller_test.rb
326
- - test/functional/discovery_rules_controller_test.rb
327
330
  - test/integration/discovered_hosts_test.rb
328
331
  - test/models/setting_test.rb
329
- - test/unit/ui_notifications/destroy_host_test.rb
330
- - test/unit/ui_notifications/new_host_test.rb
331
- - test/unit/discovered_extensions_test.rb
332
+ - test/test_helper_discovery.rb
333
+ - test/test_plugin_helper.rb
332
334
  - test/unit/discovered_mailer_test.rb
333
335
  - test/unit/discovery_attribute_set_test.rb
334
336
  - test/unit/discovery_rule_test.rb
335
337
  - test/unit/discovery_taxonomy_extensions_test.rb
336
338
  - test/unit/fact_parser_test.rb
337
339
  - test/unit/lldp_neighbors_test.rb
338
- - test/unit/managed_extensions_test.rb
339
340
  - test/unit/setting_discovered_test.rb
341
+ - test/unit/ui_notifications/destroy_host_test.rb
342
+ - test/unit/ui_notifications/new_host_test.rb
340
343
  - test/unit/host_discovered_test.rb
341
- - test/test_plugin_helper.rb
342
- - test/test_helper_discovery.rb
344
+ - test/unit/discovered_extensions_test.rb
345
+ - test/unit/managed_extensions_test.rb
@@ -1,402 +0,0 @@
1
- {
2
- "discovery_bootif": "00:50:56:ac:18:b6",
3
- "discovery_release": "20210122.1",
4
- "discovery_version": "3.7.3",
5
- "disks": {
6
- "sda": {
7
- "model": "Virtual disk",
8
- "size": "16.00 GiB",
9
- "size_bytes": 17179869184,
10
- "type": "hdd",
11
- "vendor": "VMware"
12
- },
13
- "sr0": {
14
- "model": "VMware SATA CD00",
15
- "size": "1.00 GiB",
16
- "size_bytes": 1073741312,
17
- "type": "hdd",
18
- "vendor": "NECVMWar"
19
- }
20
- },
21
- "dmi": {
22
- "bios": {
23
- "release_date": "12/12/2018",
24
- "vendor": "Phoenix Technologies LTD",
25
- "version": "6.00"
26
- },
27
- "board": {
28
- "manufacturer": "Intel Corporation",
29
- "product": "440BX Desktop Reference Platform",
30
- "serial_number": "None"
31
- },
32
- "chassis": {
33
- "asset_tag": "No Asset Tag",
34
- "type": "Other"
35
- },
36
- "manufacturer": "VMware, Inc.",
37
- "product": {
38
- "name": "VMware Virtual Platform",
39
- "serial_number": "VMware-42 2c f9 6e 36 77 8a f9-42 ea 64 01 82 62 bc 16",
40
- "uuid": "6EF92C42-7736-F98A-42EA-64018262BC16"
41
- }
42
- },
43
- "efi": false,
44
- "ethtool": {
45
- "ens192": {
46
- "auto_negotiation": "false",
47
- "duplex": "full",
48
- "link": "true",
49
- "port": "Twisted Pair",
50
- "speed": "10000",
51
- "wol": false
52
- },
53
- "lo": {
54
- "link": "true"
55
- }
56
- },
57
- "facterversion": "4.0.44",
58
- "filesystems": "ext2,ext3,ext4,iso9660,squashfs",
59
- "fips_enabled": false,
60
- "hypervisors": {
61
- "vmware": {
62
- "version": "ESXi 6.7"
63
- }
64
- },
65
- "identity": {
66
- "gid": 0,
67
- "group": "root",
68
- "privileged": true,
69
- "uid": 0,
70
- "user": "root"
71
- },
72
- "is_virtual": "true",
73
- "kernel": "Linux",
74
- "kernelmajversion": "3.10",
75
- "kernelrelease": "3.10.0-1160.11.1.el7.x86_64",
76
- "kernelversion": "3.10.0",
77
- "lib": "/usr/share/fdi/facts:/opt/extension/facts",
78
- "lldp_neighbor_chassisid_ens192": null,
79
- "lldp_neighbor_mngaddr_ipv4_ens192": null,
80
- "lldp_neighbor_mngaddr_ipv6_ens192": null,
81
- "lldp_neighbor_mtu_ens192": null,
82
- "lldp_neighbor_portid_ens192": null,
83
- "lldp_neighbor_pvid_ens192": null,
84
- "lldp_neighbor_sysname_ens192": null,
85
- "load_averages": {
86
- "15m": 0.05,
87
- "1m": 0.0,
88
- "5m": 0.03
89
- },
90
- "memory": {
91
- "system": {
92
- "available": "3.33 GiB",
93
- "available_bytes": 3580538880,
94
- "capacity": "13.56%",
95
- "total": "3.86 GiB",
96
- "total_bytes": 4142460928,
97
- "used": "535.89 MiB",
98
- "used_bytes": 561922048
99
- }
100
- },
101
- "networking": {
102
- "domain": "example.com",
103
- "fqdn": "fdi.example.com",
104
- "hostname": "fdi",
105
- "interfaces": {
106
- "ens192": {
107
- "bindings": [
108
- {
109
- "address": "10.28.236.10",
110
- "netmask": "255.255.255.0",
111
- "network": "10.28.236.0"
112
- }
113
- ],
114
- "bindings6": [
115
- {
116
- "address": "fe80::250:56ff:feac:18b6",
117
- "netmask": "ffff:ffff:ffff:ffff::",
118
- "network": "fe80::"
119
- }
120
- ],
121
- "dhcp": "10.28.236.3",
122
- "mac": "00:50:56:ac:18:b6",
123
- "mtu": 1500,
124
- "scope6": "link"
125
- },
126
- "lo": {
127
- "bindings": [
128
- {
129
- "address": "127.0.0.1",
130
- "netmask": "255.0.0.0",
131
- "network": "127.0.0.0"
132
- }
133
- ],
134
- "bindings6": [
135
- {
136
- "address": "::1",
137
- "netmask": "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff",
138
- "network": "::1"
139
- }
140
- ],
141
- "mtu": 65536,
142
- "scope6": "host"
143
- }
144
- }
145
- },
146
- "nmprimary_802-3-ethernet_auto-negotiate": "no",
147
- "nmprimary_802-3-ethernet_cloned-mac-address": "",
148
- "nmprimary_802-3-ethernet_duplex": "",
149
- "nmprimary_802-3-ethernet_generate-mac-address-mask": "",
150
- "nmprimary_802-3-ethernet_mac-address": "00:50:56:AC:18:B6",
151
- "nmprimary_802-3-ethernet_mac-address-blacklist": "",
152
- "nmprimary_802-3-ethernet_mtu": "auto",
153
- "nmprimary_802-3-ethernet_port": "",
154
- "nmprimary_802-3-ethernet_s390-nettype": "",
155
- "nmprimary_802-3-ethernet_s390-options": "",
156
- "nmprimary_802-3-ethernet_s390-subchannels": "",
157
- "nmprimary_802-3-ethernet_speed": "0",
158
- "nmprimary_802-3-ethernet_wake-on-lan": "default",
159
- "nmprimary_802-3-ethernet_wake-on-lan-password": "",
160
- "nmprimary_connection_auth-retries": "-1",
161
- "nmprimary_connection_autoconnect": "yes",
162
- "nmprimary_connection_autoconnect-priority": "1",
163
- "nmprimary_connection_autoconnect-retries": "-1",
164
- "nmprimary_connection_autoconnect-slaves": "-1",
165
- "nmprimary_connection_gateway-ping-timeout": "0",
166
- "nmprimary_connection_id": "primary",
167
- "nmprimary_connection_interface-name": "",
168
- "nmprimary_connection_lldp": "default",
169
- "nmprimary_connection_llmnr": "-1",
170
- "nmprimary_connection_master": "",
171
- "nmprimary_connection_mdns": "-1",
172
- "nmprimary_connection_metered": "unknown",
173
- "nmprimary_connection_multi-connect": "0",
174
- "nmprimary_connection_permissions": "",
175
- "nmprimary_connection_read-only": "no",
176
- "nmprimary_connection_secondaries": "",
177
- "nmprimary_connection_slave-type": "",
178
- "nmprimary_connection_stable-id": "",
179
- "nmprimary_connection_timestamp": "1612539016",
180
- "nmprimary_connection_type": "802-3-ethernet",
181
- "nmprimary_connection_uuid": "a4a73866-67c5-11eb-b420-005056ac18b6",
182
- "nmprimary_connection_zone": "",
183
- "nmprimary_dhcp4_option_broadcast_address": "10.28.236.255",
184
- "nmprimary_dhcp4_option_dhcp_lease_time": "43200",
185
- "nmprimary_dhcp4_option_dhcp_message_type": "5",
186
- "nmprimary_dhcp4_option_dhcp_server_identifier": "10.28.236.3",
187
- "nmprimary_dhcp4_option_domain_name": "install.pox.com",
188
- "nmprimary_dhcp4_option_domain_name_servers": "10.28.236.3",
189
- "nmprimary_dhcp4_option_expiry": "1612581618",
190
- "nmprimary_dhcp4_option_filename": "pxelinux.0",
191
- "nmprimary_dhcp4_option_fqdn": null,
192
- "nmprimary_dhcp4_option_ip_address": "10.28.236.10",
193
- "nmprimary_dhcp4_option_network_number": "10.28.236.0",
194
- "nmprimary_dhcp4_option_next_server": "10.28.236.3",
195
- "nmprimary_dhcp4_option_requested_broadcast_address": "1",
196
- "nmprimary_dhcp4_option_requested_classless_static_routes": "1",
197
- "nmprimary_dhcp4_option_requested_domain_name": "1",
198
- "nmprimary_dhcp4_option_requested_domain_name_servers": "1",
199
- "nmprimary_dhcp4_option_requested_domain_search": "1",
200
- "nmprimary_dhcp4_option_requested_host_name": "1",
201
- "nmprimary_dhcp4_option_requested_interface_mtu": "1",
202
- "nmprimary_dhcp4_option_requested_ms_classless_static_routes": "1",
203
- "nmprimary_dhcp4_option_requested_nis_domain": "1",
204
- "nmprimary_dhcp4_option_requested_nis_servers": "1",
205
- "nmprimary_dhcp4_option_requested_ntp_servers": "1",
206
- "nmprimary_dhcp4_option_requested_rfc3442_classless_static_routes": "1",
207
- "nmprimary_dhcp4_option_requested_root_path": "1",
208
- "nmprimary_dhcp4_option_requested_routers": "1",
209
- "nmprimary_dhcp4_option_requested_static_routes": "1",
210
- "nmprimary_dhcp4_option_requested_subnet_mask": "1",
211
- "nmprimary_dhcp4_option_requested_time_offset": "1",
212
- "nmprimary_dhcp4_option_requested_wpad": "1",
213
- "nmprimary_dhcp4_option_subnet_mask": "255.255.255.0",
214
- "nmprimary_general_con-path": "/org/freedesktop/NetworkManager/Settings/1",
215
- "nmprimary_general_dbus-path": "/org/freedesktop/NetworkManager/ActiveConnection/1",
216
- "nmprimary_general_default": "no",
217
- "nmprimary_general_default6": "no",
218
- "nmprimary_general_devices": "ens192",
219
- "nmprimary_general_master-path": "",
220
- "nmprimary_general_name": "primary",
221
- "nmprimary_general_spec-object": "",
222
- "nmprimary_general_state": "activated",
223
- "nmprimary_general_uuid": "a4a73866-67c5-11eb-b420-005056ac18b6",
224
- "nmprimary_general_vpn": "no",
225
- "nmprimary_general_zone": "",
226
- "nmprimary_ip4_address": "10.28.236.10/24",
227
- "nmprimary_ip4_dns": "10.28.236.3",
228
- "nmprimary_ip4_domain": "install.pox.com",
229
- "nmprimary_ip4_gateway": "",
230
- "nmprimary_ip4_route": "dst = 10.28.236.0/24, nh = 0.0.0.0, mt = 100",
231
- "nmprimary_ip6_address": "fe80::250:56ff:feac:18b6/64",
232
- "nmprimary_ip6_gateway": "",
233
- "nmprimary_ip6_route": "dst = fe80::/64, nh = ::, mt = 100",
234
- "nmprimary_ipv4_addresses": "",
235
- "nmprimary_ipv4_dad-timeout": "-1",
236
- "nmprimary_ipv4_dhcp-client-id": "",
237
- "nmprimary_ipv4_dhcp-fqdn": "",
238
- "nmprimary_ipv4_dhcp-hostname": "",
239
- "nmprimary_ipv4_dhcp-send-hostname": "no",
240
- "nmprimary_ipv4_dhcp-timeout": "300",
241
- "nmprimary_ipv4_dns": "",
242
- "nmprimary_ipv4_dns-options": " ",
243
- "nmprimary_ipv4_dns-priority": "0",
244
- "nmprimary_ipv4_dns-search": "",
245
- "nmprimary_ipv4_gateway": "",
246
- "nmprimary_ipv4_ignore-auto-dns": "no",
247
- "nmprimary_ipv4_ignore-auto-routes": "no",
248
- "nmprimary_ipv4_may-fail": "yes",
249
- "nmprimary_ipv4_method": "auto",
250
- "nmprimary_ipv4_never-default": "no",
251
- "nmprimary_ipv4_route-metric": "-1",
252
- "nmprimary_ipv4_route-table": "0",
253
- "nmprimary_ipv4_routes": "",
254
- "nmprimary_ipv4_routing-rules": "",
255
- "nmprimary_ipv6_addr-gen-mode": "eui64",
256
- "nmprimary_ipv6_addresses": "",
257
- "nmprimary_ipv6_dhcp-duid": "",
258
- "nmprimary_ipv6_dhcp-hostname": "",
259
- "nmprimary_ipv6_dhcp-send-hostname": "yes",
260
- "nmprimary_ipv6_dns": "",
261
- "nmprimary_ipv6_dns-options": " ",
262
- "nmprimary_ipv6_dns-priority": "0",
263
- "nmprimary_ipv6_dns-search": "",
264
- "nmprimary_ipv6_gateway": "",
265
- "nmprimary_ipv6_ignore-auto-dns": "no",
266
- "nmprimary_ipv6_ignore-auto-routes": "no",
267
- "nmprimary_ipv6_ip6-privacy": "-1",
268
- "nmprimary_ipv6_may-fail": "yes",
269
- "nmprimary_ipv6_method": "auto",
270
- "nmprimary_ipv6_never-default": "no",
271
- "nmprimary_ipv6_route-metric": "-1",
272
- "nmprimary_ipv6_route-table": "0",
273
- "nmprimary_ipv6_routes": "",
274
- "nmprimary_ipv6_routing-rules": "",
275
- "nmprimary_ipv6_token": "",
276
- "nmprimary_proxy_browser-only": "no",
277
- "nmprimary_proxy_method": "none",
278
- "nmprimary_proxy_pac-script": "",
279
- "nmprimary_proxy_pac-url": "",
280
- "nmprimary_ptr": null,
281
- "nmprimary_vlan_egress-priority-map": "",
282
- "nmprimary_vlan_flags": "1",
283
- "nmprimary_vlan_id": "0",
284
- "nmprimary_vlan_ingress-priority-map": "",
285
- "nmprimary_vlan_parent": "",
286
- "os": {
287
- "architecture": "x86_64",
288
- "family": "RedHat",
289
- "hardware": "x86_64",
290
- "name": "CentOS",
291
- "release": {
292
- "full": "7.9.2009",
293
- "major": "7",
294
- "minor": "9"
295
- },
296
- "selinux": {
297
- "enabled": true
298
- }
299
- },
300
- "partitions": {
301
- "/dev/loop0": {
302
- "backing_file": "/fdi.iso (deleted)",
303
- "filesystem": "iso9660",
304
- "label": "CDROM",
305
- "size": "226.22 MiB",
306
- "size_bytes": 237211648,
307
- "uuid": "2021-01-22-12-40-51-00"
308
- },
309
- "/dev/loop1": {
310
- "backing_file": "/run/initramfs/live/LiveOS/squashfs.img",
311
- "filesystem": "squashfs",
312
- "size": "225.86 MiB",
313
- "size_bytes": 236834816
314
- },
315
- "/dev/loop2": {
316
- "backing_file": "/LiveOS/ext3fs.img",
317
- "filesystem": "ext4",
318
- "label": "_fdi",
319
- "size": "1.56 GiB",
320
- "size_bytes": 1677721600,
321
- "uuid": "c6918a11-44b8-4659-bc52-19f8aa7fc43a"
322
- },
323
- "/dev/loop3": {
324
- "backing_file": "/overlay (deleted)",
325
- "filesystem": "DM_snapshot_cow",
326
- "size": "512.00 MiB",
327
- "size_bytes": 536870912
328
- },
329
- "/dev/loop4": {
330
- "backing_file": "/dev/dm-0",
331
- "filesystem": "ext4",
332
- "label": "_fdi",
333
- "size": "1.56 GiB",
334
- "size_bytes": 1677721600,
335
- "uuid": "c6918a11-44b8-4659-bc52-19f8aa7fc43a"
336
- },
337
- "/dev/mapper/live-base": {
338
- "filesystem": "ext4",
339
- "label": "_fdi",
340
- "size": "1.56 GiB",
341
- "size_bytes": 1677721600,
342
- "uuid": "c6918a11-44b8-4659-bc52-19f8aa7fc43a"
343
- },
344
- "/dev/mapper/live-rw": {
345
- "filesystem": "ext4",
346
- "label": "_fdi",
347
- "size": "1.56 GiB",
348
- "size_bytes": 1677721600,
349
- "uuid": "c6918a11-44b8-4659-bc52-19f8aa7fc43a"
350
- }
351
- },
352
- "path": "/opt/rh/rh-ruby25/root/usr/local/bin:/opt/rh/rh-ruby25/root/usr/bin:/opt/theforeman/tfm/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/opt/extension/bin:/root/bin",
353
- "processors": {
354
- "count": 2,
355
- "isa": "x86_64",
356
- "models": [
357
- "Intel(R) Xeon(R) CPU E5-2667 v2 @ 3.30GHz",
358
- "Intel(R) Xeon(R) CPU E5-2667 v2 @ 3.30GHz"
359
- ],
360
- "physicalcount": 2,
361
- "speed": "3.29 GHz"
362
- },
363
- "ruby": {
364
- "platform": "x86_64-linux",
365
- "sitedir": "/opt/rh/rh-ruby25/root/usr/local/share/ruby/site_ruby",
366
- "version": "2.5.5"
367
- },
368
- "ssh": {
369
- "ecdsa": {
370
- "fingerprints": {
371
- "sha1": "SSHFP 3 1 382f7d62d396fe559091f00b3320c6b56cbe065d",
372
- "sha256": "SSHFP 3 2 b97ddd80dc08d2f6ddee3ad3beac5da8ce496c0eb47b09d4257f401e9934b4b2"
373
- },
374
- "key": "AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBHaX110SuKwYBujV1b9zOhqo7KwGKzhPyZ+QxmJceEVaHY1hogYIhwJt+xsWdPLwUnMP8EXcnpXE4XqkQsTP89c=",
375
- "type": "ecdsa-sha2-nistp256"
376
- },
377
- "ed25519": {
378
- "fingerprints": {
379
- "sha1": "SSHFP 4 1 a0a9def0b18b71ce44033494826b96ea7a8c60b2",
380
- "sha256": "SSHFP 4 2 4428936d012dcde334ef8ff9be7bc3db66ecee2dba2cac229c6e5a4514dbd1ec"
381
- },
382
- "key": "AAAAC3NzaC1lZDI1NTE5AAAAIHS5cgBXViocE769MH9e74Wl7Emo75Z0ZNvv87SMvlmd",
383
- "type": "ssh-ed25519"
384
- },
385
- "rsa": {
386
- "fingerprints": {
387
- "sha1": "SSHFP 1 1 da8a9b006002c9cb4e4c4b9da91cbe22f4b59cf1",
388
- "sha256": "SSHFP 1 2 fbf82405fbba9423e65f3e3625b3657a71033786500c8f33d2c5d36656c74c2b"
389
- },
390
- "key": "AAAAB3NzaC1yc2EAAAADAQABAAABAQD9YqhFRT8rgUIuP7voCwwVdbZIcC5l8MRreJFSFrmyWsAL5RKsgtVUrj2+kbYNLY53LPKDdZpdUlmzl6WxrcsIEF2NC7l436/kMPE0e3ofd6tPvV2VVSS8L+UlhmtUBzrmOg5SYImwJwnv5RDdFcMOiIISWvvnut0WM6IU8zG9mOz+kGfQxEztjydV/UDe99syc1WmDP3O/qfatTlrp4E9Ec3vas0wPN+ZFwG49to/0tP1Rj+POpf8V61NXii6qK2flsW0kGdqvjjp3QQXO/OAoWJkT96xvPHA8d58szg7HYycpGtoPwIQSMzoV+cYFfYCT+Y6BTvT5KfiDMAAI199",
391
- "type": "ssh-rsa"
392
- }
393
- },
394
- "system_uptime": {
395
- "days": 0,
396
- "hours": 0,
397
- "seconds": 661,
398
- "uptime": "0:11 hours"
399
- },
400
- "timezone": "UTC",
401
- "virtual": "vmware"
402
- }