Esempio n. 1
0
def test_env_lag_5(request, env_list):
    """Verify env_lag fixture adds LAGs into LagsAdmin table.

    """
    fixtures.env_lag(request, env_list)
    for _switch in env_list.switch.values():
        _switch.clearconfig()
    lags = set(x['lagId'] for x in env_list.switch[1].ui.get_table_lags())
    assert lags == {3800, 3801, 3802, 3803, 3804}
Esempio n. 2
0
def test_env_lag_1(request, env):
    """Verify env_lag fixture adds LAGs into ports list.

    """
    fixtures.env_lag(request, env)
    for _switch in env.switch.values():
        _switch.clearconfig()
    assert env.switch[1].ports == [5, 4, 3, 2, 1, 3800, 3801, 3802, 3803, 3804]
    assert env.switch[1].port_list == []
Esempio n. 3
0
def test_env_lag_7(request, env):
    """Verify env_lag fixture changes links in setup file.

    """
    fixtures.env_lag(request, env)
    for _switch in env.switch.values():
        _switch.clearconfig()
    assert env.setup["cross"]['5'] == [['03', 1, '1', 6], ['03', 2, '1', 7],
                                       ['03', 3, '1', 8], ['03', 4, '1', 9],
                                       ['03', 5, '1', 10]]
Esempio n. 4
0
def test_env_lag_9(request, env):
    """Verify env_lag fixture doesn't add LAGs into ports list in case max_lags is less than links count.

    """
    env.switch[1].hw.max_lags = 4
    fixtures.env_lag(request, env)
    with pytest.raises(pytest.skip.Exception):
        for _switch in env.switch.values():
            _switch.clearconfig()
    assert env.switch[1].ports == [5, 4, 3, 2, 1]
    assert env.switch[1].port_list == []
Esempio n. 5
0
def test_env_lag_6(request, env_list):
    """Verify env_lag fixture adds ports to LAGs.

    """
    fixtures.env_lag(request, env_list)
    for _switch in env_list.switch.values():
        _switch.clearconfig()
    ports_lags = {
        x['portId']: x['lagId']
        for x in env_list.switch[1].ui.get_table_ports2lag()
    }
    assert ports_lags == {5: 3800, 4: 3801, 3: 3802, 2: 3803, 1: 3804}
Esempio n. 6
0
def test_env_lag_13(request, env_complex):
    """Verify env_lag fixture adds LAGs into ports list in complex setup.

    """
    fixtures.env_lag(request, env_complex)
    for _switch in env_complex.switch.values():
        _switch.clearconfig()
    assert env_complex.switch[1].ports == [
        1, 2, 3, 6, 7, 3800, 3801, 3802, 3803, 3804
    ]
    assert env_complex.switch[1].port_list == []
    assert env_complex.switch[2].ports == [3, 4, 8, 9, 3800, 3801, 3803, 3804]
    assert env_complex.switch[2].port_list == []
Esempio n. 7
0
def test_env_lag_11(request, env):
    """Verify env_lag fixture doesn't add LAGs into ports list in case port is already in LAG.

    """
    env.switch[1].ui.create_lag(3900, 100, "Static", "None")
    env.switch[1].ui.create_lag_ports([
        1,
    ], 3900, 100)
    fixtures.env_lag(request, env)
    with pytest.raises(pytest.skip.Exception):
        for _switch in env.switch.values():
            _switch.clearconfig()
    assert env.switch[1].ports == [5, 4, 3, 2, 1]
    assert env.switch[1].port_list == []
Esempio n. 8
0
def test_env_lag_4(request, env_list):
    """Verify env_lag fixture adds LAGs into port_list.

    """
    fixtures.env_lag(request, env_list)
    for _switch in env_list.switch.values():
        _switch.clearconfig()
    assert env_list.switch[1].ports == [
        5, 4, 3, 2, 1, 3800, 3801, 3802, 3803, 3804
    ]
    assert env_list.switch[1].port_list == [[5, 10000], [4, 10000], [3, 10000],
                                            [2, 10000], [1, 40000],
                                            [3800, 10000], [3801, 10000],
                                            [3802, 10000], [3803, 10000],
                                            [3804, 40000]]
Esempio n. 9
0
def test_env_lag_15(request, env_complex):
    """Verify env_lag fixture adds ports to LAGs in complex setup.

    """
    fixtures.env_lag(request, env_complex)
    for _switch in env_complex.switch.values():
        _switch.clearconfig()
    ports_lags = {
        x['portId']: x['lagId']
        for x in env_complex.switch[1].ui.get_table_ports2lag()
    }
    assert ports_lags == {1: 3800, 2: 3801, 3: 3802, 6: 3803, 7: 3804}
    ports_lags = {
        x['portId']: x['lagId']
        for x in env_complex.switch[2].ui.get_table_ports2lag()
    }
    assert ports_lags == {3: 3800, 4: 3801, 8: 3803, 9: 3804}