1 #! /bin/sh 2 # 3 # Copyright (c) International Business Machines Corp., 2001 4 # Author: Nageswara R Sastry <nasastry (at] in.ibm.com> 5 # 6 # This program is free software; you can redistribute it and#or modify 7 # it under the terms of the GNU General Public License as published by 8 # the Free Software Foundation; either version 2 of the License, or 9 # (at your option) any later version. 10 # 11 # This program is distributed in the hope that it will be useful, but 12 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 13 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 # for more details. 15 # 16 # You should have received a copy of the GNU General Public License 17 # along with this program; if not, write to the Free Software Foundation, 18 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 # 20 21 export TCID="Power_Management04" 22 export TST_TOTAL=1 23 24 . test.sh 25 . pm_include.sh 26 27 check_cpuidle_sysfs_files() { 28 RC=0 29 if [ -d /sys/devices/system/cpu/cpuidle ] ; then 30 for files in current_governor_ro current_driver 31 do 32 cat /sys/devices/system/cpu/cpuidle/${files} \ 33 >/dev/null 2>&1 34 if [ $? -ne 0 ] ; then 35 echo "${0}: FAIL: cat ${files}" 36 RC=1 37 fi 38 done 39 fi 40 if [ ${RC} -eq 0 ] ; then 41 echo "${0}: PASS: Checking cpu idle sysfs files" 42 else 43 echo "${0}: FAIL: Checking cpu idle sysfs files" 44 fi 45 return $RC 46 } 47 48 # Checking test environment 49 check_kervel_arch 50 51 # Checking cpuidle sysfs interface files 52 if check_cpuidle_sysfs_files ; then 53 tst_resm TPASS "CPUIDLE sysfs tests passed" 54 else 55 tst_resm TFAIL "CPUIDLE sysfs tests failed" 56 fi 57 58 tst_exit 59