app: add some tests
[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 },
241 {
242         "Prefix":       "group_5",
243         "Memory" :      "16",
244         "Tests" :       
245         [
246                 {
247                  "Name" :       "Spinlock autotest",
248                  "Command" :    "spinlock_autotest",
249                  "Func" :       spinlock_autotest,
250                  "Report" :     None,
251                 },
252                 {
253                  "Name" :       "Byte order autotest",
254                  "Command" :    "byteorder_autotest",
255                  "Func" :       default_autotest,
256                  "Report" :     None,
257                 },
258                 {
259                  "Name" :       "TAILQ autotest",
260                  "Command" :    "tailq_autotest",
261                  "Func" :       default_autotest,
262                  "Report" :     None,
263                 },
264                 {
265                  "Name" :       "Command-line autotest",
266                  "Command" :    "cmdline_autotest",
267                  "Func" :       default_autotest,
268                  "Report" :     None,
269                 },
270                 {
271                  "Name" :       "Interrupts autotest",
272                  "Command" :    "interrupt_autotest",
273                  "Func" :       default_autotest,
274                  "Report" :     None,
275                 },
276         ]
277 },
278 {
279         "Prefix":       "group_6",
280         "Memory" :      all_sockets(600),
281         "Tests" :       
282         [
283                 {
284                  "Name" :       "Function reentrancy autotest",
285                  "Command" :    "func_reentrancy_autotest",
286                  "Func" :       default_autotest,
287                  "Report" :     None,
288                 },
289                 {
290                  "Name" :       "Mempool autotest",
291                  "Command" :    "mempool_autotest",
292                  "Func" :       default_autotest,
293                  "Report" :     None,
294                 },
295                 {
296                  "Name" :       "Atomics autotest",
297                  "Command" :    "atomic_autotest",
298                  "Func" :       default_autotest,
299                  "Report" :     None,
300                 },
301                 {
302                  "Name" :       "Prefetch autotest",
303                  "Command" :    "prefetch_autotest",
304                  "Func" :       default_autotest,
305                  "Report" :     None,
306                  },
307                 {
308                  "Name" :"Red autotest",
309                  "Command" : "red_autotest",
310                  "Func" :default_autotest,
311                  "Report" :None,
312                  },
313         ]
314 },
315 {
316         "Prefix" :      "group_7",
317         "Memory" :      "400",
318         "Tests" :
319         [
320                 {
321                  "Name" :       "Access list control autotest",
322                  "Command" :    "acl_autotest",
323                  "Func" :       default_autotest,
324                  "Report" :     None,
325                 },
326                 {
327                  "Name" :       "Pattern match autotest",
328                  "Command" :    "pm_autotest",
329                  "Func" :       default_autotest,
330                  "Report" :     None,
331                 },
332                  {
333                  "Name" :"Sched autotest",
334                  "Command" : "sched_autotest",
335                  "Func" :default_autotest,
336                  "Report" :None,
337                  },
338         ]
339 },
340 ]
341
342 # tests that should not be run when any other tests are running
343 non_parallel_test_group_list = [
344
345 {
346         "Prefix" :      "kni",
347         "Memory" :      "512",
348         "Tests" :
349         [
350                 {
351                  "Name" :       "KNI autotest",
352                  "Command" :    "kni_autotest",
353                  "Func" :       default_autotest,
354                  "Report" :     None,
355                 },
356         ]
357 },
358 {
359         "Prefix":       "mempool_perf",
360         "Memory" :      all_sockets(256),
361         "Tests" :       
362         [
363                 {
364                  "Name" :       "Cycles autotest",
365                  "Command" :    "cycles_autotest",
366                  "Func" :       default_autotest,
367                  "Report" :     None,
368                 },
369                 {
370                  "Name" :       "Mempool performance autotest",
371                  "Command" :    "mempool_perf_autotest",
372                  "Func" :       default_autotest,
373                  "Report" :     None,
374                 },
375         ]
376 },
377 {
378         "Prefix":       "memcpy_perf",
379         "Memory" :      all_sockets(512),
380         "Tests" :       
381         [
382                 {
383                  "Name" :       "Memcpy performance autotest",
384                  "Command" :    "memcpy_perf_autotest",
385                  "Func" :       default_autotest,
386                  "Report" :     None,
387                 },
388         ]
389 },
390 {
391         "Prefix":       "hash_perf",
392         "Memory" :      all_sockets(512),
393         "Tests" :       
394         [
395                 {
396                  "Name" :       "Hash performance autotest",
397                  "Command" :    "hash_perf_autotest",
398                  "Func" :       default_autotest,
399                  "Report" :     None,
400                 },
401         ]
402 },
403 {
404         "Prefix" :      "power",
405         "Memory" :      all_sockets(512),
406         "Tests" :
407         [
408                 {
409                  "Name" :       "Power autotest",
410                  "Command" :    "power_autotest",
411                  "Func" :       default_autotest,
412                  "Report" :     None,
413                 },
414         ]
415 },
416 {
417         "Prefix" :      "lpm6",
418         "Memory" :      "512",
419         "Tests" :
420         [
421                 {
422                  "Name" :       "LPM6 autotest",
423                  "Command" :    "lpm6_autotest",
424                  "Func" :       default_autotest,
425                  "Report" :     None,
426                 },
427         ]
428 },
429 {
430         "Prefix":       "ring_perf",
431         "Memory" :      all_sockets(512),
432         "Tests" :       
433         [
434                 {
435                  "Name" :       "Ring autotest",
436                  "Command" :    "ring_autotest",
437                  "Func" :       ring_autotest,
438                  "Report" :     None,
439                 },
440         ]
441 },
442
443 ]