Пример #1
0
def test_modify_and_delete_router_id(request):
    """Test to modify, delete and verify router-id."""

    tgen = get_topogen()
    if BGP_CONVERGENCE is not True:
        pytest.skip("skipped because of BGP Convergence failure")

    # test case name
    tc_name = request.node.name
    write_test_header(tc_name)

    # Creating configuration from JSON
    reset_config_on_routers(tgen)

    # Modify router id
    input_dict = {
        "r1": {"bgp": {"router_id": "12.12.12.12"}},
        "r2": {"bgp": {"router_id": "22.22.22.22"}},
        "r3": {"bgp": {"router_id": "33.33.33.33"}},
    }
    result = create_router_bgp(tgen, topo, input_dict)
    assert result is True, "Testcase {} :Failed \n Error: {}".format(tc_name, result)

    # Verifying router id once modified
    result = verify_router_id(tgen, topo, input_dict)
    assert result is True, "Testcase {} :Failed \n Error: {}".format(tc_name, result)

    # Delete router id
    input_dict = {
        "r1": {"bgp": {"del_router_id": True}},
        "r2": {"bgp": {"del_router_id": True}},
        "r3": {"bgp": {"del_router_id": True}},
    }
    result = create_router_bgp(tgen, topo, input_dict)
    assert result is True, "Testcase {} :Failed \n Error: {}".format(tc_name, result)

    # Verifying router id once deleted
    # Once router-id is deleted, highest interface ip should become
    # router-id
    result = verify_router_id(tgen, topo, input_dict)
    assert result is True, "Testcase {} :Failed \n Error: {}".format(tc_name, result)

    write_test_footer(tc_name)
Пример #2
0
def test_modify_and_delete_router_id(request):
    """ Test to modify, delete and verify router-id. """

    tgen = get_topogen()
    if BGP_CONVERGENCE is not True:
        pytest.skip('skipped because of BGP Convergence failure')

    # test case name
    tc_name = request.node.name
    write_test_header(tc_name)

    # Modify router id
    input_dict = {
        'r1': {
            "bgp": {
                'router_id': '12.12.12.12'
            }
        },
        'r2': {
            "bgp": {
                'router_id': '22.22.22.22'
            }
        },
        'r3': {
            "bgp": {
                'router_id': '33.33.33.33'
            }
        },
    }
    result = create_router_bgp(tgen, topo, input_dict)
    assert result is True, "Testcase {} :Failed \n Error: {}".\
        format(tc_name, result)

    # Verifying router id once modified
    result = verify_router_id(tgen, topo, input_dict)
    assert result is True, "Testcase {} :Failed \n Error: {}".\
        format(tc_name, result)

    # Delete router id
    input_dict = {
        'r1': {
            "bgp": {
                'del_router_id': True
            }
        },
        'r2': {
            "bgp": {
                'del_router_id': True
            }
        },
        'r3': {
            "bgp": {
                'del_router_id': True
            }
        },
    }
    result = create_router_bgp(tgen, topo, input_dict)
    assert result is True, "Testcase {} :Failed \n Error: {}". \
        format(tc_name, result)

    # Verifying router id once deleted
    # Once router-id is deleted, highest interface ip should become
    # router-id
    result = verify_router_id(tgen, topo, input_dict)
    assert result is True, "Testcase {} :Failed \n Error: {}". \
        format(tc_name, result)

    write_test_footer(tc_name)