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