]> git.proxmox.com Git - ceph.git/blame - ceph/src/spdk/dpdk/test/test/autotest.py
update download target update for octopus release
[ceph.git] / ceph / src / spdk / dpdk / test / test / autotest.py
CommitLineData
11fdf7f2
TL
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
6from __future__ import print_function
7import autotest_data
8import autotest_runner
9import sys
10
11
12def usage():
13 print("Usage: autotest.py [test app|test iso image] ",
14 "[target] [whitelist|-blacklist]")
15
16if len(sys.argv) < 3:
17 usage()
18 sys.exit(1)
19
20target = sys.argv[2]
21
22test_whitelist = None
23test_blacklist = None
24
25# get blacklist/whitelist
26if 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
35cmdline = "%s -c f -n 4" % (sys.argv[1])
36
37print(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
41n_processes = 1 if "bsdapp" in target else 4
42
43runner = autotest_runner.AutotestRunner(cmdline, target, test_blacklist,
44 test_whitelist, n_processes)
45
46runner.parallel_tests = autotest_data.parallel_test_list[:]
47runner.non_parallel_tests = autotest_data.non_parallel_test_list[:]
48
49num_fails = runner.run_all_tests()
50
51sys.exit(num_fails)