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