foreman_wreckingball 4.0.0 → 5.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -0
  3. data/Rakefile +2 -2
  4. data/app/controllers/foreman_wreckingball/hosts_controller.rb +30 -13
  5. data/app/helpers/{concerns/foreman_wreckingball/hosts_helper_extensions.rb → foreman_wreckingball/hosts_helper.rb} +1 -1
  6. data/app/helpers/foreman_wreckingball/hypervisors_helper.rb +2 -1
  7. data/app/helpers/foreman_wreckingball/statuses_helper.rb +9 -7
  8. data/app/jobs/update_hosts_vmware_facets.rb +3 -2
  9. data/app/lib/actions/foreman_wreckingball/bulk_remediate.rb +4 -1
  10. data/app/lib/actions/foreman_wreckingball/host/remediate_hardware_version.rb +3 -1
  11. data/app/lib/actions/foreman_wreckingball/host/remediate_spectre_v2.rb +3 -1
  12. data/app/lib/actions/foreman_wreckingball/host/remediate_vmware_operatingsystem.rb +14 -10
  13. data/app/lib/actions/foreman_wreckingball/vmware/schedule_vmware_sync.rb +1 -1
  14. data/app/lib/actions/foreman_wreckingball/vmware/sync_compute_resource.rb +2 -2
  15. data/app/lib/fog_extensions/foreman_wreckingball/vsphere/host.rb +2 -0
  16. data/app/lib/fog_extensions/foreman_wreckingball/vsphere/mock.rb +3 -1
  17. data/app/lib/fog_extensions/foreman_wreckingball/vsphere/real.rb +7 -2
  18. data/app/lib/fog_extensions/foreman_wreckingball/vsphere/server.rb +2 -0
  19. data/app/lib/vsphere_os_identifiers/data.yaml +7 -0
  20. data/app/models/concerns/foreman_wreckingball/compute_resource_extensions.rb +11 -5
  21. data/app/models/concerns/foreman_wreckingball/host_extensions.rb +9 -4
  22. data/app/models/concerns/foreman_wreckingball/vmware_facet_host_extensions.rb +42 -11
  23. data/app/models/concerns/foreman_wreckingball/vmware_hypervisor_facet_host_extensions.rb +6 -2
  24. data/app/models/foreman_wreckingball/cpu_hot_add_status.rb +1 -1
  25. data/app/models/foreman_wreckingball/hardware_version_status.rb +1 -1
  26. data/app/models/foreman_wreckingball/operatingsystem_status.rb +2 -0
  27. data/app/models/foreman_wreckingball/spectre_v2_status.rb +2 -2
  28. data/app/models/foreman_wreckingball/vmware_cluster.rb +14 -13
  29. data/app/models/foreman_wreckingball/vmware_facet.rb +18 -12
  30. data/app/models/foreman_wreckingball/vmware_hypervisor_facet.rb +3 -1
  31. data/app/services/foreman_wreckingball/vmware_cluster_importer.rb +7 -4
  32. data/app/services/foreman_wreckingball/vmware_hypervisor_importer.rb +44 -41
  33. data/app/views/foreman_wreckingball/hosts/_hosts.json.rabl +2 -2
  34. data/app/views/foreman_wreckingball/hosts/status_hosts.json.rabl +4 -4
  35. data/config/environments/production.rb +1 -1
  36. data/config/routes.rb +3 -2
  37. data/db/migrate/20181021111543_add_indexes_to_vmware_hypervisor_facets.rb +1 -1
  38. data/db/migrate/20240201094513_fix_wreckingball_settings_category_to_dsl.rb +13 -0
  39. data/lib/foreman_wreckingball/engine.rb +46 -52
  40. data/lib/foreman_wreckingball/scheduled_jobs.rb +1 -1
  41. data/lib/foreman_wreckingball/version.rb +1 -1
  42. data/lib/tasks/foreman_vmware_checks_tasks.rake +1 -21
  43. data/test/actions/foreman_wreckingball/bulk_remediate_test.rb +0 -1
  44. data/test/actions/foreman_wreckingball/host/refresh_vmware_facet_test.rb +6 -7
  45. data/test/actions/foreman_wreckingball/host/remediate_hardware_version_test.rb +6 -7
  46. data/test/actions/foreman_wreckingball/host/remediate_spectre_v2_test.rb +6 -7
  47. data/test/actions/foreman_wreckingball/host/remediate_vmware_operatingsystem_test.rb +8 -9
  48. data/test/actions/foreman_wreckingball/vmware/sync_compute_resource_test.rb +2 -2
  49. data/test/controllers/compute_resources_controller_test.rb +2 -2
  50. data/test/controllers/foreman_wreckingball/hosts_controller_test.rb +19 -18
  51. data/test/factories/foreman_wreckingball_factories.rb +10 -10
  52. data/test/integration/hosts_status_dashboard_test.rb +0 -4
  53. data/test/integration/hosts_status_managed_hosts_test.rb +4 -5
  54. data/test/models/compute_resources/vmware_test.rb +1 -1
  55. data/test/models/foreman_wreckingball/cpu_hot_add_status_test.rb +2 -2
  56. data/test/models/foreman_wreckingball/hardware_version_status_test.rb +3 -4
  57. data/test/models/foreman_wreckingball/operatingsystem_status_test.rb +5 -5
  58. data/test/models/foreman_wreckingball/spectre_v2_status_test.rb +4 -4
  59. data/test/models/foreman_wreckingball/tools_status_test.rb +2 -2
  60. data/test/models/foreman_wreckingball/vmware_facet_test.rb +10 -10
  61. data/test/models/foreman_wreckingball/vmware_hypervisor_facet_test.rb +4 -4
  62. data/test/models/host_test.rb +54 -52
  63. data/test/test_plugin_helper.rb +1 -1
  64. data/test/unit/foreman_wreckingball/access_permissions_test.rb +18 -0
  65. data/test/unit/foreman_wreckingball/vmware_cluster_importer_test.rb +6 -6
  66. data/test/unit/foreman_wreckingball/vmware_hypervisor_importer_test.rb +4 -4
  67. metadata +56 -37
  68. data/app/models/setting/wreckingball.rb +0 -26
@@ -20,22 +20,22 @@ module ForemanWreckingball
20
20
 
21
21
  test 'should be true when IBRS is available' do
22
22
  facet.feature_capabilities = ['cpuid.IBRS']
23
- assert_equal true, facet.provides_spectre_features?
23
+ assert facet.provides_spectre_features?
24
24
  end
25
25
 
26
26
  test 'should be true when IBPB is available' do
27
27
  facet.feature_capabilities = ['cpuid.IBPB']
28
- assert_equal true, facet.provides_spectre_features?
28
+ assert facet.provides_spectre_features?
29
29
  end
30
30
 
31
31
  test 'should be true when STIBP is available' do
32
32
  facet.feature_capabilities = ['cpuid.STIBP']
33
- assert_equal true, facet.provides_spectre_features?
33
+ assert facet.provides_spectre_features?
34
34
  end
35
35
 
36
36
  test 'should be false when neither IBRS, IBPB nor STIBP is available' do
37
37
  facet.feature_capabilities = ['cpuid.WHATEVER']
38
- assert_equal false, facet.provides_spectre_features?
38
+ assert_not facet.provides_spectre_features?
39
39
  end
40
40
  end
41
41
  end
@@ -2,72 +2,74 @@
2
2
 
3
3
  require 'test_plugin_helper'
4
4
 
5
- class Host::ManagedTest < ActiveSupport::TestCase
6
- should have_one(:vmware_facet)
7
- should have_one(:vmware_cluster)
8
- should have_one(:vmware_hypervisor_facet)
5
+ module Host
6
+ class ManagedTest < ActiveSupport::TestCase
7
+ should have_one(:vmware_facet)
8
+ should have_one(:vmware_cluster)
9
+ should have_one(:vmware_hypervisor_facet)
9
10
 
10
- HostStatus.wreckingball_statuses.each do |status|
11
- should have_one(status.host_association)
12
- end
11
+ HostStatus.wreckingball_statuses.each do |status|
12
+ should have_one(status.host_association)
13
+ end
13
14
 
14
- describe '#owned_by_current_user_or_group_with_current_user' do
15
- test 'returns only hosts owned by current user' do
16
- usergroup_with_user = FactoryBot.create(:usergroup, users: [User.current], usergroups: [FactoryBot.create(:usergroup, users: [])])
15
+ describe '#owned_by_current_user_or_group_with_current_user' do
16
+ test 'returns only hosts owned by current user' do
17
+ usergroup_with_user = FactoryBot.create(:usergroup, users: [User.current], usergroups: [FactoryBot.create(:usergroup, users: [])])
17
18
 
18
- FactoryBot.create :host, :managed, owner: FactoryBot.create(:user)
19
- FactoryBot.create :host, :managed, owner: FactoryBot.create(:usergroup, users: [])
20
- FactoryBot.create :host, :managed, owner: usergroup_with_user.usergroups.first
19
+ FactoryBot.create :host, :managed, owner: FactoryBot.create(:user)
20
+ FactoryBot.create :host, :managed, owner: FactoryBot.create(:usergroup, users: [])
21
+ FactoryBot.create :host, :managed, owner: usergroup_with_user.usergroups.first
21
22
 
22
- expected = [
23
- FactoryBot.create(:host, :managed, owner: User.current),
24
- FactoryBot.create(:host, :managed, owner: usergroup_with_user),
25
- FactoryBot.create(:host, :managed, owner: FactoryBot.create(:usergroup, usergroups: [usergroup_with_user]))
26
- ]
27
- actual = Host::Managed.owned_by_current_user_or_group_with_current_user.all
23
+ expected = [
24
+ FactoryBot.create(:host, :managed, owner: User.current),
25
+ FactoryBot.create(:host, :managed, owner: usergroup_with_user),
26
+ FactoryBot.create(:host, :managed, owner: FactoryBot.create(:usergroup, usergroups: [usergroup_with_user])),
27
+ ]
28
+ actual = Host::Managed.owned_by_current_user_or_group_with_current_user.all
28
29
 
29
- assert_same_elements expected, actual
30
+ assert_same_elements expected, actual
31
+ end
30
32
  end
31
- end
32
33
 
33
- context 'scoped search' do
34
- setup do
35
- @host = FactoryBot.create(:host, :with_vmware_facet)
36
- end
34
+ context 'scoped search' do
35
+ setup do
36
+ @host = FactoryBot.create(:host, :with_vmware_facet)
37
+ end
37
38
 
38
- test 'search by hardware_version' do
39
- hosts = Host.search_for('vsphere_hardware_version = vmx-10')
40
- assert_includes hosts, @host
41
- end
39
+ test 'search by hardware_version' do
40
+ hosts = Host.search_for('vsphere_hardware_version = vmx-10')
41
+ assert_includes hosts, @host
42
+ end
42
43
 
43
- test 'search by power_state' do
44
- hosts = Host.search_for('vsphere_power_state = poweredOn')
45
- assert_includes hosts, @host
46
- end
44
+ test 'search by power_state' do
45
+ hosts = Host.search_for('vsphere_power_state = poweredOn')
46
+ assert_includes hosts, @host
47
+ end
47
48
 
48
- test 'search by tools_state' do
49
- hosts = Host.search_for('vsphere_tools_state = toolsOk')
50
- assert_includes hosts, @host
51
- end
49
+ test 'search by tools_state' do
50
+ hosts = Host.search_for('vsphere_tools_state = toolsOk')
51
+ assert_includes hosts, @host
52
+ end
52
53
 
53
- test 'search by guest_id' do
54
- hosts = Host.search_for('vsphere_guest_id = rhel6_64Guest')
55
- assert_includes hosts, @host
56
- end
54
+ test 'search by guest_id' do
55
+ hosts = Host.search_for('vsphere_guest_id = rhel6_64Guest')
56
+ assert_includes hosts, @host
57
+ end
57
58
 
58
- test 'search by cpus' do
59
- hosts = Host.search_for('vsphere_cpus = 2')
60
- assert_includes hosts, @host
61
- end
59
+ test 'search by cpus' do
60
+ hosts = Host.search_for('vsphere_cpus = 2')
61
+ assert_includes hosts, @host
62
+ end
62
63
 
63
- test 'search by corespersocket' do
64
- hosts = Host.search_for('vsphere_corespersocket = 1')
65
- assert_includes hosts, @host
66
- end
64
+ test 'search by corespersocket' do
65
+ hosts = Host.search_for('vsphere_corespersocket = 1')
66
+ assert_includes hosts, @host
67
+ end
67
68
 
68
- test 'search by memory_mb' do
69
- hosts = Host.search_for('vsphere_memory_mb = 8192')
70
- assert_includes hosts, @host
69
+ test 'search by memory_mb' do
70
+ hosts = Host.search_for('vsphere_memory_mb = 8192')
71
+ assert_includes hosts, @host
72
+ end
71
73
  end
72
74
  end
73
75
  end
@@ -5,7 +5,7 @@ require 'test_helper'
5
5
  require 'database_cleaner'
6
6
  require 'dynflow/testing'
7
7
 
8
- Dir["#{__dir__}/helpers/foreman_wreckingball/**.rb"].each { |f| require f }
8
+ Dir["#{__dir__}/helpers/foreman_wreckingball/**.rb"].sort.each { |f| require f }
9
9
 
10
10
  # Add plugin to FactoryBot's paths
11
11
  FactoryBot.definition_file_paths << File.join(ForemanTasks::Engine.root, 'test', 'factories')
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'test_plugin_helper'
4
+ require 'unit/shared/access_permissions_test_base'
5
+
6
+ # Permissions are added in AccessPermissions with lists of controllers and
7
+ # actions that they enable access to. For non-admin users, we need to test
8
+ # that there are permissions available that cover every controller action, else
9
+ # it can't be delegated and this will lead to parts of the application that
10
+ # aren't functional for non-admin users.
11
+ #
12
+ # In particular, it's important that actions for AJAX requests are added to
13
+ # an appropriate permission so views using those requests function.
14
+ class AccessPermissionsTest < ActiveSupport::TestCase
15
+ include AccessPermissionsTestBase
16
+
17
+ check_routes(ForemanWreckingball::Engine.routes, [])
18
+ end
@@ -10,7 +10,7 @@ module ForemanWreckingball
10
10
  end
11
11
  teardown { Fog.unmock! }
12
12
 
13
- let(:compute_resource) { FactoryBot.create(:vmware_cr, :uuid => 'Solutions') }
13
+ let(:compute_resource) { FactoryBot.create(:vmware_cr, uuid: 'Solutions') }
14
14
  let(:importer) do
15
15
  VmwareClusterImporter.new(
16
16
  compute_resource: compute_resource
@@ -28,10 +28,10 @@ module ForemanWreckingball
28
28
 
29
29
  test 'removes old clusters without associated records' do
30
30
  old_cluster = FactoryBot.create(:vmware_cluster,
31
- :with_hosts,
32
- :with_vmware_facets,
33
- :with_vmware_hypervisor_facets,
34
- compute_resource: compute_resource)
31
+ :with_hosts,
32
+ :with_vmware_facets,
33
+ :with_vmware_hypervisor_facets,
34
+ compute_resource: compute_resource)
35
35
 
36
36
  compute_resource_id = old_cluster.compute_resource.id
37
37
  host_ids = old_cluster.hosts.pluck(:id)
@@ -39,7 +39,7 @@ module ForemanWreckingball
39
39
  vmware_hypervisor_facet_ids = old_cluster.vmware_hypervisor_facets.pluck(:id)
40
40
 
41
41
  importer.import!
42
- refute ForemanWreckingball::VmwareCluster.find_by(id: old_cluster.id)
42
+ assert_not ForemanWreckingball::VmwareCluster.find_by(id: old_cluster.id)
43
43
 
44
44
  assert Foreman::Model::Vmware.find_by(id: compute_resource_id)
45
45
  assert_equal host_ids.count, Host.where(id: host_ids).count
@@ -44,7 +44,7 @@ module ForemanWreckingball
44
44
 
45
45
  test 'imports hypervisors' do
46
46
  importer.import!
47
- host = Host::Managed.joins(:vmware_hypervisor_facet).find_by(:name => 'host1.example.com')
47
+ host = Host::Managed.joins(:vmware_hypervisor_facet).find_by(name: 'host1.example.com')
48
48
 
49
49
  # Test host attributes are set correctly
50
50
  assert_equal 'example.com', host.domain.name
@@ -74,11 +74,11 @@ module ForemanWreckingball
74
74
  assert_not_nil Host::Managed.find_by(id: host_on_other_cluster.id).vmware_hypervisor_facet
75
75
  end
76
76
 
77
- test 'updates host by katello name' do
77
+ test 'does not touch hosts created by katello/virt-who' do
78
78
  host = FactoryBot.create(:host, organization: organization)
79
- host.update!(:name => "virt-who-host1.example.com-#{organization.id}")
79
+ host.update!(name: "virt-who-host1.example.com-#{organization.id}")
80
80
  importer.import!
81
- assert_equal 'host1.example.com', host.reload.name
81
+ assert_equal "virt-who-host1.example.com-#{organization.id}", host.reload.name
82
82
  end
83
83
  end
84
84
  end
metadata CHANGED
@@ -1,29 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_wreckingball
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 5.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Timo Goebel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-22 00:00:00.000000000 Z
11
+ date: 2024-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: foreman_puppet
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: foreman-tasks
15
29
  requirement: !ruby/object:Gem::Requirement
16
30
  requirements:
17
31
  - - ">="
18
32
  - !ruby/object:Gem::Version
19
- version: 3.0.0
33
+ version: '0'
20
34
  type: :runtime
21
35
  prerelease: false
22
36
  version_requirements: !ruby/object:Gem::Requirement
23
37
  requirements:
24
38
  - - ">="
25
39
  - !ruby/object:Gem::Version
26
- version: 3.0.0
40
+ version: '0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: rdoc
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -39,19 +53,19 @@ dependencies:
39
53
  - !ruby/object:Gem::Version
40
54
  version: '0'
41
55
  - !ruby/object:Gem::Dependency
42
- name: rubocop
56
+ name: theforeman-rubocop
43
57
  requirement: !ruby/object:Gem::Requirement
44
58
  requirements:
45
- - - '='
59
+ - - "~>"
46
60
  - !ruby/object:Gem::Version
47
- version: 0.54.0
61
+ version: 0.1.2
48
62
  type: :development
49
63
  prerelease: false
50
64
  version_requirements: !ruby/object:Gem::Requirement
51
65
  requirements:
52
- - - '='
66
+ - - "~>"
53
67
  - !ruby/object:Gem::Version
54
- version: 0.54.0
68
+ version: 0.1.2
55
69
  description: Adds status checks of the VMWare VMs to Foreman.
56
70
  email:
57
71
  - timo.goebel@dm.de
@@ -69,7 +83,7 @@ files:
69
83
  - app/assets/stylesheets/foreman_wreckingball/status_hosts_table.css.scss
70
84
  - app/assets/stylesheets/foreman_wreckingball/status_managed_hosts_dashboard.css.scss
71
85
  - app/controllers/foreman_wreckingball/hosts_controller.rb
72
- - app/helpers/concerns/foreman_wreckingball/hosts_helper_extensions.rb
86
+ - app/helpers/foreman_wreckingball/hosts_helper.rb
73
87
  - app/helpers/foreman_wreckingball/hypervisors_helper.rb
74
88
  - app/helpers/foreman_wreckingball/statuses_helper.rb
75
89
  - app/jobs/update_hosts_vmware_facets.rb
@@ -103,7 +117,6 @@ files:
103
117
  - app/models/foreman_wreckingball/vmware_cluster.rb
104
118
  - app/models/foreman_wreckingball/vmware_facet.rb
105
119
  - app/models/foreman_wreckingball/vmware_hypervisor_facet.rb
106
- - app/models/setting/wreckingball.rb
107
120
  - app/services/foreman_wreckingball/vmware_cluster_importer.rb
108
121
  - app/services/foreman_wreckingball/vmware_hypervisor_importer.rb
109
122
  - app/views/compute_resources/_hypervisors_tab.html.erb
@@ -128,6 +141,7 @@ files:
128
141
  - db/migrate/20180614105545_add_feature_capabilities_to_vmware_hypervisor_facets.rb
129
142
  - db/migrate/20181020174609_add_power_state_to_vmware_facets.rb
130
143
  - db/migrate/20181021111543_add_indexes_to_vmware_hypervisor_facets.rb
144
+ - db/migrate/20240201094513_fix_wreckingball_settings_category_to_dsl.rb
131
145
  - lib/foreman_wreckingball.rb
132
146
  - lib/foreman_wreckingball/engine.rb
133
147
  - lib/foreman_wreckingball/scheduled_jobs.rb
@@ -168,6 +182,7 @@ files:
168
182
  - test/models/host_test.rb
169
183
  - test/models/usergroup_test.rb
170
184
  - test/test_plugin_helper.rb
185
+ - test/unit/foreman_wreckingball/access_permissions_test.rb
171
186
  - test/unit/foreman_wreckingball/vmware_cluster_importer_test.rb
172
187
  - test/unit/foreman_wreckingball/vmware_hypervisor_importer_test.rb
173
188
  homepage: https://github.com/dm-drogeriemarkt/foreman_wreckingball
@@ -182,48 +197,52 @@ required_ruby_version: !ruby/object:Gem::Requirement
182
197
  requirements:
183
198
  - - ">="
184
199
  - !ruby/object:Gem::Version
185
- version: '0'
200
+ version: '2.5'
201
+ - - "<"
202
+ - !ruby/object:Gem::Version
203
+ version: '4'
186
204
  required_rubygems_version: !ruby/object:Gem::Requirement
187
205
  requirements:
188
206
  - - ">="
189
207
  - !ruby/object:Gem::Version
190
208
  version: '0'
191
209
  requirements: []
192
- rubygems_version: 3.2.28
210
+ rubygems_version: 3.4.1
193
211
  signing_key:
194
212
  specification_version: 4
195
213
  summary: Adds status checks of the VMWare VMs to Foreman.
196
214
  test_files:
197
- - test/unit/foreman_wreckingball/vmware_cluster_importer_test.rb
198
- - test/unit/foreman_wreckingball/vmware_hypervisor_importer_test.rb
215
+ - test/actions/foreman_wreckingball/bulk_remediate_test.rb
216
+ - test/actions/foreman_wreckingball/host/refresh_vmware_facet_test.rb
217
+ - test/actions/foreman_wreckingball/host/remediate_hardware_version_test.rb
218
+ - test/actions/foreman_wreckingball/host/remediate_spectre_v2_test.rb
219
+ - test/actions/foreman_wreckingball/host/remediate_vmware_operatingsystem_test.rb
220
+ - test/actions/foreman_wreckingball/vmware/schedule_vmware_sync_test.rb
221
+ - test/actions/foreman_wreckingball/vmware/sync_compute_resource_test.rb
222
+ - test/controllers/compute_resources_controller_test.rb
223
+ - test/controllers/foreman_wreckingball/hosts_controller_test.rb
224
+ - test/factories/compute_resource.rb
225
+ - test/factories/foreman_wreckingball_factories.rb
226
+ - test/factories/host.rb
227
+ - test/factories/task.rb
228
+ - test/helpers/foreman_wreckingball/status_helper.rb
199
229
  - test/integration/hosts_status_dashboard_test.rb
200
230
  - test/integration/hosts_status_managed_hosts_test.rb
231
+ - test/integration_test_plugin_helper.rb
201
232
  - test/models/compute_resource_test.rb
202
- - test/models/host_test.rb
203
- - test/models/usergroup_test.rb
233
+ - test/models/compute_resources/vmware_test.rb
234
+ - test/models/foreman_wreckingball/cpu_hot_add_status_test.rb
235
+ - test/models/foreman_wreckingball/hardware_version_status_test.rb
204
236
  - test/models/foreman_wreckingball/operatingsystem_status_test.rb
205
237
  - test/models/foreman_wreckingball/spectre_v2_status_test.rb
206
- - test/models/foreman_wreckingball/vmware_hypervisor_facet_test.rb
207
- - test/models/foreman_wreckingball/hardware_version_status_test.rb
208
- - test/models/foreman_wreckingball/cpu_hot_add_status_test.rb
238
+ - test/models/foreman_wreckingball/tools_status_test.rb
209
239
  - test/models/foreman_wreckingball/vmware_cluster_test.rb
210
240
  - test/models/foreman_wreckingball/vmware_facet_test.rb
211
- - test/models/foreman_wreckingball/tools_status_test.rb
241
+ - test/models/foreman_wreckingball/vmware_hypervisor_facet_test.rb
212
242
  - test/models/host_status_test.rb
213
- - test/models/compute_resources/vmware_test.rb
214
- - test/factories/compute_resource.rb
215
- - test/factories/host.rb
216
- - test/factories/foreman_wreckingball_factories.rb
217
- - test/factories/task.rb
218
- - test/actions/foreman_wreckingball/host/remediate_vmware_operatingsystem_test.rb
219
- - test/actions/foreman_wreckingball/host/remediate_hardware_version_test.rb
220
- - test/actions/foreman_wreckingball/host/refresh_vmware_facet_test.rb
221
- - test/actions/foreman_wreckingball/host/remediate_spectre_v2_test.rb
222
- - test/actions/foreman_wreckingball/bulk_remediate_test.rb
223
- - test/actions/foreman_wreckingball/vmware/sync_compute_resource_test.rb
224
- - test/actions/foreman_wreckingball/vmware/schedule_vmware_sync_test.rb
243
+ - test/models/host_test.rb
244
+ - test/models/usergroup_test.rb
225
245
  - test/test_plugin_helper.rb
226
- - test/controllers/compute_resources_controller_test.rb
227
- - test/controllers/foreman_wreckingball/hosts_controller_test.rb
228
- - test/helpers/foreman_wreckingball/status_helper.rb
229
- - test/integration_test_plugin_helper.rb
246
+ - test/unit/foreman_wreckingball/access_permissions_test.rb
247
+ - test/unit/foreman_wreckingball/vmware_cluster_importer_test.rb
248
+ - test/unit/foreman_wreckingball/vmware_hypervisor_importer_test.rb
@@ -1,26 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class Setting
4
- class Wreckingball < ::Setting
5
- def self.default_settings
6
- [
7
- set('min_vsphere_hardware_version', N_('Minimum required Hardware version for vSphere VMs'), 13, N_('Hardware version'))
8
- ]
9
- end
10
-
11
- def self.load_defaults
12
- return unless ActiveRecord::Base.connection.table_exists?('settings')
13
- return unless super
14
-
15
- Setting.transaction do
16
- default_settings.compact.each { |s| Setting::Wreckingball.create s.update(category: 'Setting::Wreckingball') }
17
- end
18
-
19
- true
20
- end
21
-
22
- def self.humanized_category
23
- N_('Wreckingball')
24
- end
25
- end
26
- end