Пример #1
0
def test_routes_3():
    """Verify that routes function return exception when length of nexthop and netwrk lists is not equal.

    """
    lh = GenericLinuxHost(LH_CFG, OPTS)
    with pytest.raises(Exception) as excepinfo:
        lh.routes("up", ['10.10.10.10'], None, ["xe1"], ["20.20.20.20", "30.30.36.2"], None)
    result = "The lengths of the lists nexthop and netwrk is not equal."
    assert result == str(excepinfo.value)
Пример #2
0
def test_routes_4():
    """Verify that routes function return exception when length of nexthop and ports lists is not equal.

    """
    lh = GenericLinuxHost(LH_CFG, OPTS)
    with pytest.raises(Exception) as excepinfo:
        lh.routes("up", ['default'], None, ["xe1", "xe2"], ["1.1.1.1"], None)
    result = "The lengths of the lists nexthop and ports is not equal."
    assert result == str(excepinfo.value)
Пример #3
0
def test_routes_2():
    """Verify that routes command return exception when incorrect mode value is set.

    """
    lh = GenericLinuxHost(LH_CFG, OPTS)
    mode = "upf"
    with pytest.raises(Exception) as excepinfo:
        lh.routes(mode)
    result = "Unknown mode parameter value - %s" % mode
    assert str(excepinfo.value) == result