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