Imported Upstream version 16.11
[deb_dpdk.git] / app / test / autotest_data.py
1 #!/usr/bin/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 # quick and dirty function to find out number of sockets
40 def num_sockets():
41         result = len(glob("/sys/devices/system/node/node*"))
42         if result == 0:
43                 return 1
44         return result
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 {
56         "Prefix":       "group_1",
57         "Memory" :      per_sockets(8),
58         "Tests" :
59         [
60                 {
61                  "Name" :       "Cycles autotest",
62                  "Command" :    "cycles_autotest",
63                  "Func" :       default_autotest,
64                  "Report" :     None,
65                 },
66                 {
67                  "Name" :       "Timer autotest",
68                  "Command" :    "timer_autotest",
69                  "Func" :       timer_autotest,
70                  "Report" :     None,
71                 },
72                 {
73                  "Name" :       "Debug autotest",
74                  "Command" :    "debug_autotest",
75                  "Func" :       default_autotest,
76                  "Report" :     None,
77                 },
78                 {
79                  "Name" :       "Errno autotest",
80                  "Command" :    "errno_autotest",
81                  "Func" :       default_autotest,
82                  "Report" :     None,
83                 },
84                 {
85                  "Name" :       "Meter autotest",
86                  "Command" :    "meter_autotest",
87                  "Func" :       default_autotest,
88                  "Report" :     None,
89                 },
90                 {
91                  "Name" :       "Common autotest",
92                  "Command" :    "common_autotest",
93                  "Func" :       default_autotest,
94                  "Report" :     None,
95                 },
96                 {
97                  "Name" :       "Resource autotest",
98                  "Command" :    "resource_autotest",
99                  "Func" :       default_autotest,
100                  "Report" :     None,
101                 },
102         ]
103 },
104 {
105         "Prefix":       "group_2",
106         "Memory" :      "16",
107         "Tests" :
108         [
109                 {
110                  "Name" :       "Memory autotest",
111                  "Command" :    "memory_autotest",
112                  "Func" :       memory_autotest,
113                  "Report" :     None,
114                 },
115                 {
116                  "Name" :       "Read/write lock autotest",
117                  "Command" :    "rwlock_autotest",
118                  "Func" :       rwlock_autotest,
119                  "Report" :     None,
120                 },
121                 {
122                  "Name" :       "Logs autotest",
123                  "Command" :    "logs_autotest",
124                  "Func" :       logs_autotest,
125                  "Report" :     None,
126                 },
127                 {
128                  "Name" :       "CPU flags autotest",
129                  "Command" :    "cpuflags_autotest",
130                  "Func" :       default_autotest,
131                  "Report" :     None,
132                 },
133                 {
134                  "Name" :       "Version autotest",
135                  "Command" :    "version_autotest",
136                  "Func" :       default_autotest,
137                  "Report" :     None,
138                 },
139                 {
140                  "Name" :       "EAL filesystem autotest",
141                  "Command" :    "eal_fs_autotest",
142                  "Func" :       default_autotest,
143                  "Report" :     None,
144                 },
145                 {
146                  "Name" :       "EAL flags autotest",
147                  "Command" :    "eal_flags_autotest",
148                  "Func" :       default_autotest,
149                  "Report" :     None,
150                 },
151                 {
152                  "Name" :       "Hash autotest",
153                  "Command" :    "hash_autotest",
154                  "Func" :       default_autotest,
155                  "Report" :     None,
156                 },
157         ],
158 },
159 {
160         "Prefix":       "group_3",
161         "Memory" :      per_sockets(512),
162         "Tests" :
163         [
164                 {
165                  "Name" :       "LPM autotest",
166                  "Command" :    "lpm_autotest",
167                  "Func" :       default_autotest,
168                  "Report" :     None,
169                 },
170                 {
171                         "Name" :    "LPM6 autotest",
172                         "Command" : "lpm6_autotest",
173                         "Func" :    default_autotest,
174                         "Report" :  None,
175                 },
176                 {
177                  "Name" :       "Memcpy autotest",
178                  "Command" :    "memcpy_autotest",
179                  "Func" :       default_autotest,
180                  "Report" :     None,
181                 },
182                 {
183                  "Name" :       "Memzone autotest",
184                  "Command" :    "memzone_autotest",
185                  "Func" :       default_autotest,
186                  "Report" :     None,
187                 },
188                 {
189                  "Name" :       "String autotest",
190                  "Command" :    "string_autotest",
191                  "Func" :       default_autotest,
192                  "Report" :     None,
193                 },
194                 {
195                  "Name" :       "Alarm autotest",
196                  "Command" :    "alarm_autotest",
197                  "Func" :       default_autotest,
198                  "Report" :     None,
199                 },
200         ]
201 },
202 {
203         "Prefix":       "group_4",
204         "Memory" :      per_sockets(128),
205         "Tests" :
206         [
207                 {
208                  "Name" :       "PCI autotest",
209                  "Command" :    "pci_autotest",
210                  "Func" :       default_autotest,
211                  "Report" :     None,
212                 },
213                 {
214                  "Name" :       "Malloc autotest",
215                  "Command" :    "malloc_autotest",
216                  "Func" :       default_autotest,
217                  "Report" :     None,
218                 },
219                 {
220                  "Name" :       "Multi-process autotest",
221                  "Command" :    "multiprocess_autotest",
222                  "Func" :       default_autotest,
223                  "Report" :     None,
224                 },
225                 {
226                  "Name" :       "Mbuf autotest",
227                  "Command" :    "mbuf_autotest",
228                  "Func" :       default_autotest,
229                  "Report" :     None,
230                 },
231                 {
232                  "Name" :       "Per-lcore autotest",
233                  "Command" :    "per_lcore_autotest",
234                  "Func" :       default_autotest,
235                  "Report" :     None,
236                 },
237                 {
238                  "Name" :       "Ring autotest",
239                  "Command" :    "ring_autotest",
240                  "Func" :       default_autotest,
241                  "Report" :     None,
242                 },
243         ]
244 },
245 {
246         "Prefix":       "group_5",
247         "Memory" :      "32",
248         "Tests" :
249         [
250                 {
251                  "Name" :       "Spinlock autotest",
252                  "Command" :    "spinlock_autotest",
253                  "Func" :       spinlock_autotest,
254                  "Report" :     None,
255                 },
256                 {
257                  "Name" :       "Byte order autotest",
258                  "Command" :    "byteorder_autotest",
259                  "Func" :       default_autotest,
260                  "Report" :     None,
261                 },
262                 {
263                  "Name" :       "TAILQ autotest",
264                  "Command" :    "tailq_autotest",
265                  "Func" :       default_autotest,
266                  "Report" :     None,
267                 },
268                 {
269                  "Name" :       "Command-line autotest",
270                  "Command" :    "cmdline_autotest",
271                  "Func" :       default_autotest,
272                  "Report" :     None,
273                 },
274                 {
275                  "Name" :       "Interrupts autotest",
276                  "Command" :    "interrupt_autotest",
277                  "Func" :       default_autotest,
278                  "Report" :     None,
279                 },
280         ]
281 },
282 {
283         "Prefix":       "group_6",
284         "Memory" :      per_sockets(512),
285         "Tests" :
286         [
287                 {
288                  "Name" :       "Function reentrancy autotest",
289                  "Command" :    "func_reentrancy_autotest",
290                  "Func" :       default_autotest,
291                  "Report" :     None,
292                 },
293                 {
294                  "Name" :       "Mempool autotest",
295                  "Command" :    "mempool_autotest",
296                  "Func" :       default_autotest,
297                  "Report" :     None,
298                 },
299                 {
300                  "Name" :       "Atomics autotest",
301                  "Command" :    "atomic_autotest",
302                  "Func" :       default_autotest,
303                  "Report" :     None,
304                 },
305                 {
306                  "Name" :       "Prefetch autotest",
307                  "Command" :    "prefetch_autotest",
308                  "Func" :       default_autotest,
309                  "Report" :     None,
310                  },
311                 {
312                  "Name" :"Red autotest",
313                  "Command" : "red_autotest",
314                  "Func" :default_autotest,
315                  "Report" :None,
316                  },
317         ]
318 },
319 {
320         "Prefix" :      "group_7",
321         "Memory" :      "64",
322         "Tests" :
323         [
324                 {
325                  "Name" :       "PMD ring autotest",
326                  "Command" :    "ring_pmd_autotest",
327                  "Func" :       default_autotest,
328                  "Report" :     None,
329                 },
330                 {
331                  "Name" :       "Access list control autotest",
332                  "Command" :    "acl_autotest",
333                  "Func" :       default_autotest,
334                  "Report" :     None,
335                 },
336                  {
337                  "Name" :"Sched autotest",
338                  "Command" : "sched_autotest",
339                  "Func" :default_autotest,
340                  "Report" :None,
341                  },
342         ]
343 },
344 ]
345
346 # tests that should not be run when any other tests are running
347 non_parallel_test_group_list = [
348
349 {
350         "Prefix" :      "kni",
351         "Memory" :      "512",
352         "Tests" :
353         [
354                 {
355                  "Name" :       "KNI autotest",
356                  "Command" :    "kni_autotest",
357                  "Func" :       default_autotest,
358                  "Report" :     None,
359                 },
360         ]
361 },
362 {
363         "Prefix":       "mempool_perf",
364         "Memory" :      per_sockets(256),
365         "Tests" :
366         [
367                 {
368                  "Name" :       "Mempool performance autotest",
369                  "Command" :    "mempool_perf_autotest",
370                  "Func" :       default_autotest,
371                  "Report" :     None,
372                 },
373         ]
374 },
375 {
376         "Prefix":       "memcpy_perf",
377         "Memory" :      per_sockets(512),
378         "Tests" :
379         [
380                 {
381                  "Name" :       "Memcpy performance autotest",
382                  "Command" :    "memcpy_perf_autotest",
383                  "Func" :       default_autotest,
384                  "Report" :     None,
385                 },
386         ]
387 },
388 {
389         "Prefix":       "hash_perf",
390         "Memory" :      per_sockets(512),
391         "Tests" :
392         [
393                 {
394                  "Name" :       "Hash performance autotest",
395                  "Command" :    "hash_perf_autotest",
396                  "Func" :       default_autotest,
397                  "Report" :     None,
398                 },
399         ]
400 },
401 {
402         "Prefix" :      "power",
403         "Memory" :      "16",
404         "Tests" :
405         [
406                 {
407                  "Name" :       "Power autotest",
408                  "Command" :    "power_autotest",
409                  "Func" :       default_autotest,
410                  "Report" :     None,
411                 },
412         ]
413 },
414 {
415         "Prefix" :      "power_acpi_cpufreq",
416         "Memory" :      "16",
417         "Tests" :
418         [
419                 {
420                  "Name" :       "Power ACPI cpufreq autotest",
421                  "Command" :    "power_acpi_cpufreq_autotest",
422                  "Func" :       default_autotest,
423                  "Report" :     None,
424                 },
425         ]
426 },
427 {
428         "Prefix" :      "power_kvm_vm",
429         "Memory" :      "16",
430         "Tests" :
431         [
432                 {
433                  "Name" :       "Power KVM VM  autotest",
434                  "Command" :    "power_kvm_vm_autotest",
435                  "Func" :       default_autotest,
436                  "Report" :     None,
437                 },
438         ]
439 },
440 {
441         "Prefix":       "timer_perf",
442         "Memory" :      per_sockets(512),
443         "Tests" :
444         [
445                 {
446                  "Name" :       "Timer performance autotest",
447                  "Command" :    "timer_perf_autotest",
448                  "Func" :       default_autotest,
449                  "Report" :     None,
450                 },
451         ]
452 },
453
454 #
455 # Please always make sure that ring_perf is the last test!
456 #
457 {
458         "Prefix":       "ring_perf",
459         "Memory" :      per_sockets(512),
460         "Tests" :
461         [
462                 {
463                  "Name" :       "Ring performance autotest",
464                  "Command" :    "ring_perf_autotest",
465                  "Func" :       default_autotest,
466                  "Report" :     None,
467                 },
468         ]
469 },
470 ]