doc: whitespace changes in licenses
[dpdk.git] / app / test / autotest_data.py
1 #!/usr/bin/python
2
3 #   BSD LICENSE
4
5 #   Copyright(c) 2010-2013 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 # multiply given number for all sockets
47 # e.g. 32 becomes 32,32 or 32,32,32,32 etc.
48 def all_sockets(num):
49         mem_per_socket = num / num_sockets()
50         return ",".join([str(mem_per_socket)] * num_sockets())
51
52 # groups of tests that can be run in parallel
53 # the grouping has been found largely empirically
54 parallel_test_group_list = [
55
56 {
57         "Prefix":       "group_1",
58         "Memory" :      "2",
59         "Tests" :       
60         [
61                 {
62                  "Name" :       "Timer autotest",
63                  "Command" :    "timer_autotest",
64                  "Func" :       timer_autotest,
65                  "Report" :     None,
66                 },
67                 {
68                  "Name" :       "Debug autotest",
69                  "Command" :    "debug_autotest",
70                  "Func" :       default_autotest,
71                  "Report" :     None,
72                 },      
73                 {
74                  "Name" :       "Errno autotest",
75                  "Command" :    "errno_autotest",
76                  "Func" :       default_autotest,
77                  "Report" :     None,
78                 },
79                 {
80                  "Name" :       "Meter autotest",
81                  "Command" :    "meter_autotest",
82                  "Func" :       default_autotest,
83                  "Report" :     None,
84                 },
85                 {
86                  "Name" :       "Common autotest",
87                  "Command" :    "common_autotest",
88                  "Func" :       default_autotest,
89                  "Report" :     None,
90                 },      
91                 {
92                  "Name" :       "Dump log history",
93                  "Command" :    "dump_log_history",
94                  "Func" :       dump_autotest,
95                  "Report" :     None,
96                 },
97                 {
98                  "Name" :       "Dump rings",
99                  "Command" :    "dump_ring",
100                  "Func" :       dump_autotest,
101                  "Report" :     None,
102                 },
103                 {
104                  "Name" :       "Dump mempools",
105                  "Command" :    "dump_mempool",
106                  "Func" :       dump_autotest,
107                  "Report" :     None,
108                 },
109         ]
110 },
111 {
112         "Prefix":       "group_2",
113         "Memory" :      "32",
114         "Tests" :       
115         [
116                 {
117                  "Name" :       "Memory autotest",
118                  "Command" :    "memory_autotest",
119                  "Func" :       memory_autotest,
120                  "Report" :     None,
121                 },
122                 {
123                  "Name" :       "Read/write lock autotest",
124                  "Command" :    "rwlock_autotest",
125                  "Func" :       rwlock_autotest,
126                  "Report" :     None,
127                 },
128                 {
129                  "Name" :       "Logs autotest",
130                  "Command" :    "logs_autotest",
131                  "Func" :       logs_autotest,
132                  "Report" :     None,
133                 },
134                 {
135                  "Name" :       "CPU flags autotest",
136                  "Command" :    "cpuflags_autotest",
137                  "Func" :       default_autotest,
138                  "Report" :     None,
139                 },
140                 {
141                  "Name" :       "Version autotest",
142                  "Command" :    "version_autotest",
143                  "Func" :       default_autotest,
144                  "Report" :     None,
145                 },
146                 {
147                  "Name" :       "EAL filesystem autotest",
148                  "Command" :    "eal_fs_autotest",
149                  "Func" :       default_autotest,
150                  "Report" :     None,
151                 },
152                 {
153                  "Name" :       "EAL flags autotest",
154                  "Command" :    "eal_flags_autotest",
155                  "Func" :       default_autotest,
156                  "Report" :     None,
157                 },
158                 {
159                  "Name" :       "Hash autotest",
160                  "Command" :    "hash_autotest",
161                  "Func" :       default_autotest,
162                  "Report" :     None,
163                 },
164         ],
165 },
166 {
167         "Prefix":       "group_3",
168         "Memory" :      all_sockets(256),
169         "Tests" :       
170         [
171                 {
172                  "Name" :       "LPM autotest",
173                  "Command" :    "lpm_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" :      all_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" :      "16",
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" :      all_sockets(600),
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" :      "400",
323         "Tests" :
324         [
325                 {
326                  "Name" :       "Access list control autotest",
327                  "Command" :    "acl_autotest",
328                  "Func" :       default_autotest,
329                  "Report" :     None,
330                 },
331                 {
332                  "Name" :       "Pattern match autotest",
333                  "Command" :    "pm_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" :      all_sockets(256),
366         "Tests" :       
367         [
368                 {
369                  "Name" :       "Cycles autotest",
370                  "Command" :    "cycles_autotest",
371                  "Func" :       default_autotest,
372                  "Report" :     None,
373                 },
374                 {
375                  "Name" :       "Mempool performance autotest",
376                  "Command" :    "mempool_perf_autotest",
377                  "Func" :       default_autotest,
378                  "Report" :     None,
379                 },
380         ]
381 },
382 {
383         "Prefix":       "memcpy_perf",
384         "Memory" :      all_sockets(512),
385         "Tests" :       
386         [
387                 {
388                  "Name" :       "Memcpy performance autotest",
389                  "Command" :    "memcpy_perf_autotest",
390                  "Func" :       default_autotest,
391                  "Report" :     None,
392                 },
393         ]
394 },
395 {
396         "Prefix":       "hash_perf",
397         "Memory" :      all_sockets(512),
398         "Tests" :       
399         [
400                 {
401                  "Name" :       "Hash performance autotest",
402                  "Command" :    "hash_perf_autotest",
403                  "Func" :       default_autotest,
404                  "Report" :     None,
405                 },
406         ]
407 },
408 {
409         "Prefix" :      "power",
410         "Memory" :      all_sockets(512),
411         "Tests" :
412         [
413                 {
414                  "Name" :       "Power autotest",
415                  "Command" :    "power_autotest",
416                  "Func" :       default_autotest,
417                  "Report" :     None,
418                 },
419         ]
420 },
421 {
422         "Prefix" :      "lpm6",
423         "Memory" :      "512",
424         "Tests" :
425         [
426                 {
427                  "Name" :       "LPM6 autotest",
428                  "Command" :    "lpm6_autotest",
429                  "Func" :       default_autotest,
430                  "Report" :     None,
431                 },
432         ]
433 },
434 {
435         "Prefix":       "ring_perf",
436         "Memory" :      all_sockets(512),
437         "Tests" :       
438         [
439                 {
440                  "Name" :       "Ring performance autotest",
441                  "Command" :    "ring_perf_autotest",
442                  "Func" :       default_autotest,
443                  "Report" :     None,
444                 },
445         ]
446 },
447
448 ]