summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAníbal Limón <anibal.limon@linaro.org>2018-05-07 14:52:49 -0500
committerMilosz Wasilewski <milosz.wasilewski@linaro.org>2018-05-09 15:57:24 +0000
commit2e73a67aab0ef019c830cae18b177bff41de71da (patch)
tree8fe682c52ff201bfcbac7f6ced8cc563d6d6120d
parent2d1650408af7ef16a5c114a158f422dd08fc030c (diff)
automated/linux/ptest: Add support for -e option
The -e option works to exclude certain ptests for execution. Change-Id: I644e45a8ab15ecc7712f04547cab3dcd61bb961f Signed-off-by: Aníbal Limón <anibal.limon@linaro.org>
-rwxr-xr-xautomated/linux/ptest/ptest.py15
-rw-r--r--automated/linux/ptest/ptest.yaml3
2 files changed, 15 insertions, 3 deletions
diff --git a/automated/linux/ptest/ptest.py b/automated/linux/ptest/ptest.py
index ee38876..13feb4d 100755
--- a/automated/linux/ptest/ptest.py
+++ b/automated/linux/ptest/ptest.py
@@ -61,9 +61,13 @@ def get_available_ptests(ptest_dir):
return ptests
-def filter_ptests(ptests, requested_ptests):
+def filter_ptests(ptests, requested_ptests, exclude):
filter_ptests = []
+ for ptest in exclude:
+ if ptest in ptests:
+ ptests.remove(ptest)
+
if not requested_ptests:
return ptests
@@ -100,6 +104,8 @@ def main():
add_help=False)
parser.add_argument('-t', '--tests', action='store', nargs='*',
help='Ptests to run')
+ parser.add_argument('-e', '--exclude', action='store', nargs='*',
+ help='Ptests to exclude')
parser.add_argument('-d', '--ptest-dir',
help='Directory where ptests are stored (optional)',
action='store')
@@ -129,8 +135,13 @@ def main():
if args.tests:
tests = [x for x in args.tests if x]
+ # filter empty strings caused by -e ""
+ exclude = []
+ if args.exclude:
+ exclude = [e for e in args.exclude if e]
+
required_ptests = dict.fromkeys(tests, False)
- ptests_to_run = filter_ptests(ptests, required_ptests)
+ ptests_to_run = filter_ptests(ptests, required_ptests, exclude)
for ptest_name in ptests_to_run:
check_ptest(ptest_dir, ptest_name, args.output_log)
diff --git a/automated/linux/ptest/ptest.yaml b/automated/linux/ptest/ptest.yaml
index 703358a..854af0b 100644
--- a/automated/linux/ptest/ptest.yaml
+++ b/automated/linux/ptest/ptest.yaml
@@ -16,9 +16,10 @@ metadata:
params:
TESTS: ""
+ EXCLUDE: ""
run:
steps:
- cd ./automated/linux/ptest
- - ./ptest.py -o ./result.txt -t ${TESTS}
+ - ./ptest.py -o ./result.txt -t ${TESTS} -e ${EXCLUDE}
- ../../utils/send-to-lava.sh ./result.txt