foreman_rh_cloud 13.2.0 → 14.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/foreman_rh_cloud/locale/fr/foreman_rh_cloud.js +133 -1
  3. data/app/assets/javascripts/foreman_rh_cloud/locale/ja/foreman_rh_cloud.js +133 -1
  4. data/app/assets/javascripts/foreman_rh_cloud/locale/ka/foreman_rh_cloud.js +133 -1
  5. data/app/assets/javascripts/foreman_rh_cloud/locale/ko/foreman_rh_cloud.js +133 -1
  6. data/app/assets/javascripts/foreman_rh_cloud/locale/zh_CN/foreman_rh_cloud.js +133 -1
  7. data/lib/foreman_inventory_upload/generators/fact_helpers.rb +0 -8
  8. data/lib/foreman_inventory_upload/generators/queries.rb +13 -3
  9. data/lib/foreman_inventory_upload/generators/slice.rb +1 -1
  10. data/lib/foreman_inventory_upload.rb +23 -8
  11. data/lib/foreman_rh_cloud/version.rb +1 -1
  12. data/locale/Makefile +3 -3
  13. data/locale/foreman_rh_cloud.pot +245 -41
  14. data/locale/fr/LC_MESSAGES/foreman_rh_cloud.mo +0 -0
  15. data/locale/fr/foreman_rh_cloud.edit.po +1032 -0
  16. data/locale/fr/foreman_rh_cloud.po +133 -1
  17. data/locale/fr/foreman_rh_cloud.po.time_stamp +0 -0
  18. data/locale/ja/LC_MESSAGES/foreman_rh_cloud.mo +0 -0
  19. data/locale/ja/foreman_rh_cloud.edit.po +1026 -0
  20. data/locale/ja/foreman_rh_cloud.po +133 -1
  21. data/locale/ja/foreman_rh_cloud.po.time_stamp +0 -0
  22. data/locale/ka/LC_MESSAGES/foreman_rh_cloud.mo +0 -0
  23. data/locale/ka/foreman_rh_cloud.edit.po +1025 -0
  24. data/locale/ka/foreman_rh_cloud.po +133 -1
  25. data/locale/ka/foreman_rh_cloud.po.time_stamp +0 -0
  26. data/locale/ko/LC_MESSAGES/foreman_rh_cloud.mo +0 -0
  27. data/locale/ko/foreman_rh_cloud.edit.po +1029 -0
  28. data/locale/ko/foreman_rh_cloud.po +133 -1
  29. data/locale/ko/foreman_rh_cloud.po.time_stamp +0 -0
  30. data/locale/zh_CN/LC_MESSAGES/foreman_rh_cloud.mo +0 -0
  31. data/locale/zh_CN/foreman_rh_cloud.edit.po +1031 -0
  32. data/locale/zh_CN/foreman_rh_cloud.po +133 -1
  33. data/locale/zh_CN/foreman_rh_cloud.po.time_stamp +0 -0
  34. data/package.json +1 -1
  35. data/test/controllers/insights_cloud/api/advisor_engine_controller_test.rb +5 -0
  36. data/test/controllers/insights_cloud/api/machine_telemetries_controller_test.rb +6 -1
  37. data/test/controllers/insights_sync/settings_controller_test.rb +5 -0
  38. data/test/jobs/host_inventory_report_job_test.rb +2 -0
  39. data/test/jobs/inventory_full_sync_test.rb +4 -7
  40. data/test/jobs/inventory_hosts_sync_test.rb +5 -7
  41. data/test/jobs/inventory_scheduled_sync_test.rb +5 -0
  42. data/test/jobs/inventory_self_host_sync_test.rb +1 -1
  43. data/test/jobs/single_host_report_job_test.rb +2 -0
  44. data/test/jobs/upload_report_direct_job_test.rb +5 -0
  45. data/test/unit/archived_report_generator_test.rb +1 -2
  46. data/test/unit/fact_helpers_test.rb +0 -16
  47. data/test/unit/lib/foreman_rh_cloud/registration_manager_extensions_test.rb +5 -0
  48. data/test/unit/lib/insights_cloud/async/vmaas_reposcan_sync_test.rb +5 -0
  49. data/test/unit/rh_cloud_http_proxy_test.rb +5 -0
  50. data/test/unit/services/foreman_rh_cloud/branch_info_test.rb +1 -1
  51. data/test/unit/services/foreman_rh_cloud/cloud_request_forwarder_test.rb +1 -1
  52. data/test/unit/slice_generator_test.rb +43 -22
  53. metadata +16 -3
@@ -13,7 +13,7 @@
13
13
  #
14
14
  msgid ""
15
15
  msgstr ""
16
- "Project-Id-Version: foreman_rh_cloud 13.0.5\n"
16
+ "Project-Id-Version: foreman_rh_cloud 13.2.0\n"
17
17
  "Report-Msgid-Bugs-To: \n"
18
18
  "PO-Revision-Date: 2023-01-20 13:26+0000\n"
19
19
  "Last-Translator: Ondřej Gajdušek, 2025\n"
@@ -31,6 +31,9 @@ msgstr " 同步所有清单状态"
31
31
  msgid "%s organizations"
32
32
  msgstr "%s 机构"
33
33
 
34
+ msgid "A specific organization must be selected from the organization context."
35
+ msgstr ""
36
+
34
37
  msgid "About subscription watch"
35
38
  msgstr "订阅查看"
36
39
 
@@ -43,6 +46,9 @@ msgstr "高级清单设置"
43
46
  msgid "All recommendations are now selected."
44
47
  msgstr "现在选择了所有建议。"
45
48
 
49
+ msgid "Analysis disabled"
50
+ msgstr ""
51
+
46
52
  msgid "Analytics data collection"
47
53
  msgstr "数据收集分析"
48
54
 
@@ -52,6 +58,9 @@ msgstr "任意机构"
52
58
  msgid "Apply Insights recommendations"
53
59
  msgstr "应用 Insights 建议"
54
60
 
61
+ msgid "Attempted to destroy HBI host %s, but host does not exist in HBI"
62
+ msgstr ""
63
+
55
64
  msgid "Automatic inventory upload"
56
65
  msgstr "自动清单上传"
57
66
 
@@ -91,6 +100,9 @@ msgstr "云连接器设置现在正在进行: "
91
100
  msgid "Completed"
92
101
  msgstr "完成"
93
102
 
103
+ msgid "Completed with warnings"
104
+ msgstr ""
105
+
94
106
  msgid "Configure"
95
107
  msgstr "配置"
96
108
 
@@ -109,6 +121,15 @@ msgstr "关键"
109
121
  msgid "Current page"
110
122
  msgstr "当前页"
111
123
 
124
+ msgid "Details"
125
+ msgstr ""
126
+
127
+ msgid "Disable"
128
+ msgstr ""
129
+
130
+ msgid "Disable vulnerability analysis"
131
+ msgstr ""
132
+
112
133
  msgid "Disconnected hosts: "
113
134
  msgstr "断开连接的主机:"
114
135
 
@@ -124,6 +145,15 @@ msgstr "下载报告"
124
145
  msgid "Download latest report"
125
146
  msgstr "下载最新的报告"
126
147
 
148
+ msgid "Download report"
149
+ msgstr ""
150
+
151
+ msgid "Duration"
152
+ msgstr ""
153
+
154
+ msgid "Enable"
155
+ msgstr ""
156
+
127
157
  msgid "Enable automatic deletion of mismatched host records from the Red Hat cloud"
128
158
  msgstr "启用自动删除来自红帽云的主机记录"
129
159
 
@@ -148,6 +178,9 @@ msgstr "启用云连接器"
148
178
  msgid "Enable inventory upload"
149
179
  msgstr "启用清单上传"
150
180
 
181
+ msgid "Enable vulnerability analysis"
182
+ msgstr ""
183
+
151
184
  msgid "Encountered an error while trying to access the server:"
152
185
  msgstr "在尝试访问服务器时遇到错误:"
153
186
 
@@ -163,6 +196,18 @@ msgstr ""
163
196
  msgid "Exit Code: %s"
164
197
  msgstr "退出代码:%s"
165
198
 
199
+ msgid "Failed"
200
+ msgstr ""
201
+
202
+ msgid "Failed to destroy HBI host %s: %s"
203
+ msgstr ""
204
+
205
+ msgid "Failed to fetch hosts"
206
+ msgstr ""
207
+
208
+ msgid "Failed to update vulnerability analysis status"
209
+ msgstr ""
210
+
166
211
  msgid "Fetch Insights-related host details"
167
212
  msgstr "获取与 Insights 相关的主机详情"
168
213
 
@@ -199,6 +244,9 @@ msgstr "生成报告"
199
244
  msgid "Generate the report, but do not upload"
200
245
  msgstr "生成报告,但不上传"
201
246
 
247
+ msgid "Generated"
248
+ msgstr ""
249
+
202
250
  msgid "Generating"
203
251
  msgstr "生成中"
204
252
 
@@ -247,6 +295,9 @@ msgstr "在 insights-client 报告中包含参数"
247
295
  msgid "Insights"
248
296
  msgstr "Insights"
249
297
 
298
+ msgid "Invalid response from server"
299
+ msgstr ""
300
+
250
301
  msgid "Inventory"
251
302
  msgstr "清单"
252
303
 
@@ -283,6 +334,9 @@ msgstr "载入中..."
283
334
  msgid "Low"
284
335
  msgstr "低"
285
336
 
337
+ msgid "Manage vulnerability analysis"
338
+ msgstr ""
339
+
286
340
  msgid "Manual"
287
341
  msgstr "手册"
288
342
 
@@ -298,21 +352,42 @@ msgstr "中等"
298
352
  msgid "More details can be found in"
299
353
  msgstr "如需更多详细信息,请参阅"
300
354
 
355
+ msgid "N/A"
356
+ msgstr ""
357
+
301
358
  msgid "Next run: "
302
359
  msgstr "下一次运行 :"
303
360
 
304
361
  msgid "No"
305
362
  msgstr "否"
306
363
 
364
+ msgid "No account data available."
365
+ msgstr ""
366
+
367
+ msgid "No recent tasks"
368
+ msgstr ""
369
+
307
370
  msgid "No recommendations were found for this host!"
308
371
  msgstr "没有找到此主机的建议!"
309
372
 
373
+ msgid "No report generation tasks have been run yet."
374
+ msgstr ""
375
+
310
376
  msgid "No results found"
311
377
  msgstr "没有找到结果"
312
378
 
379
+ msgid "No task history"
380
+ msgstr ""
381
+
313
382
  msgid "No task was found"
314
383
  msgstr "没有找到任务"
315
384
 
385
+ msgid "No tasks have been run yet."
386
+ msgstr ""
387
+
388
+ msgid "None of the selected hosts are registered"
389
+ msgstr ""
390
+
316
391
  msgid "Not reporting"
317
392
  msgstr "未报告"
318
393
 
@@ -358,9 +433,15 @@ msgstr "机构标签"
358
433
  msgid "Pagination"
359
434
  msgstr "分页"
360
435
 
436
+ msgid "Paused"
437
+ msgstr ""
438
+
361
439
  msgid "Playbook"
362
440
  msgstr "运行 playbook"
363
441
 
442
+ msgid "Previous tasks will appear here."
443
+ msgstr ""
444
+
364
445
  msgid "RH Cloud"
365
446
  msgstr "RH Cloud"
366
447
 
@@ -415,6 +496,18 @@ msgstr "补救"
415
496
  msgid "Remediation summary"
416
497
  msgstr "补救概述"
417
498
 
499
+ msgid "Report Generation"
500
+ msgstr ""
501
+
502
+ msgid "Report generation and upload started"
503
+ msgstr ""
504
+
505
+ msgid "Report generation started"
506
+ msgstr ""
507
+
508
+ msgid "Report saved to"
509
+ msgstr ""
510
+
418
511
  msgid "Reporting"
419
512
  msgstr "报告"
420
513
 
@@ -430,6 +523,9 @@ msgstr "运行由红帽补救应用生成的 playbook"
430
523
  msgid "Run remediation playbook generated by Insights"
431
524
  msgstr "运行 Insights 生成的补救 playbook"
432
525
 
526
+ msgid "Running"
527
+ msgstr ""
528
+
433
529
  msgid "Satellite server has %{hits_count} recommendations by Red Hat"
434
530
  msgstr "Satellite 服务器有 %{hits_count} 个红帽提供的建议"
435
531
 
@@ -469,6 +565,15 @@ msgstr "启动清单同步"
469
565
  msgid "Start report generation"
470
566
  msgstr "开始报告生成"
471
567
 
568
+ msgid "Started"
569
+ msgstr ""
570
+
571
+ msgid "Stopped"
572
+ msgstr ""
573
+
574
+ msgid "Success"
575
+ msgstr ""
576
+
472
577
  msgid "Successfully synced hosts: "
473
578
  msgstr "成功同步的主机:"
474
579
 
@@ -526,15 +631,24 @@ msgstr "总风险"
526
631
  msgid "Total risks"
527
632
  msgstr "总风险"
528
633
 
634
+ msgid "Unknown"
635
+ msgstr ""
636
+
529
637
  msgid "Upload hits from iop-advisor-engine"
530
638
  msgstr "从 iop-advisor-engine 上传 hits"
531
639
 
532
640
  msgid "Upload hits information"
533
641
  msgstr "上传 hits 信息"
534
642
 
643
+ msgid "Upload is disabled because subscription connection is not enabled. Enable it in Administer > Settings > Content."
644
+ msgstr ""
645
+
535
646
  msgid "Upload rules related to the hits"
536
647
  msgstr "上传与 hits 相关的 rule"
537
648
 
649
+ msgid "Uploaded"
650
+ msgstr ""
651
+
538
652
  msgid "Uploading"
539
653
  msgstr "上载中"
540
654
 
@@ -547,18 +661,36 @@ msgstr "查看所有建议"
547
661
  msgid "View in Red Hat Insights"
548
662
  msgstr "禁用 Red Hat Insights"
549
663
 
664
+ msgid "View task"
665
+ msgstr ""
666
+
667
+ msgid "View task details"
668
+ msgstr ""
669
+
550
670
  msgid "Vulnerabilities"
551
671
  msgstr "安全漏洞"
552
672
 
553
673
  msgid "Vulnerability"
554
674
  msgstr "安全漏洞"
555
675
 
676
+ msgid "Vulnerability analysis disabled"
677
+ msgstr ""
678
+
679
+ msgid "Vulnerability analysis enabled"
680
+ msgstr ""
681
+
556
682
  msgid "Wait and %s"
557
683
  msgstr "等待和 %s"
558
684
 
685
+ msgid "Warning"
686
+ msgstr ""
687
+
559
688
  msgid "Whether the resolution requires reboot"
560
689
  msgstr "resolution 是否需要重启"
561
690
 
691
+ msgid "You do not have permission to perform this action"
692
+ msgstr ""
693
+
562
694
  msgid "category name"
563
695
  msgstr "类别名称"
564
696
 
File without changes
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foreman_rh_cloud",
3
- "version": "13.2.0",
3
+ "version": "14.0.1",
4
4
  "description": "Inventory Upload =============",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -12,6 +12,11 @@ module InsightsCloud
12
12
  @host3 = FactoryBot.create(:host, organization: @test_org)
13
13
  end
14
14
 
15
+ teardown do
16
+ # Ensure stubs are cleaned up to avoid leakage into other tests
17
+ ForemanRhCloud.unstub(:with_iop_smart_proxy?)
18
+ end
19
+
15
20
  test 'shows hosts with uuids' do
16
21
  uuids = [@host1.insights_uuid, @host2.insights_uuid]
17
22
  get :host_details, params: { organization_id: @test_org.id, host_uuids: uuids }
@@ -9,6 +9,11 @@ module InsightsCloud::Api
9
9
  FactoryBot.create(:common_parameter, name: InsightsCloud.enable_client_param, key_type: 'boolean', value: true)
10
10
  end
11
11
 
12
+ teardown do
13
+ # Ensure stubs are cleaned up to avoid leakage into other tests
14
+ ForemanRhCloud.unstub(:with_iop_smart_proxy?)
15
+ end
16
+
12
17
  context '#forward_request' do
13
18
  include MockCerts
14
19
 
@@ -187,7 +192,7 @@ module InsightsCloud::Api
187
192
  organization: env.organization
188
193
  )
189
194
 
190
- @host.subscription_facet.pools << FactoryBot.create(:katello_pool, account_number: '5678', cp_id: 1)
195
+ @host.organization.pools << FactoryBot.create(:katello_pool, account_number: '5678', cp_id: 1)
191
196
 
192
197
  uuid = @host.subscription_facet.uuid
193
198
 
@@ -6,6 +6,11 @@ class SettingsControllerTest < ActionController::TestCase
6
6
  ForemanRhCloud.stubs(:with_iop_smart_proxy?).returns(false)
7
7
  end
8
8
 
9
+ def teardown
10
+ # Ensure stubs are cleaned up to avoid leakage into other tests
11
+ ForemanRhCloud.unstub(:with_iop_smart_proxy?)
12
+ end
13
+
9
14
  test 'should return allow_auto_insights_sync setting' do
10
15
  Setting[:allow_auto_insights_sync] = false
11
16
 
@@ -12,6 +12,8 @@ class HostInventoryReportJobTest < ActiveSupport::TestCase
12
12
 
13
13
  teardown do
14
14
  FileUtils.remove_entry base_folder if Dir.exist?(base_folder)
15
+ # Ensure stubs are cleaned up to avoid leakage into other tests
16
+ ForemanRhCloud.unstub(:with_iop_smart_proxy?)
15
17
  end
16
18
 
17
19
  test 'plan schedules GenerateHostReport action' do
@@ -27,7 +27,7 @@ class InventoryFullSyncTest < ActiveSupport::TestCase
27
27
 
28
28
  pool = FactoryBot.create(:katello_pool, account_number: '1234', cp_id: 1)
29
29
 
30
- @host1.subscription_facet.pools << pool
30
+ @host1.organization.pools << pool
31
31
 
32
32
  # this host would pass our plugin queries, so it could be uploaded to the cloud.
33
33
  @host2 = FactoryBot.create(
@@ -39,7 +39,6 @@ class InventoryFullSyncTest < ActiveSupport::TestCase
39
39
  organization: env.organization
40
40
  )
41
41
 
42
- @host2.subscription_facet.pools << pool
43
42
  @host2_inventory_id = '4536bf5c-ff03-4154-a8c9-32ff4b40e40c'
44
43
 
45
44
  # this host would pass our plugin queries, so it could be uploaded to the cloud.
@@ -52,8 +51,6 @@ class InventoryFullSyncTest < ActiveSupport::TestCase
52
51
  organization: env.organization
53
52
  )
54
53
 
55
- @host3.subscription_facet.pools << pool
56
-
57
54
  ForemanInventoryUpload::Generators::Queries.instance_variable_set(:@fact_names, nil)
58
55
 
59
56
  inventory_json = <<-INVENTORY_JSON
@@ -88,7 +85,7 @@ class InventoryFullSyncTest < ActiveSupport::TestCase
88
85
  "facts": {
89
86
  "virtual_host_name": "virt-who-nobody.home-1",
90
87
  "satellite_instance_id": "fc4d0cb0-a0b0-421e-b096-b028319b8e47",
91
- "is_simple_content_access": false,
88
+ "is_simple_content_access": true,
92
89
  "distribution_version": "7.3",
93
90
  "satellite_version": "6.8.4",
94
91
  "organization_id": 1,
@@ -139,7 +136,7 @@ class InventoryFullSyncTest < ActiveSupport::TestCase
139
136
  "facts": {
140
137
  "virtual_host_name": "virt-who-nobody.home-1",
141
138
  "satellite_instance_id": "fc4d0cb0-a0b0-421e-b096-b028319b8e47",
142
- "is_simple_content_access": false,
139
+ "is_simple_content_access": true,
143
140
  "distribution_version": "8.3",
144
141
  "satellite_version": "6.8.4",
145
142
  "organization_id": 1,
@@ -192,7 +189,7 @@ class InventoryFullSyncTest < ActiveSupport::TestCase
192
189
  "facts": {
193
190
  "satellite_instance_id": "fb3643d8-9030-487b-b95c-684783806ffd",
194
191
  "system_purpose_sla": "",
195
- "is_simple_content_access": false,
192
+ "is_simple_content_access": true,
196
193
  "distribution_version": "8.3",
197
194
  "satellite_version": "6.8.1",
198
195
  "organization_id": 1,
@@ -23,7 +23,7 @@ class InventoryHostsSyncTest < ActiveSupport::TestCase
23
23
 
24
24
  pool = FactoryBot.create(:katello_pool, account_number: '1234', cp_id: 1)
25
25
 
26
- @host1.subscription_facet.pools << pool
26
+ @host1.organization.pools << pool
27
27
 
28
28
  # this host would pass our plugin queries, so it could be uploaded to the cloud.
29
29
  @host2 = FactoryBot.create(
@@ -34,8 +34,6 @@ class InventoryHostsSyncTest < ActiveSupport::TestCase
34
34
  lifecycle_environment: env,
35
35
  organization: env.organization
36
36
  )
37
-
38
- @host2.subscription_facet.pools << pool
39
37
  @host2_inventory_id = '4536bf5c-ff03-4154-a8c9-32ff4b40e40c'
40
38
 
41
39
  ForemanInventoryUpload::Generators::Queries.instance_variable_set(:@fact_names, nil)
@@ -71,7 +69,7 @@ class InventoryHostsSyncTest < ActiveSupport::TestCase
71
69
  "facts": {
72
70
  "virtual_host_name": "virt-who-nobody.home-1",
73
71
  "satellite_instance_id": "fc4d0cb0-a0b0-421e-b096-b028319b8e47",
74
- "is_simple_content_access": false,
72
+ "is_simple_content_access": true,
75
73
  "distribution_version": "7.3",
76
74
  "satellite_version": "6.8.4",
77
75
  "organization_id": 1,
@@ -122,7 +120,7 @@ class InventoryHostsSyncTest < ActiveSupport::TestCase
122
120
  "facts": {
123
121
  "virtual_host_name": "virt-who-nobody.home-1",
124
122
  "satellite_instance_id": "fc4d0cb0-a0b0-421e-b096-b028319b8e47",
125
- "is_simple_content_access": false,
123
+ "is_simple_content_access": true,
126
124
  "distribution_version": "7.3",
127
125
  "satellite_version": "6.8.4",
128
126
  "organization_id": 1,
@@ -173,7 +171,7 @@ class InventoryHostsSyncTest < ActiveSupport::TestCase
173
171
  "facts": {
174
172
  "virtual_host_name": "virt-who-nobody.home-1",
175
173
  "satellite_instance_id": "fc4d0cb0-a0b0-421e-b096-b028319b8e47",
176
- "is_simple_content_access": false,
174
+ "is_simple_content_access": true,
177
175
  "distribution_version": "8.3",
178
176
  "satellite_version": "6.8.4",
179
177
  "organization_id": 1,
@@ -226,7 +224,7 @@ class InventoryHostsSyncTest < ActiveSupport::TestCase
226
224
  "facts": {
227
225
  "satellite_instance_id": "fb3643d8-9030-487b-b95c-684783806ffd",
228
226
  "system_purpose_sla": "",
229
- "is_simple_content_access": false,
227
+ "is_simple_content_access": true,
230
228
  "distribution_version": "8.3",
231
229
  "satellite_version": "6.8.1",
232
230
  "organization_id": 1,
@@ -4,6 +4,11 @@ require 'foreman_tasks/test_helpers'
4
4
  class InventoryScheduledSyncTest < ActiveSupport::TestCase
5
5
  include Dynflow::Testing::Factories
6
6
 
7
+ teardown do
8
+ # Ensure stubs are cleaned up to avoid leakage into other tests
9
+ ForemanRhCloud.unstub(:with_iop_smart_proxy?)
10
+ end
11
+
7
12
  test 'Schedules an execution if auto upload is enabled' do
8
13
  Setting[:allow_auto_inventory_upload] = true
9
14
  Setting[:allow_auto_insights_mismatch_delete] = true
@@ -53,7 +53,7 @@ class InventorySelfHostSyncTest < ActiveSupport::TestCase
53
53
  "facts": {
54
54
  "virtual_host_name": "virt-who-nobody.home-1",
55
55
  "satellite_instance_id": "fc4d0cb0-a0b0-421e-b096-b028319b8e47",
56
- "is_simple_content_access": false,
56
+ "is_simple_content_access": true,
57
57
  "distribution_version": "8.3",
58
58
  "satellite_version": "6.8.4",
59
59
  "organization_id": 1,
@@ -25,6 +25,8 @@ class SingleHostReportJobTest < ActiveSupport::TestCase
25
25
 
26
26
  teardown do
27
27
  FileUtils.remove_entry base_folder if Dir.exist?(base_folder)
28
+ # Ensure stubs are cleaned up to avoid leakage into other tests
29
+ ForemanRhCloud.unstub(:with_iop_smart_proxy?)
28
30
  end
29
31
 
30
32
  test 'plan sets host_id in input' do
@@ -30,6 +30,11 @@ class UploadReportDirectJobTest < ActiveSupport::TestCase
30
30
  Organization.any_instance.stubs(:owner_details).returns(@cert_data)
31
31
  end
32
32
 
33
+ teardown do
34
+ # Ensure stubs are cleaned up to avoid leakage into other tests
35
+ ForemanRhCloud.unstub(:with_iop_smart_proxy?)
36
+ end
37
+
33
38
  test 'plan sets input correctly' do
34
39
  action = create_action(ForemanInventoryUpload::Async::UploadReportDirectJob)
35
40
  action.expects(:action_subject).with(@organization)
@@ -18,7 +18,7 @@ class ArchivedReportGeneratorTest < ActiveSupport::TestCase
18
18
  organization: env.organization
19
19
  )
20
20
 
21
- @host.subscription_facet.pools << FactoryBot.create(:katello_pool, account_number: '1234', cp_id: 1)
21
+ @host.organization.pools << FactoryBot.create(:katello_pool, account_number: '1234', cp_id: 1)
22
22
  end
23
23
 
24
24
  def interesting_facts
@@ -51,7 +51,6 @@ class ArchivedReportGeneratorTest < ActiveSupport::TestCase
51
51
  test_org = FactoryBot.create(:organization)
52
52
 
53
53
  ForemanInventoryUpload::Generators::Queries.expects(:for_org).with(test_org.id, hosts_query: '').returns(batches)
54
- ForemanInventoryUpload::Generators::Slice.any_instance.stubs(:golden_ticket?).returns(false)
55
54
  Dir.mktmpdir do |tmpdir|
56
55
  target = File.join(tmpdir, 'test.tar.gz')
57
56
  generator = ForemanInventoryUpload::Generators::ArchivedReport.new(target, Logger.new(STDOUT))
@@ -12,22 +12,6 @@ class FactHelpersTest < ActiveSupport::TestCase
12
12
  @org = FactoryBot.create(:organization)
13
13
  end
14
14
 
15
- test 'golden_ticket uses golden_ticket method when defined' do
16
- @org.expects(:golden_ticket?).returns(true)
17
-
18
- actual = @instance.golden_ticket?(@org)
19
-
20
- assert actual
21
- end
22
-
23
- test 'golden_ticket uses content_access_mode method when golden_ticket not defined' do
24
- @org.expects(:content_access_mode).returns('org_environment')
25
-
26
- actual = @instance.golden_ticket?(@org)
27
-
28
- assert actual
29
- end
30
-
31
15
  test 'obfuscates ips with insights-client data' do
32
16
  host = mock('host')
33
17
  @instance.expects(:fact_value).with(host, 'insights_client::obfuscated_ipv4').returns(
@@ -14,6 +14,11 @@ module ForemanRhCloud
14
14
  Katello::RegistrationManager.stubs(:execute_cloud_request).returns(true)
15
15
  end
16
16
 
17
+ teardown do
18
+ # Ensure stubs are cleaned up to avoid leakage into other tests
19
+ ForemanRhCloud.unstub(:with_iop_smart_proxy?)
20
+ end
21
+
17
22
  context 'unregister_host' do
18
23
  test 'should call HBI delete in IoP mode when host has insights UUID' do
19
24
  ForemanRhCloud.stubs(:with_iop_smart_proxy?).returns(true)
@@ -20,6 +20,11 @@ class VmaasReposcanSyncTest < ActiveSupport::TestCase
20
20
  ForemanRhCloud.stubs(:with_iop_smart_proxy?).returns(true)
21
21
  end
22
22
 
23
+ teardown do
24
+ # Ensure stubs are cleaned up to avoid leakage into other tests
25
+ ForemanRhCloud.unstub(:with_iop_smart_proxy?)
26
+ end
27
+
23
28
  # Planning behavior
24
29
  test 'plan plans_self when repo payload has id and IoP is available' do
25
30
  InsightsCloud::Async::VmaasReposcanSync.any_instance.expects(:plan_self).once
@@ -7,6 +7,11 @@ class RhCloudHttpProxyTest < ActiveSupport::TestCase
7
7
  ForemanRhCloud.stubs(:with_iop_smart_proxy?).returns(false)
8
8
  end
9
9
 
10
+ teardown do
11
+ # Ensure stubs are cleaned up to avoid leakage into other tests
12
+ ForemanRhCloud.unstub(:with_iop_smart_proxy?)
13
+ end
14
+
10
15
  test 'selects global content proxy' do
11
16
  setup_global_content_proxy
12
17
  setup_global_foreman_proxy
@@ -19,7 +19,7 @@ class BranchInfoTest < ActiveSupport::TestCase
19
19
  organization: env.organization
20
20
  )
21
21
 
22
- @host.subscription_facet.pools << FactoryBot.create(:katello_pool, account_number: '5678', cp_id: 1)
22
+ @host.organization.pools << FactoryBot.create(:katello_pool, account_number: '5678', cp_id: 1)
23
23
  end
24
24
 
25
25
  test 'should generate branch info for host' do
@@ -29,7 +29,7 @@ class CloudRequestForwarderTest < ActiveSupport::TestCase
29
29
  organization: env.organization
30
30
  )
31
31
 
32
- @host.subscription_facet.pools << FactoryBot.create(:katello_pool, account_number: '5678', cp_id: 1)
32
+ @host.organization.pools << FactoryBot.create(:katello_pool, account_number: '5678', cp_id: 1)
33
33
  end
34
34
 
35
35
  test 'should prepare correct cloud url' do