summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/tc-testing/tc-tests/filters/tests.json
blob: 8135778040c23aacc24e515b57f1ff14a096db27 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
[
    {
        "id": "e9a3",
        "name": "Add u32 with source match",
        "category": [
            "filter",
            "u32"
        ],
        "plugins": {
                "requires": "nsPlugin"
        },
        "setup": [
            "$TC qdisc add dev $DEV1 ingress"
        ],
        "cmdUnderTest": "$TC filter add dev $DEV1 parent ffff: protocol ip prio 1 u32 match ip src 127.0.0.1/32 flowid 1:1 action ok",
        "expExitCode": "0",
        "verifyCmd": "$TC filter show dev $DEV1 parent ffff:",
        "matchPattern": "match 7f000001/ffffffff at 12",
        "matchCount": "1",
        "teardown": [
            "$TC qdisc del dev $DEV1 ingress"
        ]
    },
    {
        "id": "2638",
        "name": "Add matchall and try to get it",
        "category": [
            "filter",
            "matchall"
        ],
        "plugins": {
                "requires": "nsPlugin"
        },
        "setup": [
            "$TC qdisc add dev $DEV1 clsact",
            "$TC filter add dev $DEV1 protocol all pref 1 ingress handle 0x1234 matchall action ok"
        ],
        "cmdUnderTest": "$TC filter get dev $DEV1 protocol all pref 1 ingress handle 0x1234 matchall",
        "expExitCode": "0",
        "verifyCmd": "$TC filter show dev $DEV1 ingress",
        "matchPattern": "filter protocol all pref 1 matchall chain 0 handle 0x1234",
        "matchCount": "1",
        "teardown": [
            "$TC qdisc del dev $DEV1 clsact"
        ]
    },
    {
        "id": "d052",
        "name": "Add 1M filters with the same action",
        "category": [
            "filter",
            "flower"
        ],
        "plugins": {
                "requires": "nsPlugin"
        },
        "setup": [
            "$TC qdisc add dev $DEV2 ingress",
            "./tdc_batch.py $DEV2 $BATCH_FILE --share_action -n 1000000"
        ],
        "cmdUnderTest": "$TC -b $BATCH_FILE",
        "expExitCode": "0",
        "verifyCmd": "$TC actions list action gact",
        "matchPattern": "action order 0: gact action drop.*index 1 ref 1000000 bind 1000000",
        "matchCount": "1",
        "teardown": [
            "$TC qdisc del dev $DEV2 ingress",
            "/bin/rm $BATCH_FILE"
        ]
    },
    {
        "id": "4cbd",
        "name": "Try to add filter with duplicate key",
        "category": [
            "filter",
            "flower"
        ],
        "plugins": {
                "requires": "nsPlugin"
        },
        "setup": [
            "$TC qdisc add dev $DEV2 ingress",
            "$TC filter add dev $DEV2 protocol ip prio 1 parent ffff: flower dst_mac e4:11:22:11:4a:51 src_mac e4:11:22:11:4a:50 ip_proto tcp src_ip 1.1.1.1 dst_ip 2.2.2.2 action drop"
        ],
        "cmdUnderTest": "$TC filter add dev $DEV2 protocol ip prio 1 parent ffff: flower dst_mac e4:11:22:11:4a:51 src_mac e4:11:22:11:4a:50 ip_proto tcp src_ip 1.1.1.1 dst_ip 2.2.2.2 action drop",
        "expExitCode": "2",
        "verifyCmd": "$TC -s filter show dev $DEV2 ingress",
        "matchPattern": "filter protocol ip pref 1 flower chain 0 handle",
        "matchCount": "1",
        "teardown": [
            "$TC qdisc del dev $DEV2 ingress"
        ]
    }
]