527044767ef83a0138b41a7c01a590553af35f78
[dpdk.git] / app / test / autotest_data.py
1 #!/usr/bin/python
2
3 #   BSD LICENSE
4
5 #   Copyright(c) 2010-2012 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" :       "Dump log history",
82                  "Command" :    "dump_log_history",
83                  "Func" :       dump_autotest,
84                  "Report" :     None,
85                 },
86                 {
87                  "Name" :       "Dump rings",
88                  "Command" :    "dump_ring",
89                  "Func" :       dump_autotest,
90                  "Report" :     None,
91                 },
92                 {
93                  "Name" :       "Dump mempools",
94                  "Command" :    "dump_mempool",
95                  "Func" :       dump_autotest,
96                  "Report" :     None,
97                 },
98         ]
99 },
100 {
101         "Prefix":       "group_2",
102         "Memory" :      "32",
103         "Tests" :       
104         [
105                 {
106                  "Name" :       "Memory autotest",
107                  "Command" :    "memory_autotest",
108                  "Func" :       memory_autotest,
109                  "Report" :     None,
110                 },
111                 {
112                  "Name" :       "Read/write lock autotest",
113                  "Command" :    "rwlock_autotest",
114                  "Func" :       rwlock_autotest,
115                  "Report" :     None,
116                 },
117                 {
118                  "Name" :       "Logs autotest",
119                  "Command" :    "logs_autotest",
120                  "Func" :       logs_autotest,
121                  "Report" :     None,
122                 },
123                 {
124                  "Name" :       "CPU flags autotest",
125                  "Command" :    "cpuflags_autotest",
126                  "Func" :       default_autotest,
127                  "Report" :     None,
128                 },
129                 {
130                  "Name" :       "Version autotest",
131                  "Command" :    "version_autotest",
132                  "Func" :       default_autotest,
133                  "Report" :     None,
134                 },
135                 {
136                  "Name" :       "EAL filesystem autotest",
137                  "Command" :    "eal_fs_autotest",
138                  "Func" :       default_autotest,
139                  "Report" :     None,
140                 },
141                 {
142                  "Name" :       "EAL flags autotest",
143                  "Command" :    "eal_flags_autotest",
144                  "Func" :       default_autotest,
145                  "Report" :     None,
146                 },
147                 {
148                  "Name" :       "Hash autotest",
149                  "Command" :    "hash_autotest",
150                  "Func" :       default_autotest,
151                  "Report" :     None,
152                 },
153         ],
154 },
155 {
156         "Prefix":       "group_3",
157         "Memory" :      all_sockets(256),
158         "Tests" :       
159         [
160                 {
161                  "Name" :       "LPM autotest",
162                  "Command" :    "lpm_autotest",
163                  "Func" :       default_autotest,
164                  "Report" :     None,
165                 },
166                 {
167                  "Name" :       "Memcpy autotest",
168                  "Command" :    "memcpy_autotest",
169                  "Func" :       default_autotest,
170                  "Report" :     None,
171                 },
172                 {
173                  "Name" :       "Memzone autotest",
174                  "Command" :    "memzone_autotest",
175                  "Func" :       default_autotest,
176                  "Report" :     None,
177                 },
178                 {
179                  "Name" :       "String autotest",
180                  "Command" :    "string_autotest",
181                  "Func" :       default_autotest,
182                  "Report" :     None,
183                 },
184                 {
185                  "Name" :       "Alarm autotest",
186                  "Command" :    "alarm_autotest",
187                  "Func" :       default_autotest,
188                  "Report" :     None,
189                 },
190         ]
191 },
192 {
193         "Prefix":       "group_4",
194         "Memory" :      all_sockets(128),
195         "Tests" :       
196         [
197                 {
198                  "Name" :       "PCI autotest",
199                  "Command" :    "pci_autotest",
200                  "Func" :       default_autotest,
201                  "Report" :     None,
202                 },
203                 {
204                  "Name" :       "Malloc autotest",
205                  "Command" :    "malloc_autotest",
206                  "Func" :       default_autotest,
207                  "Report" :     None,
208                 },
209                 {
210                  "Name" :       "Multi-process autotest",
211                  "Command" :    "multiprocess_autotest",
212                  "Func" :       default_autotest,
213                  "Report" :     None,
214                 },
215                 {
216                  "Name" :       "Mbuf autotest",
217                  "Command" :    "mbuf_autotest",
218                  "Func" :       default_autotest,
219                  "Report" :     None,
220                 },
221                 {
222                  "Name" :       "Per-lcore autotest",
223                  "Command" :    "per_lcore_autotest",
224                  "Func" :       default_autotest,
225                  "Report" :     None,
226                 },
227         ]
228 },
229 {
230         "Prefix":       "group_5",
231         "Memory" :      "16",
232         "Tests" :       
233         [
234                 {
235                  "Name" :       "Spinlock autotest",
236                  "Command" :    "spinlock_autotest",
237                  "Func" :       spinlock_autotest,
238                  "Report" :     None,
239                 },
240                 {
241                  "Name" :       "Byte order autotest",
242                  "Command" :    "byteorder_autotest",
243                  "Func" :       default_autotest,
244                  "Report" :     None,
245                 },
246                 {
247                  "Name" :       "TAILQ autotest",
248                  "Command" :    "tailq_autotest",
249                  "Func" :       default_autotest,
250                  "Report" :     None,
251                 },
252                 {
253                  "Name" :       "Command-line autotest",
254                  "Command" :    "cmdline_autotest",
255                  "Func" :       default_autotest,
256                  "Report" :     None,
257                 },
258                 {
259                  "Name" :       "Interrupts autotest",
260                  "Command" :    "interrupt_autotest",
261                  "Func" :       default_autotest,
262                  "Report" :     None,
263                 },
264         ]
265 },
266 {
267         "Prefix":       "group_6",
268         "Memory" :      all_sockets(588),
269         "Tests" :       
270         [
271                 {
272                  "Name" :       "Function reentrancy autotest",
273                  "Command" :    "func_reentrancy_autotest",
274                  "Func" :       default_autotest,
275                  "Report" :     None,
276                 },
277                 {
278                  "Name" :       "Mempool autotest",
279                  "Command" :    "mempool_autotest",
280                  "Func" :       default_autotest,
281                  "Report" :     None,
282                 },
283                 {
284                  "Name" :       "Atomics autotest",
285                  "Command" :    "atomic_autotest",
286                  "Func" :       default_autotest,
287                  "Report" :     None,
288                 },
289                 {
290                  "Name" :       "Prefetch autotest",
291                  "Command" :    "prefetch_autotest",
292                  "Func" :       default_autotest,
293                  "Report" :     None,
294                 },
295         ]
296 },
297 {
298         "Prefix" :      "group_7",
299         "Memory" :      "400",
300         "Tests" :
301         [
302                 {
303                  "Name" :       "Access list control autotest",
304                  "Command" :    "acl_autotest",
305                  "Func" :       default_autotest,
306                  "Report" :     None,
307                 },
308                 {
309                  "Name" :       "Pattern match autotest",
310                  "Command" :    "pm_autotest",
311                  "Func" :       default_autotest,
312                  "Report" :     None,
313                 },
314         ]
315 },
316 ]
317
318 # tests that should not be run when any other tests are running
319 non_parallel_test_group_list = [
320
321 {
322         "Prefix":       "mempool_perf",
323         "Memory" :      all_sockets(256),
324         "Tests" :       
325         [
326                 {
327                  "Name" :       "Cycles autotest",
328                  "Command" :    "cycles_autotest",
329                  "Func" :       default_autotest,
330                  "Report" :     None,
331                 },
332                 {
333                  "Name" :       "Mempool performance autotest",
334                  "Command" :    "mempool_perf_autotest",
335                  "Func" :       default_autotest,
336                  "Report" :     None,
337                 },
338         ]
339 },
340 {
341         "Prefix":       "memcpy_perf",
342         "Memory" :      all_sockets(512),
343         "Tests" :       
344         [
345                 {
346                  "Name" :       "Memcpy performance autotest",
347                  "Command" :    "memcpy_perf_autotest",
348                  "Func" :       default_autotest,
349                  "Report" :     None,
350                 },
351         ]
352 },
353 {
354         "Prefix":       "hash_perf",
355         "Memory" :      all_sockets(512),
356         "Tests" :       
357         [
358                 {
359                  "Name" :       "Hash performance autotest",
360                  "Command" :    "hash_perf_autotest",
361                  "Func" :       default_autotest,
362                  "Report" :     None,
363                 },
364         ]
365 },
366 {
367         "Prefix":       "ring_perf",
368         "Memory" :      all_sockets(512),
369         "Tests" :       
370         [
371                 {
372                  "Name" :       "Ring autotest",
373                  "Command" :    "ring_autotest",
374                  "Func" :       ring_autotest,
375                  "Report" :     None,
376                 },
377         ]
378 },
379
380 ]