test/eal: set memory channel config only in dedicated test
[dpdk.git] / app / test / autotest.py
1 #!/usr/bin/env python
2 # SPDX-License-Identifier: BSD-3-Clause
3 # Copyright(c) 2010-2014 Intel Corporation
4
5 # Script that uses either test app or qemu controlled by python-pexpect
6 from __future__ import print_function
7 import autotest_data
8 import autotest_runner
9 import sys
10
11
12 def usage():
13     print("Usage: autotest.py [test app|test iso image] ",
14           "[target] [whitelist|-blacklist]")
15
16 if len(sys.argv) < 3:
17     usage()
18     sys.exit(1)
19
20 target = sys.argv[2]
21
22 test_whitelist = None
23 test_blacklist = None
24
25 # get blacklist/whitelist
26 if len(sys.argv) > 3:
27     testlist = sys.argv[3].split(',')
28     testlist = [test.lower() for test in testlist]
29     if testlist[0].startswith('-'):
30         testlist[0] = testlist[0].lstrip('-')
31         test_blacklist = testlist
32     else:
33         test_whitelist = testlist
34
35 cmdline = "%s -c f" % (sys.argv[1])
36
37 print(cmdline)
38
39 # how many workers to run tests with. FreeBSD doesn't support multiple primary
40 # processes, so make it 1, otherwise make it 4. ignored for non-parallel tests
41 n_processes = 1 if "bsd" in target else 4
42
43 runner = autotest_runner.AutotestRunner(cmdline, target, test_blacklist,
44                                         test_whitelist, n_processes)
45
46 runner.parallel_tests = autotest_data.parallel_test_list[:]
47 runner.non_parallel_tests = autotest_data.non_parallel_test_list[:]
48
49 num_fails = runner.run_all_tests()
50
51 sys.exit(num_fails)