Sha256: 35b15922f1ee577d5921639a98b990ae3dc1de2629c6b202ecebfbca19b6b933

Contents?: true

Size: 1.21 KB

Versions: 69

Compression:

Stored size: 1.21 KB

Contents

require 'test_plugin_helper'

class TailoringFilesProxyCheckTest < ActiveSupport::TestCase
  test 'should find proxies with old versions' do
    ForemanOpenscap::OpenscapProxyVersionCheck.any_instance.stubs(:openscap_proxy_versions)
                                              .returns('old-proxy.test.com' => "0.5.4", "outdate-proxy.test.com" => "0.6.0")
    check = ForemanOpenscap::OpenscapProxyVersionCheck.new.run
    refute check.pass?
    refute check.message.empty?
  end

  test 'should not find any outdated proxies' do
    ForemanOpenscap::OpenscapProxyVersionCheck.any_instance.stubs(:openscap_proxy_versions)
                                              .returns({})
    check = ForemanOpenscap::OpenscapProxyVersionCheck.new.run
    assert check.pass?
    assert check.message.empty?
  end

  test 'should fail when proxy cannot be reached' do
    ProxyStatus::Version.any_instance.stubs(:version).raises(Foreman::WrappedException.new(nil, 'test message'))
    ForemanOpenscap::OpenscapProxyVersionCheck.any_instance.stubs(:get_openscap_proxies).returns([FactoryBot.create(:openscap_proxy)])
    check = ForemanOpenscap::OpenscapProxyVersionCheck.new.run
    refute check.pass?
    refute check.message.empty?
  end
end

Version data entries

69 entries across 69 versions & 1 rubygems

Version Path
foreman_openscap-1.0.6 test/unit/services/tailoring_files_proxy_check_test.rb
foreman_openscap-1.0.5 test/unit/services/tailoring_files_proxy_check_test.rb
foreman_openscap-1.0.4 test/unit/services/tailoring_files_proxy_check_test.rb
foreman_openscap-1.0.3 test/unit/services/tailoring_files_proxy_check_test.rb
foreman_openscap-1.0.2 test/unit/services/tailoring_files_proxy_check_test.rb
foreman_openscap-1.0.1 test/unit/services/tailoring_files_proxy_check_test.rb
foreman_openscap-1.0.0 test/unit/services/tailoring_files_proxy_check_test.rb
foreman_openscap-0.12.3 test/unit/services/tailoring_files_proxy_check_test.rb
foreman_openscap-0.11.5 test/unit/services/tailoring_files_proxy_check_test.rb
foreman_openscap-0.12.2 test/unit/services/tailoring_files_proxy_check_test.rb
foreman_openscap-0.12.1 test/unit/services/tailoring_files_proxy_check_test.rb
foreman_openscap-0.12.0 test/unit/services/tailoring_files_proxy_check_test.rb
foreman_openscap-0.11.4 test/unit/services/tailoring_files_proxy_check_test.rb
foreman_openscap-0.11.3 test/unit/services/tailoring_files_proxy_check_test.rb
foreman_openscap-0.11.2 test/unit/services/tailoring_files_proxy_check_test.rb
foreman_openscap-0.11.1 test/unit/services/tailoring_files_proxy_check_test.rb
foreman_openscap-0.11.0 test/unit/services/tailoring_files_proxy_check_test.rb
foreman_openscap-0.10.4 test/unit/services/tailoring_files_proxy_check_test.rb
foreman_openscap-0.10.3 test/unit/services/tailoring_files_proxy_check_test.rb
foreman_openscap-0.10.2 test/unit/services/tailoring_files_proxy_check_test.rb