pmac: integration without lib
[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         return len(glob("/sys/devices/system/node/node*"))
43
44 # multiply given number for all sockets
45 # e.g. 32 becomes 32,32 or 32,32,32,32 etc.
46 def all_sockets(num):
47         mem_per_socket = num / num_sockets()
48         return ",".join([str(mem_per_socket)] * num_sockets())
49
50 # groups of tests that can be run in parallel
51 # the grouping has been found largely empirically
52 parallel_test_group_list = [
53
54 {
55         "Prefix":       "group_1",
56         "Memory" :      "2",
57         "Tests" :       
58         [
59                 {
60                  "Name" :       "Timer autotest",
61                  "Command" :    "timer_autotest",
62                  "Func" :       timer_autotest,
63                  "Report" :     None,
64                 },
65                 {
66                  "Name" :       "Debug autotest",
67                  "Command" :    "debug_autotest",
68                  "Func" :       default_autotest,
69                  "Report" :     None,
70                 },
71                 {
72                  "Name" :       "Errno autotest",
73                  "Command" :    "errno_autotest",
74                  "Func" :       default_autotest,
75                  "Report" :     None,
76                 },
77                 {
78                  "Name" :       "Dump log history",
79                  "Command" :    "dump_log_history",
80                  "Func" :       dump_autotest,
81                  "Report" :     None,
82                 },
83                 {
84                  "Name" :       "Dump rings",
85                  "Command" :    "dump_ring",
86                  "Func" :       dump_autotest,
87                  "Report" :     None,
88                 },
89                 {
90                  "Name" :       "Dump mempools",
91                  "Command" :    "dump_mempool",
92                  "Func" :       dump_autotest,
93                  "Report" :     None,
94                 },
95         ]
96 },
97 {
98         "Prefix":       "group_2",
99         "Memory" :      "32",
100         "Tests" :       
101         [
102                 {
103                  "Name" :       "Memory autotest",
104                  "Command" :    "memory_autotest",
105                  "Func" :       memory_autotest,
106                  "Report" :     None,
107                 },
108                 {
109                  "Name" :       "Read/write lock autotest",
110                  "Command" :    "rwlock_autotest",
111                  "Func" :       rwlock_autotest,
112                  "Report" :     None,
113                 },
114                 {
115                  "Name" :       "Logs autotest",
116                  "Command" :    "logs_autotest",
117                  "Func" :       logs_autotest,
118                  "Report" :     None,
119                 },
120                 {
121                  "Name" :       "CPU flags autotest",
122                  "Command" :    "cpuflags_autotest",
123                  "Func" :       default_autotest,
124                  "Report" :     None,
125                 },
126                 {
127                  "Name" :       "Version autotest",
128                  "Command" :    "version_autotest",
129                  "Func" :       default_autotest,
130                  "Report" :     None,
131                 },
132                 {
133                  "Name" :       "EAL filesystem autotest",
134                  "Command" :    "eal_fs_autotest",
135                  "Func" :       default_autotest,
136                  "Report" :     None,
137                 },
138                 {
139                  "Name" :       "EAL flags autotest",
140                  "Command" :    "eal_flags_autotest",
141                  "Func" :       default_autotest,
142                  "Report" :     None,
143                 },
144                 {
145                  "Name" :       "Hash autotest",
146                  "Command" :    "hash_autotest",
147                  "Func" :       default_autotest,
148                  "Report" :     None,
149                 },
150         ],
151 },
152 {
153         "Prefix":       "group_3",
154         "Memory" :      all_sockets(256),
155         "Tests" :       
156         [
157                 {
158                  "Name" :       "LPM autotest",
159                  "Command" :    "lpm_autotest",
160                  "Func" :       default_autotest,
161                  "Report" :     None,
162                 },
163                 {
164                  "Name" :       "Memcpy autotest",
165                  "Command" :    "memcpy_autotest",
166                  "Func" :       default_autotest,
167                  "Report" :     None,
168                 },
169                 {
170                  "Name" :       "Memzone autotest",
171                  "Command" :    "memzone_autotest",
172                  "Func" :       default_autotest,
173                  "Report" :     None,
174                 },
175                 {
176                  "Name" :       "String autotest",
177                  "Command" :    "string_autotest",
178                  "Func" :       default_autotest,
179                  "Report" :     None,
180                 },
181                 {
182                  "Name" :       "Alarm autotest",
183                  "Command" :    "alarm_autotest",
184                  "Func" :       default_autotest,
185                  "Report" :     None,
186                 },
187         ]
188 },
189 {
190         "Prefix":       "group_4",
191         "Memory" :      all_sockets(128),
192         "Tests" :       
193         [
194                 {
195                  "Name" :       "PCI autotest",
196                  "Command" :    "pci_autotest",
197                  "Func" :       default_autotest,
198                  "Report" :     None,
199                 },
200                 {
201                  "Name" :       "Malloc autotest",
202                  "Command" :    "malloc_autotest",
203                  "Func" :       default_autotest,
204                  "Report" :     None,
205                 },
206                 {
207                  "Name" :       "Multi-process autotest",
208                  "Command" :    "multiprocess_autotest",
209                  "Func" :       default_autotest,
210                  "Report" :     None,
211                 },
212                 {
213                  "Name" :       "Mbuf autotest",
214                  "Command" :    "mbuf_autotest",
215                  "Func" :       default_autotest,
216                  "Report" :     None,
217                 },
218                 {
219                  "Name" :       "Per-lcore autotest",
220                  "Command" :    "per_lcore_autotest",
221                  "Func" :       default_autotest,
222                  "Report" :     None,
223                 },
224         ]
225 },
226 {
227         "Prefix":       "group_5",
228         "Memory" :      "16",
229         "Tests" :       
230         [
231                 {
232                  "Name" :       "Spinlock autotest",
233                  "Command" :    "spinlock_autotest",
234                  "Func" :       spinlock_autotest,
235                  "Report" :     None,
236                 },
237                 {
238                  "Name" :       "Byte order autotest",
239                  "Command" :    "byteorder_autotest",
240                  "Func" :       default_autotest,
241                  "Report" :     None,
242                 },
243                 {
244                  "Name" :       "TAILQ autotest",
245                  "Command" :    "tailq_autotest",
246                  "Func" :       default_autotest,
247                  "Report" :     None,
248                 },
249                 {
250                  "Name" :       "Command-line autotest",
251                  "Command" :    "cmdline_autotest",
252                  "Func" :       default_autotest,
253                  "Report" :     None,
254                 },
255                 {
256                  "Name" :       "Interrupts autotest",
257                  "Command" :    "interrupt_autotest",
258                  "Func" :       default_autotest,
259                  "Report" :     None,
260                 },
261         ]
262 },
263 {
264         "Prefix":       "group_6",
265         "Memory" :      all_sockets(588),
266         "Tests" :       
267         [
268                 {
269                  "Name" :       "Function reentrancy autotest",
270                  "Command" :    "func_reentrancy_autotest",
271                  "Func" :       default_autotest,
272                  "Report" :     None,
273                 },
274                 {
275                  "Name" :       "Mempool autotest",
276                  "Command" :    "mempool_autotest",
277                  "Func" :       default_autotest,
278                  "Report" :     None,
279                 },
280                 {
281                  "Name" :       "Atomics autotest",
282                  "Command" :    "atomic_autotest",
283                  "Func" :       default_autotest,
284                  "Report" :     None,
285                 },
286                 {
287                  "Name" :       "Prefetch autotest",
288                  "Command" :    "prefetch_autotest",
289                  "Func" :       default_autotest,
290                  "Report" :     None,
291                 },
292         ]
293 },
294 {
295         "Prefix" :      "group_7",
296         "Memory" :      "400",
297         "Tests" :
298         [
299                 {
300                  "Name" :       "Access list control autotest",
301                  "Command" :    "acl_autotest",
302                  "Func" :       default_autotest,
303                  "Report" :     None,
304                 },
305                 {
306                  "Name" :       "Pattern match autotest",
307                  "Command" :    "pm_autotest",
308                  "Func" :       default_autotest,
309                  "Report" :     None,
310                 },
311         ]
312 },
313 ]
314
315 # tests that should not be run when any other tests are running
316 non_parallel_test_group_list = [
317
318 {
319         "Prefix":       "mempool_perf",
320         "Memory" :      all_sockets(256),
321         "Tests" :       
322         [
323                 {
324                  "Name" :       "Cycles autotest",
325                  "Command" :    "cycles_autotest",
326                  "Func" :       default_autotest,
327                  "Report" :     None,
328                 },
329                 {
330                  "Name" :       "Mempool performance autotest",
331                  "Command" :    "mempool_perf_autotest",
332                  "Func" :       default_autotest,
333                  "Report" :     None,
334                 },
335         ]
336 },
337 {
338         "Prefix":       "memcpy_perf",
339         "Memory" :      all_sockets(512),
340         "Tests" :       
341         [
342                 {
343                  "Name" :       "Memcpy performance autotest",
344                  "Command" :    "memcpy_perf_autotest",
345                  "Func" :       default_autotest,
346                  "Report" :     None,
347                 },
348         ]
349 },
350 {
351         "Prefix":       "hash_perf",
352         "Memory" :      all_sockets(512),
353         "Tests" :       
354         [
355                 {
356                  "Name" :       "Hash performance autotest",
357                  "Command" :    "hash_perf_autotest",
358                  "Func" :       default_autotest,
359                  "Report" :     None,
360                 },
361         ]
362 },
363 {
364         "Prefix":       "ring_perf",
365         "Memory" :      all_sockets(512),
366         "Tests" :       
367         [
368                 {
369                  "Name" :       "Ring autotest",
370                  "Command" :    "ring_autotest",
371                  "Func" :       ring_autotest,
372                  "Report" :     None,
373                 },
374         ]
375 },
376
377 ]