foreman_openscap 0.8.3 → 0.8.4

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 (96) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/api/v2/compliance/arf_reports_controller.rb +15 -6
  3. data/app/controllers/api/v2/compliance/policies_controller.rb +4 -2
  4. data/app/controllers/api/v2/compliance/scap_contents_controller.rb +3 -2
  5. data/app/controllers/api/v2/compliance/tailoring_files_controller.rb +3 -2
  6. data/app/controllers/arf_reports_controller.rb +4 -4
  7. data/app/controllers/policies_controller.rb +6 -5
  8. data/app/controllers/scap_contents_controller.rb +3 -3
  9. data/app/helpers/arf_report_dashboard_helper.rb +1 -1
  10. data/app/helpers/arf_reports_helper.rb +8 -8
  11. data/app/helpers/compliance_dashboard_helper.rb +0 -2
  12. data/app/helpers/compliance_hosts_helper.rb +7 -8
  13. data/app/helpers/policies_helper.rb +18 -18
  14. data/app/helpers/policy_dashboard_helper.rb +3 -3
  15. data/app/lib/proxy_api/available_proxy.rb +2 -2
  16. data/app/lib/proxy_api/openscap.rb +1 -1
  17. data/app/mailers/foreman_openscap/policy_mailer.rb +0 -2
  18. data/app/models/concerns/foreman_openscap/compliance_status_scoped_search.rb +7 -7
  19. data/app/models/concerns/foreman_openscap/data_stream_content.rb +1 -1
  20. data/app/models/concerns/foreman_openscap/host_extensions.rb +16 -6
  21. data/app/models/concerns/foreman_openscap/openscap_proxy_extensions.rb +1 -1
  22. data/app/models/foreman_openscap/arf_report.rb +5 -5
  23. data/app/models/foreman_openscap/policy.rb +6 -6
  24. data/app/models/foreman_openscap/scap_content.rb +2 -2
  25. data/app/models/foreman_openscap/tailoring_file.rb +1 -1
  26. data/app/services/foreman_openscap/arf_report_status_calculator.rb +0 -1
  27. data/app/services/foreman_openscap/host_report_dashboard/data.rb +2 -3
  28. data/app/services/foreman_openscap/openscap_proxy_version_check.rb +0 -1
  29. data/app/services/foreman_openscap/policy_dashboard/data.rb +7 -6
  30. data/app/services/foreman_openscap/report_dashboard/data.rb +1 -0
  31. data/app/views/api/v2/compliance/common/_loc.json.rabl +1 -1
  32. data/app/views/api/v2/compliance/common/_org.json.rabl +1 -1
  33. data/app/views/api/v2/compliance/policies/base.json.rabl +1 -1
  34. data/app/views/arf_reports/_list.html.erb +1 -1
  35. data/app/views/arf_reports/delete_multiple.html.erb +1 -1
  36. data/app/views/arf_reports/welcome.html.erb +12 -0
  37. data/app/views/compliance_hosts/show.html.erb +3 -1
  38. data/app/views/policy_dashboard/_policy_reports.html.erb +1 -1
  39. data/app/views/scap_contents/_list.html.erb +1 -1
  40. data/app/views/smart_proxies/_openscap_spool.html.erb +1 -1
  41. data/app/views/tailoring_files/_list.html.erb +1 -1
  42. data/config/routes.rb +9 -11
  43. data/db/migrate/20141015115511_add_arf_report_unique_constraint.rb +1 -1
  44. data/db/migrate/20141113221054_create_scaptimony_scap_content_profiles.rb +2 -3
  45. data/db/migrate/20141206211151_create_scaptimony_assets_policies.rb +1 -1
  46. data/db/migrate/20150115155947_add_scaptimony_scap_content_digest.rb +1 -1
  47. data/db/migrate/20150821100137_migrate_from_scaptimony.rb +1 -1
  48. data/db/migrate/20150929152345_move_arf_reports_to_reports_table.rb +0 -1
  49. data/db/migrate/20161223153249_add_permissions_to_arf_report.rb +2 -2
  50. data/db/migrate/20171016125613_add_content_title_unique_constraint.foreman_openscap.rb +6 -0
  51. data/lib/foreman_openscap/bulk_upload.rb +1 -1
  52. data/lib/foreman_openscap/engine.rb +54 -56
  53. data/lib/foreman_openscap/version.rb +1 -1
  54. data/lib/tasks/foreman_openscap_tasks.rake +11 -2
  55. data/locale/de/foreman_openscap.po +52 -13
  56. data/locale/en_GB/foreman_openscap.po +52 -13
  57. data/locale/es/foreman_openscap.po +52 -13
  58. data/locale/foreman_openscap.pot +140 -90
  59. data/locale/fr/foreman_openscap.po +52 -13
  60. data/locale/gl/foreman_openscap.po +52 -13
  61. data/locale/it/foreman_openscap.po +52 -13
  62. data/locale/ja/foreman_openscap.po +52 -13
  63. data/locale/ko/foreman_openscap.po +52 -13
  64. data/locale/pt_BR/foreman_openscap.po +52 -13
  65. data/locale/ru/foreman_openscap.po +52 -13
  66. data/locale/sv_SE/foreman_openscap.po +52 -13
  67. data/locale/zh_CN/foreman_openscap.po +52 -13
  68. data/locale/zh_TW/foreman_openscap.po +52 -13
  69. data/test/factories/arf_report_factory.rb +1 -1
  70. data/test/factories/asset_factory.rb +2 -2
  71. data/test/factories/compliance_host_factory.rb +2 -2
  72. data/test/factories/compliance_log_factory.rb +1 -1
  73. data/test/factories/policy_arf_report_factory.rb +1 -1
  74. data/test/factories/policy_factory.rb +3 -3
  75. data/test/factories/scap_content_related.rb +2 -2
  76. data/test/functional/api/v2/compliance/arf_reports_controller_test.rb +28 -9
  77. data/test/functional/api/v2/compliance/policies_controller_test.rb +16 -16
  78. data/test/functional/api/v2/compliance/scap_contents_controller_test.rb +8 -9
  79. data/test/functional/api/v2/compliance/tailoring_files_controller_test.rb +10 -11
  80. data/test/functional/arf_reports_controller_test.rb +4 -4
  81. data/test/functional/openscap_proxies_controller_test.rb +5 -3
  82. data/test/functional/tailoring_files_controller_test.rb +1 -1
  83. data/test/test_plugin_helper.rb +7 -7
  84. data/test/unit/arf_report_status_calculator_test.rb +0 -1
  85. data/test/unit/arf_report_test.rb +50 -50
  86. data/test/unit/compliance_status_test.rb +13 -13
  87. data/test/unit/concerns/host_extensions_test.rb +38 -22
  88. data/test/unit/concerns/openscap_proxy_extenstions_test.rb +5 -6
  89. data/test/unit/message_cleaner_test.rb +7 -7
  90. data/test/unit/openscap_host_test.rb +13 -13
  91. data/test/unit/policy_mailer_test.rb +12 -12
  92. data/test/unit/policy_test.rb +30 -30
  93. data/test/unit/scap_content_test.rb +4 -4
  94. data/test/unit/services/report_dashboard/data_test.rb +6 -6
  95. data/test/unit/services/tailoring_files_proxy_check_test.rb +1 -1
  96. metadata +4 -2
@@ -25,7 +25,7 @@ class ScapContentTest < ActiveSupport::TestCase
25
25
 
26
26
  test 'proxy_url should return the first available proxy it finds' do
27
27
  available_proxy = SmartProxy.with_features('Openscap').first
28
- unavailable_proxy = FactoryGirl.create(:smart_proxy, :url => 'http://proxy.example.com:8443', :features => [FactoryGirl.create(:feature, :name => 'Openscap')])
28
+ unavailable_proxy = FactoryBot.create(:smart_proxy, :url => 'http://proxy.example.com:8443', :features => [FactoryBot.create(:feature, :name => 'Openscap')])
29
29
  available_proxy.stubs(:proxy_url).returns(available_proxy.url)
30
30
  unavailable_proxy.stubs(:proxy_url).returns(nil)
31
31
  scap_content = ForemanOpenscap::ScapContent.new(:title => 'Fedora', :scap_file => @scap_file)
@@ -34,15 +34,15 @@ class ScapContentTest < ActiveSupport::TestCase
34
34
  end
35
35
 
36
36
  test 'should update profile title when fetching profiles from proxy' do
37
- scap_content = FactoryGirl.create(:scap_content)
37
+ scap_content = FactoryBot.create(:scap_content)
38
38
  scap_content.stubs(:fetch_profiles).returns({ "xccdf.test.profile" => "Changed title" })
39
- scap_profile = FactoryGirl.create(:scap_content_profile, :scap_content => scap_content, :profile_id => 'xccdf.test.profile', :title => "Original title")
39
+ scap_profile = FactoryBot.create(:scap_content_profile, :scap_content => scap_content, :profile_id => 'xccdf.test.profile', :title => "Original title")
40
40
  scap_content.create_profiles
41
41
  assert_equal scap_profile.reload.title, 'Changed title'
42
42
  end
43
43
 
44
44
  test 'should create profile when fetching profiles from proxy' do
45
- scap_content = FactoryGirl.create(:scap_content)
45
+ scap_content = FactoryBot.create(:scap_content)
46
46
  scap_content.stubs(:fetch_profiles).returns({ "xccdf.test.profile" => "My title" })
47
47
  scap_content.create_profiles
48
48
  assert scap_content.reload.scap_content_profiles.where(:title => 'My title').first
@@ -2,18 +2,18 @@ require 'test_plugin_helper'
2
2
 
3
3
  class DataTest < ActiveSupport::TestCase
4
4
  setup do
5
- @host = FactoryGirl.create(:compliance_host)
6
- @arf = FactoryGirl.create(:arf_report, :host_id => @host.id)
7
- @source = FactoryGirl.create(:source)
5
+ @host = FactoryBot.create(:compliance_host)
6
+ @arf = FactoryBot.create(:arf_report, :host_id => @host.id)
7
+ @source = FactoryBot.create(:source)
8
8
  @failed = []
9
9
  @passed = []
10
10
  3.times do
11
- @failed << FactoryGirl.create(:compliance_log, :report_id => @arf.id, :source => @source)
11
+ @failed << FactoryBot.create(:compliance_log, :report_id => @arf.id, :source => @source)
12
12
  end
13
13
  2.times do
14
- @passed << FactoryGirl.create(:compliance_log, :report_id => @arf.id, :result => "pass", :source => @source)
14
+ @passed << FactoryBot.create(:compliance_log, :report_id => @arf.id, :result => "pass", :source => @source)
15
15
  end
16
- @othered = [FactoryGirl.create(:compliance_log, :report_id => @arf.id, :result => "unknown", :source => @source)]
16
+ @othered = [FactoryBot.create(:compliance_log, :report_id => @arf.id, :result => "unknown", :source => @source)]
17
17
  end
18
18
 
19
19
  test 'should fetch data' do
@@ -19,7 +19,7 @@ class TailoringFilesProxyCheckTest < ActiveSupport::TestCase
19
19
 
20
20
  test 'should fail when proxy cannot be reached' do
21
21
  ProxyStatus::Version.any_instance.stubs(:version).raises(Foreman::WrappedException.new(nil, 'test message'))
22
- ForemanOpenscap::OpenscapProxyVersionCheck.any_instance.stubs(:get_openscap_proxies).returns([FactoryGirl.create(:openscap_proxy)])
22
+ ForemanOpenscap::OpenscapProxyVersionCheck.any_instance.stubs(:get_openscap_proxies).returns([FactoryBot.create(:openscap_proxy)])
23
23
  check = ForemanOpenscap::OpenscapProxyVersionCheck.new.run
24
24
  refute check.pass?
25
25
  refute check.message.empty?
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_openscap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.3
4
+ version: 0.8.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - slukasik@redhat.com
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-24 00:00:00.000000000 Z
11
+ date: 2018-01-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: deface
@@ -128,6 +128,7 @@ files:
128
128
  - app/views/arf_reports/index.html.erb
129
129
  - app/views/arf_reports/show.html.erb
130
130
  - app/views/arf_reports/show_html.html.erb
131
+ - app/views/arf_reports/welcome.html.erb
131
132
  - app/views/compliance_hosts/_compliance_status.erb
132
133
  - app/views/compliance_hosts/show.html.erb
133
134
  - app/views/dashboard/_compliance_host_reports_widget.html.erb
@@ -218,6 +219,7 @@ files:
218
219
  - db/migrate/20170821081205_rename_mail_notification.foreman_openscap.rb
219
220
  - db/migrate/20170830221751_add_index_to_logs_result.rb
220
221
  - db/migrate/20171011134112_remove_arf_reports_without_policy.rb
222
+ - db/migrate/20171016125613_add_content_title_unique_constraint.foreman_openscap.rb
221
223
  - db/seeds.d/75-job_templates.rb
222
224
  - db/seeds.d/openscap_feature.rb
223
225
  - db/seeds.d/openscap_policy_notification.rb