diff options
author | Chase Qi <chase.qi@linaro.org> | 2014-12-03 11:57:35 +0800 |
---|---|---|
committer | Milosz Wasilewski <milosz.wasilewski@linaro.org> | 2014-12-08 13:34:27 +0000 |
commit | e1558f50f751ee1cbb087abf0b2057384c809bb4 (patch) | |
tree | 6888c4bd3e5b420d5fafe6d4fbadb9f5aef01eeb /ubuntu | |
parent | 0ea91622be261d49f8839ceb1da0e1a66460bc01 (diff) |
Ubuntu: Add PI stress test
pi_stress is a program used to stress the priority-inheritance code
paths for POSIX mutexes, in both the Linux kernel and the C library.
Signed-off by: Chase Qi <chase.qi@linaro.org>
Change-Id: I7585b3d74e4feacd0c008f4e7ed78628dbc08a69
Diffstat (limited to 'ubuntu')
-rw-r--r-- | ubuntu/pi-stress-test.yaml | 41 | ||||
-rwxr-xr-x | ubuntu/scripts/pi-stress-test.py | 52 |
2 files changed, 93 insertions, 0 deletions
diff --git a/ubuntu/pi-stress-test.yaml b/ubuntu/pi-stress-test.yaml new file mode 100644 index 0000000..f2a109d --- /dev/null +++ b/ubuntu/pi-stress-test.yaml @@ -0,0 +1,41 @@ +metadata: + format: Lava-Test Test Definition 1.0 + name: pi-stress-test + description: "Stress test for POSIX Priority Inheritance mutexes" + maintainer: + - chase.qi@linaro.org + os: + - ubuntu + scope: + - functional + - preempt-rt + devices: + - panda + - panda-es + - arndale + - vexpress-a9 + - vexpress-tc2 + - beaglebone-black + - d01 + - rtsm_fvp_base-aemv8a + environment: + - lava-test-shell + +install: + deps: + - rt-tests +params: + # Length of the test run in seconds + DURATION: 300 + # The number of inversion groups to run. By default pi_stress will detect the number of + # processors and determine the number of inversion groups automatically. + GROUP: 'default' + # Set MLOCKALL to ture to lock current and future memory + MLOCKALL: 'true' + # Set RR to true if you need use SCHED_RR for test threads. The + # default is to run the inversion threads as SCHED_FIFO + RR: 'false' + +run: + steps: + - ./ubuntu/scripts/pi-stress-test.py $DURATION $GROUP $MLOCKALL $RR diff --git a/ubuntu/scripts/pi-stress-test.py b/ubuntu/scripts/pi-stress-test.py new file mode 100755 index 0000000..dc2fdb7 --- /dev/null +++ b/ubuntu/scripts/pi-stress-test.py @@ -0,0 +1,52 @@ +#!/usr/bin/env python +# +# PI stress test case for Linux Linaro ubuntu +# +# Copyright (C) 2012 - 2014, Linaro Limited. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# Author: Chase Qi <chase.qi@linaro.org> +# + +import sys +import signal +from subprocess import call + +DURATION = sys.argv[1] +GROUP = sys.argv[2] +MLOCKALL = sys.argv[3] +RR = sys.argv[4] + +# Determine PI stress test options +pi_stress_command = ['pi_stress', '--duration', DURATION] +if GROUP != 'default': + pi_stress_command.append('--groups') + pi_stress_command.append(GROUP) +if MLOCKALL == 'true': + pi_stress_command.append('--mlockall') +if RR != 'false': + pi_stress_command.append('--rr') + +# Trap and ignore SIGTERM if terminate signal appeared +signal.signal(signal.SIGTERM, signal.SIG_IGN) + +# Run PI stress test +print 'pi_stress_command is:' +print ' '.join(pi_stress_command) +if call(pi_stress_command) == 0: + call(['lava-test-case', 'pi-stress-test', '--result', 'pass']) +else: + call(['lava-test-case', 'pi-stress-test', '--result', 'fail']) |