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/scripts/pi-stress-test.py | |
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/scripts/pi-stress-test.py')
-rwxr-xr-x | ubuntu/scripts/pi-stress-test.py | 52 |
1 files changed, 52 insertions, 0 deletions
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']) |