def test_sat_legacy_url(set_auto_configuration, initConfig):
    '''
    Ensure the correct host URL is selected for auto_config on a legacy Sat upload
    '''
    initConfig().get.side_effect = [
        'test.satellite.com', '443', '', '', '', '', 'test_cert'
    ]
    config = Mock(base_url=None, upload_url=None, legacy_upload=True)
    _try_satellite6_configuration(config)
    set_auto_configuration.assert_called_with(
        config, 'test.satellite.com:443/redhat_access', 'test_cert', None,
        True, False)
def test_rhsm_legacy_url(set_auto_configuration, initConfig):
    '''
    Ensure the correct host URL is selected for auto_config on a legacy RHSM upload
    '''
    initConfig().get.side_effect = [
        'subscription.rhsm.redhat.com', '443', '', '', '', '', ''
    ]
    config = Mock(base_url=None, upload_url=None, legacy_upload=True)
    _try_satellite6_configuration(config)
    set_auto_configuration.assert_called_with(config,
                                              'cert-api.access.redhat.com',
                                              None, None, False, False)
Beispiel #3
0
def test_rhsm_stage_platform_url(set_auto_configuration, initConfig):
    '''
    Ensure the correct host URL is selected for auto_config on a platform staging RHSM upload
    '''
    initConfig().get.side_effect = [
        'subscription.rhsm.stage.redhat.com', '443', '', '', '', '', ''
    ]
    config = Mock(base_url=None,
                  upload_url=None,
                  legacy_upload=False,
                  insecure_connection=False)
    _try_satellite6_configuration(config)
    set_auto_configuration.assert_called_with(config,
                                              'cert.cloud.stage.redhat.com',
                                              None, None, False, True)
def test_rhsm_stage_legacy_url(set_auto_configuration, initConfig):
    '''
    Ensure the correct host URL is selected for auto_config on a legacy staging RHSM upload

    This will still force legacy_upload=False as there is no classic staging env,
    so the result is the same as platform upload.

    '''
    initConfig().get.side_effect = [
        'subscription.rhsm.stage.redhat.com', '443', '', '', '', '', ''
    ]
    config = Mock(base_url=None, upload_url=None, legacy_upload=True)
    _try_satellite6_configuration(config)
    # config.legacy_upload is modified in the function
    config.legacy_upload = False
    set_auto_configuration.assert_called_with(config,
                                              'cert.cloud.stage.redhat.com',
                                              None, None, False, True)