Exemplo n.º 1
0
def test_qos_class_htb_rate_ceil(fixture_disable_commands):
    launch_cmd_spy = fixture_disable_commands

    tc.qos_class(interface=NETIF,
                 action="add",
                 parent="1:0",
                 classid="1:10",
                 rate=400,
                 burst=100,
                 ceil=800,
                 cburst=300)
    expected_cmd = [
        "tc",
        "class",
        "add",
        "dev",
        NETIF,
        "parent",
        "1:0",
        "classid",
        "1:10",
        "htb",
        "burst",
        "100k",
        "cburst",
        "300k",
        "ceil",
        "800kbit",
        "rate",
        "400kbit",
    ]
    launch_cmd_spy.assert_called_with(expected_cmd, dryrun=False)
Exemplo n.º 2
0
def test_qos_class(fixture_disable_commands):
    launch_cmd_spy = fixture_disable_commands

    tc.qos_class(interface=NETIF, action="add", parent="1:0")
    expected_cmd = [
        "tc", "class", "add", "dev", NETIF, "parent", "1:0", "htb",
    ]
    launch_cmd_spy.assert_called_with(expected_cmd, dryrun=False)
Exemplo n.º 3
0
def test_qos_class_del(fixture_qos_class_wrapper):
    """
    Ensure that qos_class and qos_class_del call the same command at the end
    """
    launch_cmd_spy, kwargs = fixture_qos_class_wrapper
    tc.qos_class(action="delete", **kwargs)
    tc.qos_class_del(**kwargs)

    calls = launch_cmd_spy.call_args_list
    assert calls[0] == calls[1]
Exemplo n.º 4
0
def test_qos_class_del(fixture_qos_class_wrapper):
    """
    Ensure that qos_class and qos_class_del call the same command at the end
    """
    launch_cmd_spy, kwargs = fixture_qos_class_wrapper
    tc.qos_class(action="delete", **kwargs)
    tc.qos_class_del(**kwargs)

    calls = launch_cmd_spy.call_args_list
    assert calls[0] == calls[1]
Exemplo n.º 5
0
def test_qos_class_htb_rate_ceil(fixture_disable_commands):
    launch_cmd_spy = fixture_disable_commands

    tc.qos_class(
        interface=NETIF, action="add", parent="1:0", classid="1:10",
        rate=400, burst=100, ceil=800, cburst=300
    )
    expected_cmd = [
            "tc", "class", "add", "dev", NETIF, "parent", "1:0", "classid",
            "1:10", "htb",
            "burst", "100k", "cburst", "300k",
            "ceil", "800kbit", "rate", "400kbit",
    ]
    launch_cmd_spy.assert_called_with(expected_cmd, dryrun=False)
Exemplo n.º 6
0
def test_qos_class(fixture_disable_commands):
    launch_cmd_spy = fixture_disable_commands

    tc.qos_class(interface=NETIF, action="add", parent="1:0")
    expected_cmd = [
        "tc",
        "class",
        "add",
        "dev",
        NETIF,
        "parent",
        "1:0",
        "htb",
    ]
    launch_cmd_spy.assert_called_with(expected_cmd, dryrun=False)