Amit Daniel Kachhap | e9e5010 | 2012-03-26 16:38:23 +0530 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # |
| 3 | # PM-QA validation test suite for the power management on Linux |
| 4 | # |
| 5 | # Copyright (C) 2011, Linaro Limited. |
| 6 | # |
| 7 | # This program is free software; you can redistribute it and/or |
| 8 | # modify it under the terms of the GNU General Public License |
| 9 | # as published by the Free Software Foundation; either version 2 |
| 10 | # of the License, or (at your option) any later version. |
| 11 | # |
| 12 | # This program is distributed in the hope that it will be useful, |
| 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | # GNU General Public License for more details. |
| 16 | # |
| 17 | # You should have received a copy of the GNU General Public License |
| 18 | # along with this program; if not, write to the Free Software |
| 19 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
| 20 | # |
| 21 | # Contributors: |
| 22 | # Amit Daniel <amit.kachhap@linaro.org> (Samsung Electronics) |
| 23 | # - initial API and implementation |
| 24 | # |
| 25 | |
| 26 | # URL : https://wiki.linaro.org/WorkingGroups/PowerManagement/Doc/QA/Scripts#thermal_03 |
| 27 | |
| 28 | source ../include/functions.sh |
| 29 | source ../include/thermal_functions.sh |
| 30 | |
| 31 | CPU_HEAT_BIN=../utils/heat_cpu |
| 32 | GPU_HEAT_BIN=glmark2 |
| 33 | |
| 34 | check_temperature_change() { |
| 35 | local dirpath=$THERMAL_PATH/$1 |
| 36 | local zone_name=$1 |
| 37 | shift 1 |
| 38 | |
| 39 | local cpu_pid=0 |
| 40 | local gpu_pid=0 |
| 41 | local init_temp=$(cat $dirpath/temp) |
| 42 | $CPU_HEAT_BIN & |
| 43 | cpu_pid=$(ps | grep heat_cpu| awk '{print $1}') |
| 44 | check "start cpu heat binary" "test $cpu_pid -ne 0" |
| 45 | |
| 46 | $GPU_HEAT_BIN & |
| 47 | gpu_pid=$(ps | grep $GPU_HEAT_BIN| awk '{print $1}') |
| 48 | check "start gpu heat binary" "test $gpu_pid -ne 0" |
| 49 | sleep 5 |
| 50 | local final_temp=$(cat $dirpath/temp) |
Amit Daniel Kachhap | 1fe389c | 2012-04-04 15:14:38 +0530 | [diff] [blame^] | 51 | if [ $cpu_pid != 0 ]; then |
Amit Daniel Kachhap | e9e5010 | 2012-03-26 16:38:23 +0530 | [diff] [blame] | 52 | kill -9 $cpu_pid |
| 53 | fi |
Amit Daniel Kachhap | 1fe389c | 2012-04-04 15:14:38 +0530 | [diff] [blame^] | 54 | if [ $gpu_pid != 0 ]; then |
Amit Daniel Kachhap | e9e5010 | 2012-03-26 16:38:23 +0530 | [diff] [blame] | 55 | kill -9 $gpu_pid |
| 56 | fi |
| 57 | check "temperature variation with load" "test $final_temp -gt $init_temp" |
| 58 | } |
| 59 | |
| 60 | for_each_thermal_zone check_temperature_change |