コード例 #1
0
def test_update_listener_hostname_names_changed(
        lb_client, create_or_update_lb_resources_and_wait_patch):
    updated_hostname_names = dict({"hostname_names": ["host_name_002"]})
    module = get_module(updated_hostname_names)
    create_or_update_lb_resources_and_wait_patch.return_value = {
        "listener": to_dict(get_listener()),
        "changed": True,
    }
    oci_load_balancer_listener.update_listener(lb_client, module,
                                               get_listener(),
                                               "ocid1.loadbalancer.aaaa",
                                               "ansible_listener")
    assert create_or_update_lb_resources_and_wait_patch.called
コード例 #2
0
def test_update_listener(lb_client,
                         create_or_update_lb_resources_and_wait_patch):
    updated_backend_set_name = dict({"default_backend_set_name": "backend2"})
    module = get_module(updated_backend_set_name)
    create_or_update_lb_resources_and_wait_patch.return_value = {
        "listener": to_dict(get_listener()),
        "changed": True,
    }
    oci_load_balancer_listener.update_listener(lb_client, module,
                                               get_listener(),
                                               "ocid1.loadbalancer.aaaa",
                                               "ansible_listener")
    assert create_or_update_lb_resources_and_wait_patch.called
コード例 #3
0
def test_update_listener_hostname_names_changed(
        lb_client, create_or_update_lb_resources_and_wait_patch):
    updated_hostname_names = dict({'hostname_names': ['host_name_002']})
    module = get_module(updated_hostname_names)
    create_or_update_lb_resources_and_wait_patch.return_value = {
        'listener': to_dict(get_listener()),
        'changed': True
    }
    oci_load_balancer_listener.update_listener(lb_client, module,
                                               get_listener(),
                                               'ocid1.loadbalancer.aaaa',
                                               'ansible_listener')
    assert create_or_update_lb_resources_and_wait_patch.called
コード例 #4
0
def test_update_listener(lb_client,
                         create_or_update_lb_resources_and_wait_patch):
    updated_backend_set_name = dict({'default_backend_set_name': 'backend2'})
    module = get_module(updated_backend_set_name)
    create_or_update_lb_resources_and_wait_patch.return_value = {
        'listener': to_dict(get_listener()),
        'changed': True
    }
    oci_load_balancer_listener.update_listener(lb_client, module,
                                               get_listener(),
                                               'ocid1.loadbalancer.aaaa',
                                               'ansible_listener')
    assert create_or_update_lb_resources_and_wait_patch.called
コード例 #5
0
def test_update_listener_connection_configuration_changed(
        lb_client, create_or_update_lb_resources_and_wait_patch):
    updated_backend_set_name = dict(
        {"connection_configuration": {
            "idle_timeout": 600
        }})
    module = get_module(updated_backend_set_name)
    create_or_update_lb_resources_and_wait_patch.return_value = {
        "listener": to_dict(get_listener()),
        "changed": True,
    }
    oci_load_balancer_listener.update_listener(lb_client, module,
                                               get_listener(),
                                               "ocid1.loadbalancer.aaaa",
                                               "ansible_listener")
    assert create_or_update_lb_resources_and_wait_patch.called
コード例 #6
0
def test_update_listener_connection_configuration_changed(
        lb_client, create_or_update_lb_resources_and_wait_patch):
    updated_backend_set_name = dict(
        {'connection_configuration': {
            'idle_timeout': 600
        }})
    module = get_module(updated_backend_set_name)
    create_or_update_lb_resources_and_wait_patch.return_value = {
        'listener': to_dict(get_listener()),
        'changed': True
    }
    oci_load_balancer_listener.update_listener(lb_client, module,
                                               get_listener(),
                                               'ocid1.loadbalancer.aaaa',
                                               'ansible_listener')
    assert create_or_update_lb_resources_and_wait_patch.called
コード例 #7
0
def test_update_listener_ssl_config_changed(
        lb_client, create_or_update_lb_resources_and_wait_patch):
    updated_backend_set_name = dict({
        "ssl_configuration": {
            "certificate_name": "test_cert1",
            "verify_depth": 2,
            "verify_peer_certificate": True,
        }
    })
    module = get_module(updated_backend_set_name)
    create_or_update_lb_resources_and_wait_patch.return_value = {
        "listener": to_dict(get_listener()),
        "changed": True,
    }
    oci_load_balancer_listener.update_listener(lb_client, module,
                                               get_listener(),
                                               "ocid1.loadbalancer.aaaa",
                                               "ansible_listener")
    assert create_or_update_lb_resources_and_wait_patch.called
コード例 #8
0
def test_update_listener_no_update(lb_client):
    module = get_module()
    result = oci_load_balancer_listener.update_listener(
        lb_client, module, get_listener(), "ocid1.loadbalancer.aaaa",
        "ansible_listener")
    assert result["changed"] is False
コード例 #9
0
def test_update_listener_no_update(lb_client):
    module = get_module()
    result = oci_load_balancer_listener.update_listener(
        lb_client, module, get_listener(), 'ocid1.loadbalancer.aaaa',
        'ansible_listener')
    assert result['changed'] is False