Commit 265b9adc authored by Zhengchao Shao's avatar Zhengchao Shao Committed by Jakub Kicinski
Browse files

selftests/tc-testing: add selftests for hfsc qdisc



Test 3254: Create HFSC with default setting
Test 0289: Create HFSC with class sc and ul rate setting
Test 846a: Create HFSC with class sc umax and dmax setting
Test 5413: Create HFSC with class rt and ls rate setting
Test 9312: Create HFSC with class rt umax and dmax setting
Test 6931: Delete HFSC with handle
Test 8436: Show HFSC class

Signed-off-by: default avatarZhengchao Shao <shaozhengchao@huawei.com>
Reviewed-by: default avatarVictor Nogueira <victor@mojatatu.com>
Tested-by: default avatarVictor Nogueira <victor@mojatatu.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 965a25e3
Loading
Loading
Loading
Loading
+167 −0
Original line number Diff line number Diff line
[
    {
        "id": "3254",
        "name": "Create HFSC with default setting",
        "category": [
            "qdisc",
            "hfsc"
        ],
        "plugins": {
            "requires": "nsPlugin"
        },
        "setup": [
            "$IP link add dev $DUMMY type dummy || /bin/true"
        ],
        "cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root hfsc",
        "expExitCode": "0",
        "verifyCmd": "$TC qdisc show dev $DUMMY",
        "matchPattern": "qdisc hfsc 1: root refcnt [0-9]+",
        "matchCount": "1",
        "teardown": [
            "$TC qdisc del dev $DUMMY handle 1: root",
            "$IP link del dev $DUMMY type dummy"
        ]
    },
    {
        "id": "0289",
        "name": "Create HFSC with class sc and ul rate setting",
        "category": [
            "qdisc",
            "hfsc"
        ],
        "plugins": {
            "requires": "nsPlugin"
        },
        "setup": [
            "$IP link add dev $DUMMY type dummy || /bin/true",
            "$TC qdisc add dev $DUMMY handle 1: root hfsc default 11"
        ],
        "cmdUnderTest": "$TC class add dev $DUMMY parent 1: classid 1:1 hfsc sc rate 20000 ul rate 10000",
        "expExitCode": "0",
        "verifyCmd": "$TC class show dev $DUMMY",
        "matchPattern": "class hfsc 1:1 parent 1: sc m1 0bit d 0us m2 20Kbit ul m1 0bit d 0us m2 10Kbit",
        "matchCount": "1",
        "teardown": [
            "$TC qdisc del dev $DUMMY handle 1: root",
            "$IP link del dev $DUMMY type dummy"
        ]
    },
    {
        "id": "846a",
        "name": "Create HFSC with class sc umax and dmax setting",
        "category": [
            "qdisc",
            "hfsc"
        ],
        "plugins": {
            "requires": "nsPlugin"
        },
        "setup": [
            "$IP link add dev $DUMMY type dummy || /bin/true",
            "$TC qdisc add dev $DUMMY handle 1: root hfsc default 11"
        ],
        "cmdUnderTest": "$TC class add dev $DUMMY parent 1: classid 1:1 hfsc sc umax 1540 dmax 5ms rate 10000 ul rate 10000",
        "expExitCode": "0",
        "verifyCmd": "$TC class show dev $DUMMY",
        "matchPattern": "class hfsc 1:1 parent 1: sc m1 2464Kbit d 5ms m2 10Kbit ul m1 0bit d 0us m2 10Kbit",
        "matchCount": "1",
        "teardown": [
            "$TC qdisc del dev $DUMMY handle 1: root",
            "$IP link del dev $DUMMY type dummy"
        ]
    },
    {
        "id": "5413",
        "name": "Create HFSC with class rt and ls rate setting",
        "category": [
            "qdisc",
            "hfsc"
        ],
        "plugins": {
            "requires": "nsPlugin"
        },
        "setup": [
            "$IP link add dev $DUMMY type dummy || /bin/true",
            "$TC qdisc add dev $DUMMY handle 1: root hfsc default 11"
        ],
        "cmdUnderTest": "$TC class add dev $DUMMY parent 1: classid 1:1 hfsc rt rate 20000 ls rate 10000",
        "expExitCode": "0",
        "verifyCmd": "$TC class show dev $DUMMY",
        "matchPattern": "class hfsc 1:1 parent 1: rt m1 0bit d 0us m2 20Kbit ls m1 0bit d 0us m2 10Kbit",
        "matchCount": "1",
        "teardown": [
            "$TC qdisc del dev $DUMMY handle 1: root",
            "$IP link del dev $DUMMY type dummy"
        ]
    },
    {
        "id": "9312",
        "name": "Create HFSC with class rt umax and dmax setting",
        "category": [
            "qdisc",
            "hfsc"
        ],
        "plugins": {
            "requires": "nsPlugin"
        },
        "setup": [
            "$IP link add dev $DUMMY type dummy || /bin/true",
            "$TC qdisc add dev $DUMMY handle 1: root hfsc default 11"
        ],
        "cmdUnderTest": "$TC class add dev $DUMMY parent 1: classid 1:1 hfsc rt umax 1540 dmax 5ms rate 10000 ls rate 10000",
        "expExitCode": "0",
        "verifyCmd": "$TC class show dev $DUMMY",
        "matchPattern": "class hfsc 1:1 parent 1: rt m1 2464Kbit d 5ms m2 10Kbit ls m1 0bit d 0us m2 10Kbit",
        "matchCount": "1",
        "teardown": [
            "$TC qdisc del dev $DUMMY handle 1: root",
            "$IP link del dev $DUMMY type dummy"
        ]
    },
    {
        "id": "6931",
        "name": "Delete HFSC with handle",
        "category": [
            "qdisc",
            "hfsc"
        ],
        "plugins": {
            "requires": "nsPlugin"
        },
        "setup": [
            "$IP link add dev $DUMMY type dummy || /bin/true",
            "$TC qdisc add dev $DUMMY handle 1: root hfsc default 11"
        ],
        "cmdUnderTest": "$TC qdisc del dev $DUMMY handle 1: root",
        "expExitCode": "0",
        "verifyCmd": "$TC qdisc show dev $DUMMY",
        "matchPattern": "qdisc hfsc 1: root refcnt [0-9]+",
        "matchCount": "0",
        "teardown": [
            "$IP link del dev $DUMMY type dummy"
        ]
    },
    {
        "id": "8436",
        "name": "Show HFSC class",
        "category": [
            "qdisc",
            "hfsc"
        ],
        "plugins": {
            "requires": "nsPlugin"
        },
        "setup": [
            "$IP link add dev $DUMMY type dummy || /bin/true"
        ],
        "cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root hfsc",
        "expExitCode": "0",
        "verifyCmd": "$TC class show dev $DUMMY",
        "matchPattern": "class hfsc 1: root",
        "matchCount": "1",
        "teardown": [
            "$TC qdisc del dev $DUMMY handle 1: root",
            "$IP link del dev $DUMMY type dummy"
        ]
    }
]