make python scripts PEP8 compliant
[dpdk.git] / app / test / autotest_data.py
1 #!/usr/bin/env python
2
3 #   BSD LICENSE
4 #
5 #   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
6 #   All rights reserved.
7 #
8 #   Redistribution and use in source and binary forms, with or without
9 #   modification, are permitted provided that the following conditions
10 #   are met:
11 #
12 #     * Redistributions of source code must retain the above copyright
13 #       notice, this list of conditions and the following disclaimer.
14 #     * Redistributions in binary form must reproduce the above copyright
15 #       notice, this list of conditions and the following disclaimer in
16 #       the documentation and/or other materials provided with the
17 #       distribution.
18 #     * Neither the name of Intel Corporation nor the names of its
19 #       contributors may be used to endorse or promote products derived
20 #       from this software without specific prior written permission.
21 #
22 #   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 #   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 #   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25 #   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26 #   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27 #   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28 #   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29 #   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30 #   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33
34 # Test data for autotests
35
36 from glob import glob
37 from autotest_test_funcs import *
38
39
40 # quick and dirty function to find out number of sockets
41 def num_sockets():
42     result = len(glob("/sys/devices/system/node/node*"))
43     if result == 0:
44         return 1
45     return result
46
47
48 # Assign given number to each socket
49 # e.g. 32 becomes 32,32 or 32,32,32,32
50 def per_sockets(num):
51     return ",".join([str(num)] * num_sockets())
52
53 # groups of tests that can be run in parallel
54 # the grouping has been found largely empirically
55 parallel_test_group_list = [
56     {
57         "Prefix":    "group_1",
58         "Memory":    per_sockets(8),
59         "Tests":
60         [
61             {
62                 "Name":    "Cycles autotest",
63                 "Command": "cycles_autotest",
64                 "Func":    default_autotest,
65                 "Report":  None,
66             },
67             {
68                 "Name":    "Timer autotest",
69                 "Command": "timer_autotest",
70                 "Func":    timer_autotest,
71                 "Report":   None,
72             },
73             {
74                 "Name":    "Debug autotest",
75                 "Command": "debug_autotest",
76                 "Func":    default_autotest,
77                 "Report":  None,
78             },
79             {
80                 "Name":    "Errno autotest",
81                 "Command": "errno_autotest",
82                 "Func":    default_autotest,
83                 "Report":  None,
84             },
85             {
86                 "Name":    "Meter autotest",
87                 "Command": "meter_autotest",
88                 "Func":    default_autotest,
89                 "Report":  None,
90             },
91             {
92                 "Name":    "Common autotest",
93                 "Command": "common_autotest",
94                 "Func":    default_autotest,
95                 "Report":  None,
96             },
97             {
98                 "Name":    "Resource autotest",
99                 "Command": "resource_autotest",
100                 "Func":    default_autotest,
101                 "Report":  None,
102             },
103         ]
104     },
105     {
106         "Prefix":    "group_2",
107         "Memory":    "16",
108         "Tests":
109         [
110             {
111                 "Name":    "Memory autotest",
112                 "Command": "memory_autotest",
113                 "Func":    memory_autotest,
114                 "Report":  None,
115             },
116             {
117                 "Name":    "Read/write lock autotest",
118                 "Command": "rwlock_autotest",
119                 "Func":    rwlock_autotest,
120                 "Report":  None,
121             },
122             {
123                 "Name":    "Logs autotest",
124                 "Command": "logs_autotest",
125                 "Func":    logs_autotest,
126                 "Report":  None,
127             },
128             {
129                 "Name":    "CPU flags autotest",
130                 "Command": "cpuflags_autotest",
131                 "Func":    default_autotest,
132                 "Report":  None,
133             },
134             {
135                 "Name":    "Version autotest",
136                 "Command": "version_autotest",
137                 "Func":    default_autotest,
138                 "Report":  None,
139             },
140             {
141                 "Name":    "EAL filesystem autotest",
142                 "Command": "eal_fs_autotest",
143                 "Func":    default_autotest,
144                 "Report":  None,
145             },
146             {
147                 "Name":    "EAL flags autotest",
148                 "Command": "eal_flags_autotest",
149                 "Func":    default_autotest,
150                 "Report":  None,
151             },
152             {
153                 "Name":    "Hash autotest",
154                 "Command": "hash_autotest",
155                 "Func":    default_autotest,
156                 "Report":  None,
157             },
158         ],
159     },
160     {
161         "Prefix":    "group_3",
162         "Memory":    per_sockets(512),
163         "Tests":
164         [
165             {
166                 "Name":    "LPM autotest",
167                 "Command": "lpm_autotest",
168                 "Func":    default_autotest,
169                 "Report":  None,
170             },
171             {
172                 "Name":    "LPM6 autotest",
173                 "Command": "lpm6_autotest",
174                 "Func":    default_autotest,
175                 "Report":  None,
176             },
177             {
178                 "Name":    "Memcpy autotest",
179                 "Command": "memcpy_autotest",
180                 "Func":    default_autotest,
181                 "Report":  None,
182             },
183             {
184                 "Name":    "Memzone autotest",
185                 "Command": "memzone_autotest",
186                 "Func":    default_autotest,
187                 "Report":  None,
188             },
189             {
190                 "Name":    "String autotest",
191                 "Command": "string_autotest",
192                 "Func":    default_autotest,
193                 "Report":  None,
194             },
195             {
196                 "Name":    "Alarm autotest",
197                 "Command": "alarm_autotest",
198                 "Func":    default_autotest,
199                 "Report":  None,
200             },
201         ]
202     },
203     {
204         "Prefix":    "group_4",
205         "Memory":    per_sockets(128),
206         "Tests":
207         [
208             {
209                 "Name":    "PCI autotest",
210                 "Command": "pci_autotest",
211                 "Func":    default_autotest,
212                 "Report":  None,
213             },
214             {
215                 "Name":    "Malloc autotest",
216                 "Command": "malloc_autotest",
217                 "Func":    default_autotest,
218                 "Report":  None,
219             },
220             {
221                 "Name":    "Multi-process autotest",
222                 "Command": "multiprocess_autotest",
223                 "Func":    default_autotest,
224                 "Report":  None,
225             },
226             {
227                 "Name":    "Mbuf autotest",
228                 "Command": "mbuf_autotest",
229                 "Func":    default_autotest,
230                 "Report":  None,
231             },
232             {
233                 "Name":    "Per-lcore autotest",
234                 "Command": "per_lcore_autotest",
235                 "Func":    default_autotest,
236                 "Report":  None,
237             },
238             {
239                 "Name":    "Ring autotest",
240                 "Command": "ring_autotest",
241                 "Func":    default_autotest,
242                 "Report":  None,
243             },
244         ]
245     },
246     {
247         "Prefix":    "group_5",
248         "Memory":    "32",
249         "Tests":
250         [
251             {
252                 "Name":    "Spinlock autotest",
253                 "Command": "spinlock_autotest",
254                 "Func":    spinlock_autotest,
255                 "Report":  None,
256             },
257             {
258                 "Name":    "Byte order autotest",
259                 "Command": "byteorder_autotest",
260                 "Func":    default_autotest,
261                 "Report":  None,
262             },
263             {
264                 "Name":    "TAILQ autotest",
265                 "Command": "tailq_autotest",
266                 "Func":    default_autotest,
267                 "Report":  None,
268             },
269             {
270                 "Name":    "Command-line autotest",
271                 "Command": "cmdline_autotest",
272                 "Func":    default_autotest,
273                 "Report":  None,
274             },
275             {
276                 "Name":    "Interrupts autotest",
277                 "Command": "interrupt_autotest",
278                 "Func":    default_autotest,
279                 "Report":  None,
280             },
281         ]
282     },
283     {
284         "Prefix":    "group_6",
285         "Memory":    per_sockets(512),
286         "Tests":
287         [
288             {
289                 "Name":    "Function reentrancy autotest",
290                 "Command": "func_reentrancy_autotest",
291                 "Func":    default_autotest,
292                 "Report":  None,
293             },
294             {
295                 "Name":    "Mempool autotest",
296                 "Command": "mempool_autotest",
297                 "Func":    default_autotest,
298                 "Report":  None,
299             },
300             {
301                 "Name":    "Atomics autotest",
302                 "Command": "atomic_autotest",
303                 "Func":    default_autotest,
304                 "Report":  None,
305             },
306             {
307                 "Name":    "Prefetch autotest",
308                 "Command": "prefetch_autotest",
309                 "Func":    default_autotest,
310                 "Report":  None,
311             },
312             {
313                 "Name":    "Red autotest",
314                 "Command": "red_autotest",
315                 "Func":    default_autotest,
316                 "Report":  None,
317             },
318         ]
319     },
320     {
321         "Prefix":    "group_7",
322         "Memory":    "64",
323         "Tests":
324         [
325             {
326                 "Name":    "PMD ring autotest",
327                 "Command": "ring_pmd_autotest",
328                 "Func":    default_autotest,
329                 "Report":  None,
330             },
331             {
332                 "Name":    "Access list control autotest",
333                 "Command": "acl_autotest",
334                 "Func":    default_autotest,
335                 "Report":  None,
336             },
337             {
338                 "Name":    "Sched autotest",
339                 "Command": "sched_autotest",
340                 "Func":    default_autotest,
341                 "Report":  None,
342             },
343         ]
344     },
345 ]
346
347 # tests that should not be run when any other tests are running
348 non_parallel_test_group_list = [
349
350     {
351         "Prefix":    "kni",
352         "Memory":    "512",
353         "Tests":
354         [
355             {
356                 "Name":    "KNI autotest",
357                 "Command": "kni_autotest",
358                 "Func":    default_autotest,
359                 "Report":  None,
360             },
361         ]
362     },
363     {
364         "Prefix":    "mempool_perf",
365         "Memory":    per_sockets(256),
366         "Tests":
367         [
368             {
369                 "Name":    "Mempool performance autotest",
370                 "Command": "mempool_perf_autotest",
371                 "Func":    default_autotest,
372                 "Report":  None,
373             },
374         ]
375     },
376     {
377         "Prefix":    "memcpy_perf",
378         "Memory":    per_sockets(512),
379         "Tests":
380         [
381             {
382                 "Name":    "Memcpy performance autotest",
383                 "Command": "memcpy_perf_autotest",
384                 "Func":    default_autotest,
385                 "Report":  None,
386             },
387         ]
388     },
389     {
390         "Prefix":    "hash_perf",
391         "Memory":    per_sockets(512),
392         "Tests":
393         [
394             {
395                 "Name":    "Hash performance autotest",
396                 "Command": "hash_perf_autotest",
397                 "Func":    default_autotest,
398                 "Report":  None,
399             },
400         ]
401     },
402     {
403         "Prefix":      "power",
404         "Memory":      "16",
405         "Tests":
406         [
407             {
408                 "Name":       "Power autotest",
409                 "Command":    "power_autotest",
410                 "Func":       default_autotest,
411                 "Report":      None,
412             },
413         ]
414     },
415     {
416         "Prefix":      "power_acpi_cpufreq",
417         "Memory":      "16",
418         "Tests":
419         [
420             {
421                 "Name":       "Power ACPI cpufreq autotest",
422                 "Command":    "power_acpi_cpufreq_autotest",
423                 "Func":       default_autotest,
424                 "Report":     None,
425             },
426         ]
427     },
428     {
429         "Prefix":      "power_kvm_vm",
430         "Memory":      "16",
431         "Tests":
432         [
433             {
434                 "Name":       "Power KVM VM  autotest",
435                 "Command":    "power_kvm_vm_autotest",
436                 "Func":       default_autotest,
437                 "Report":     None,
438             },
439         ]
440     },
441     {
442         "Prefix":    "timer_perf",
443         "Memory":    per_sockets(512),
444         "Tests":
445         [
446             {
447                 "Name":    "Timer performance autotest",
448                 "Command": "timer_perf_autotest",
449                 "Func":    default_autotest,
450                 "Report":  None,
451             },
452         ]
453     },
454
455     #
456     # Please always make sure that ring_perf is the last test!
457     #
458     {
459         "Prefix":    "ring_perf",
460         "Memory":    per_sockets(512),
461         "Tests":
462         [
463             {
464                 "Name":    "Ring performance autotest",
465                 "Command": "ring_perf_autotest",
466                 "Func":    default_autotest,
467                 "Report":  None,
468             },
469         ]
470     },
471 ]