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_Management01" 22 export TST_TOTAL=1 23 24 . test.sh 25 . pm_include.sh 26 27 test_sched_mc() { 28 get_kernel_version 29 get_valid_input $kernel_version 30 31 invalid_input="3 4 5 6 7 8 a abcefg x1999 xffff -1 -00000 32 2000000000000000000000000000000000000000000000000000000000000000000 33 ox324 -0xfffffffffffffffffffff" 34 test_file="/sys/devices/system/cpu/sched_mc_power_savings" 35 if [ ! -f ${test_file} ] ; then 36 tst_brkm TBROK "MISSING_FILE: missing file ${test_file}" 37 fi 38 39 RC=0 40 echo "${0}: ---Valid test cases---" 41 check_input "${valid_input}" valid $test_file 42 RC=$? 43 echo "${0}: ---Invalid test cases---" 44 check_input "${invalid_input}" invalid $test_file 45 RC=$(( RC | $? )) 46 return $RC 47 } 48 49 # Checking test environment 50 check_kervel_arch 51 52 # Checking sched_mc sysfs interface 53 multi_socket=$(is_multi_socket) 54 multi_core=$(is_multi_core) 55 if [ ! -f /sys/devices/system/cpu/sched_mc_power_savings ] ; then 56 tst_brkm TCONF "Required kernel configuration for SCHED_MC" \ 57 "NOT set" 58 else 59 if [ $multi_socket -ne 0 -a $multi_core -ne 0 ] ; then 60 tst_brkm TCONF "sched_mc_power_savings interface in system" \ 61 "which is not a multi socket &(/) multi core" 62 fi 63 fi 64 65 if test_sched_mc ; then 66 tst_resm TPASS "SCHED_MC sysfs tests" 67 else 68 tst_resm TFAIL "SCHED_MC sysfs tests" 69 fi 70 71 tst_exit 72