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