1[
2    {
3        "id": "cb28",
4        "name": "Create NETEM with default setting",
5        "category": [
6            "qdisc",
7            "netem"
8        ],
9        "plugins": {
10            "requires": "nsPlugin"
11        },
12        "setup": [
13            "$IP link add dev $DUMMY type dummy || /bin/true"
14        ],
15        "cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root netem",
16        "expExitCode": "0",
17        "verifyCmd": "$TC qdisc show dev $DUMMY",
18        "matchPattern": "qdisc netem 1: root refcnt [0-9]+ limit",
19        "matchCount": "1",
20        "teardown": [
21            "$TC qdisc del dev $DUMMY handle 1: root",
22            "$IP link del dev $DUMMY type dummy"
23        ]
24    },
25    {
26        "id": "a089",
27        "name": "Create NETEM with limit flag",
28        "category": [
29            "qdisc",
30            "netem"
31        ],
32        "plugins": {
33            "requires": "nsPlugin"
34        },
35        "setup": [
36            "$IP link add dev $DUMMY type dummy || /bin/true"
37        ],
38        "cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root netem limit 200",
39        "expExitCode": "0",
40        "verifyCmd": "$TC qdisc show dev $DUMMY",
41        "matchPattern": "qdisc netem 1: root refcnt [0-9]+ limit 200",
42        "matchCount": "1",
43        "teardown": [
44            "$TC qdisc del dev $DUMMY handle 1: root",
45            "$IP link del dev $DUMMY type dummy"
46        ]
47    },
48    {
49        "id": "3449",
50        "name": "Create NETEM with delay time",
51        "category": [
52            "qdisc",
53            "netem"
54        ],
55        "plugins": {
56            "requires": "nsPlugin"
57        },
58        "setup": [
59            "$IP link add dev $DUMMY type dummy || /bin/true"
60        ],
61        "cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root netem delay 100ms",
62        "expExitCode": "0",
63        "verifyCmd": "$TC qdisc show dev $DUMMY",
64        "matchPattern": "qdisc netem 1: root refcnt [0-9]+ .*delay 100ms",
65        "matchCount": "1",
66        "teardown": [
67            "$TC qdisc del dev $DUMMY handle 1: root",
68            "$IP link del dev $DUMMY type dummy"
69        ]
70    },
71    {
72        "id": "3782",
73        "name": "Create NETEM with distribution and corrupt flag",
74        "category": [
75            "qdisc",
76            "netem"
77        ],
78        "plugins": {
79            "requires": "nsPlugin"
80        },
81        "setup": [
82            "$IP link add dev $DUMMY type dummy || /bin/true"
83        ],
84        "cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root netem delay 100ms 10ms distribution normal corrupt 1%",
85        "expExitCode": "0",
86        "verifyCmd": "$TC qdisc show dev $DUMMY",
87        "matchPattern": "qdisc netem 1: root refcnt [0-9]+ .*delay 100ms  10ms corrupt 1%",
88        "matchCount": "1",
89        "teardown": [
90            "$TC qdisc del dev $DUMMY handle 1: root",
91            "$IP link del dev $DUMMY type dummy"
92        ]
93    },
94    {
95        "id": "2b82",
96        "name": "Create NETEM with distribution and duplicate flag",
97        "category": [
98            "qdisc",
99            "netem"
100        ],
101        "plugins": {
102            "requires": "nsPlugin"
103        },
104        "setup": [
105            "$IP link add dev $DUMMY type dummy || /bin/true"
106        ],
107        "cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root netem delay 100ms 10ms distribution normal duplicate 1%",
108        "expExitCode": "0",
109        "verifyCmd": "$TC qdisc show dev $DUMMY",
110        "matchPattern": "qdisc netem 1: root refcnt [0-9]+ .*delay 100ms  10ms duplicate 1%",
111        "matchCount": "1",
112        "teardown": [
113            "$TC qdisc del dev $DUMMY handle 1: root",
114            "$IP link del dev $DUMMY type dummy"
115        ]
116    },
117    {
118        "id": "a932",
119        "name": "Create NETEM with distribution and loss flag",
120        "category": [
121            "qdisc",
122            "netem"
123        ],
124        "plugins": {
125            "requires": "nsPlugin"
126        },
127        "setup": [
128            "$IP link add dev $DUMMY type dummy || /bin/true"
129        ],
130        "cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root netem delay 100ms 10ms distribution pareto loss 1%",
131        "expExitCode": "0",
132        "verifyCmd": "$TC qdisc show dev $DUMMY",
133        "matchPattern": "qdisc netem 1: root refcnt [0-9]+ .*delay 100ms  10ms loss 1%",
134        "matchCount": "1",
135        "teardown": [
136            "$TC qdisc del dev $DUMMY handle 1: root",
137            "$IP link del dev $DUMMY type dummy"
138        ]
139    },
140    {
141        "id": "e01a",
142        "name": "Create NETEM with distribution and loss state flag",
143        "category": [
144            "qdisc",
145            "netem"
146        ],
147        "plugins": {
148            "requires": "nsPlugin"
149        },
150        "setup": [
151            "$IP link add dev $DUMMY type dummy || /bin/true"
152        ],
153        "cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root netem delay 100ms 10ms distribution paretonormal loss state 1",
154        "expExitCode": "0",
155        "verifyCmd": "$TC qdisc show dev $DUMMY",
156        "matchPattern": "qdisc netem 1: root refcnt [0-9]+ .*delay 100ms  10ms loss state p13 1% p31 99% p32 0% p23 100% p14 0%",
157        "matchCount": "1",
158        "teardown": [
159            "$TC qdisc del dev $DUMMY handle 1: root",
160            "$IP link del dev $DUMMY type dummy"
161        ]
162    },
163    {
164        "id": "ba29",
165        "name": "Create NETEM with loss gemodel flag",
166        "category": [
167            "qdisc",
168            "netem"
169        ],
170        "plugins": {
171            "requires": "nsPlugin"
172        },
173        "setup": [
174            "$IP link add dev $DUMMY type dummy || /bin/true"
175        ],
176        "cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root netem loss gemodel 1%",
177        "expExitCode": "0",
178        "verifyCmd": "$TC qdisc show dev $DUMMY",
179        "matchPattern": "qdisc netem 1: root refcnt [0-9]+ .*loss gemodel p 1%",
180        "matchCount": "1",
181        "teardown": [
182            "$TC qdisc del dev $DUMMY handle 1: root",
183            "$IP link del dev $DUMMY type dummy"
184        ]
185    },
186    {
187        "id": "0492",
188        "name": "Create NETEM with reorder flag",
189        "category": [
190            "qdisc",
191            "netem"
192        ],
193        "plugins": {
194            "requires": "nsPlugin"
195        },
196        "setup": [
197            "$IP link add dev $DUMMY type dummy || /bin/true"
198        ],
199        "cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root netem delay 100ms 10ms reorder 2% gap 100",
200        "expExitCode": "0",
201        "verifyCmd": "$TC qdisc show dev $DUMMY",
202        "matchPattern": "qdisc netem 1: root refcnt [0-9]+ .*reorder 2%",
203        "matchCount": "1",
204        "teardown": [
205            "$TC qdisc del dev $DUMMY handle 1: root",
206            "$IP link del dev $DUMMY type dummy"
207        ]
208    },
209    {
210        "id": "7862",
211        "name": "Create NETEM with rate limit",
212        "category": [
213            "qdisc",
214            "netem"
215        ],
216        "plugins": {
217            "requires": "nsPlugin"
218        },
219        "setup": [
220            "$IP link add dev $DUMMY type dummy || /bin/true"
221        ],
222        "cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root netem rate 20000",
223        "expExitCode": "0",
224        "verifyCmd": "$TC qdisc show dev $DUMMY",
225        "matchPattern": "qdisc netem 1: root refcnt [0-9]+ .*rate 20Kbit",
226        "matchCount": "1",
227        "teardown": [
228            "$TC qdisc del dev $DUMMY handle 1: root",
229            "$IP link del dev $DUMMY type dummy"
230        ]
231    },
232    {
233        "id": "7235",
234        "name": "Create NETEM with multiple slot rate",
235        "category": [
236            "qdisc",
237            "netem"
238        ],
239        "plugins": {
240            "requires": "nsPlugin"
241        },
242        "setup": [
243            "$IP link add dev $DUMMY type dummy || /bin/true"
244        ],
245        "cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root netem slot 10 200 packets 2000 bytes 9000",
246        "expExitCode": "0",
247        "verifyCmd": "$TC qdisc show dev $DUMMY",
248        "matchPattern": "qdisc netem 1: root refcnt [0-9]+ .*slot 10ns 200ns packets 2000 bytes 9000",
249        "matchCount": "1",
250        "teardown": [
251            "$TC qdisc del dev $DUMMY handle 1: root",
252            "$IP link del dev $DUMMY type dummy"
253        ]
254    },
255    {
256        "id": "5439",
257        "name": "Create NETEM with multiple slot setting",
258        "category": [
259            "qdisc",
260            "netem"
261        ],
262        "plugins": {
263            "requires": "nsPlugin"
264        },
265        "setup": [
266            "$IP link add dev $DUMMY type dummy || /bin/true"
267        ],
268        "cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root netem slot distribution pareto 1ms 0.1ms",
269        "expExitCode": "0",
270        "verifyCmd": "$TC qdisc show dev $DUMMY",
271        "matchPattern": "qdisc netem 1: root refcnt [0-9]+ .*slot distribution 1ms 100us",
272        "matchCount": "1",
273        "teardown": [
274            "$TC qdisc del dev $DUMMY handle 1: root",
275            "$IP link del dev $DUMMY type dummy"
276        ]
277    },
278    {
279        "id": "5029",
280        "name": "Change NETEM with loss state",
281        "category": [
282            "qdisc",
283            "netem"
284        ],
285        "plugins": {
286            "requires": "nsPlugin"
287        },
288        "setup": [
289            "$IP link add dev $DUMMY type dummy || /bin/true",
290            "$TC qdisc add dev $DUMMY handle 1: root netem delay 100ms 10ms distribution normal loss 1%"
291        ],
292        "cmdUnderTest": "$TC qdisc change dev $DUMMY handle 1: root netem delay 100ms 10ms distribution normal loss 2%",
293        "expExitCode": "0",
294        "verifyCmd": "$TC qdisc show dev $DUMMY",
295        "matchPattern": "qdisc netem 1: root refcnt [0-9]+ .*loss 2%",
296        "matchCount": "1",
297        "teardown": [
298            "$TC qdisc del dev $DUMMY handle 1: root",
299            "$IP link del dev $DUMMY type dummy"
300        ]
301    },
302    {
303        "id": "3785",
304        "name": "Replace NETEM with delay time",
305        "category": [
306            "qdisc",
307            "netem"
308        ],
309        "plugins": {
310            "requires": "nsPlugin"
311        },
312        "setup": [
313            "$IP link add dev $DUMMY type dummy || /bin/true",
314            "$TC qdisc add dev $DUMMY handle 1: root netem delay 100ms 10ms distribution normal loss 1%"
315        ],
316        "cmdUnderTest": "$TC qdisc replace dev $DUMMY handle 1: root netem delay 200ms 10ms",
317        "expExitCode": "0",
318        "verifyCmd": "$TC qdisc show dev $DUMMY",
319        "matchPattern": "qdisc netem 1: root refcnt [0-9]+ .*delay 200ms  10ms",
320        "matchCount": "1",
321        "teardown": [
322            "$TC qdisc del dev $DUMMY handle 1: root",
323            "$IP link del dev $DUMMY type dummy"
324        ]
325    },
326    {
327        "id": "4502",
328        "name": "Delete NETEM with handle",
329        "category": [
330            "qdisc",
331            "netem"
332        ],
333        "plugins": {
334            "requires": "nsPlugin"
335        },
336        "setup": [
337            "$IP link add dev $DUMMY type dummy || /bin/true",
338            "$TC qdisc add dev $DUMMY handle 1: root netem delay 100ms 10ms distribution normal"
339        ],
340        "cmdUnderTest": "$TC qdisc del dev $DUMMY handle 1: root",
341        "expExitCode": "0",
342        "verifyCmd": "$TC qdisc show dev $DUMMY",
343        "matchPattern": "qdisc netem 1: root refcnt [0-9]+ .*delay 100ms  10ms",
344        "matchCount": "0",
345        "teardown": [
346            "$IP link del dev $DUMMY type dummy"
347        ]
348    },
349    {
350        "id": "0785",
351        "name": "Show NETEM class",
352        "category": [
353            "qdisc",
354            "netem"
355        ],
356        "plugins": {
357            "requires": "nsPlugin"
358        },
359        "setup": [
360            "$IP link add dev $DUMMY type dummy || /bin/true"
361        ],
362        "cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root netem",
363        "expExitCode": "0",
364        "verifyCmd": "$TC class show dev $DUMMY",
365        "matchPattern": "class netem 1:",
366        "matchCount": "0",
367        "teardown": [
368            "$TC qdisc del dev $DUMMY handle 1: root",
369            "$IP link del dev $DUMMY type dummy"
370        ]
371    }
372]
373