1#! /bin/sh 2# 3# Copyright (c) International Business Machines Corp., 2001 4# Author: Nageswara R Sastry <nasastry@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 21export TCID="Power_Management06" 22export TST_TOTAL=1 23 24. test.sh 25. pm_include.sh 26 27test_timer_migration() { 28 valid_input="0 1" 29 invalid_input="3 4 5 6 7 8 a abcefg x1999 xffff -1 -00000 30 2000000000000000000000000000000000000000000000000000000000000000000000 31 ox324 -0xfffffffffffffffffffff" 32 test_file="/proc/sys/kernel/timer_migration" 33 if [ ! -f ${test_file} ] ; then 34 tst_brkm TBROK "MISSING_FILE: missing file ${test_file}" 35 fi 36 37 RC=0 38 echo "${0}: ---Valid test cases---" 39 check_input "${valid_input}" valid $test_file 40 RC=$? 41 echo "${0}: ---Invalid test cases---" 42 check_input "${invalid_input}" invalid $test_file 43 RC=$(( RC | $? )) 44 return $RC 45} 46 47# Checking test environment 48check_kervel_arch 49 50tst_kvercmp 2 6 31; rc=$? 51if [ $rc -eq 1 -o $rc -eq 2 ] ; then 52 timer_migr_support_compatible=0 53else 54 timer_migr_support_compatible=1 55fi 56 57if [ $timer_migr_support_compatible -eq 1 ]; then 58 tst_brkm TCONF "Kernel version does not support Timer migration" 59else 60 if [ ! -f /proc/sys/kernel/timer_migration ]; then 61 tst_brkm TBROK "Timer migration interface missing" 62 fi 63fi 64 65if test_timer_migration ; then 66 tst_resm TPASS "Timer Migration interface test" 67else 68 tst_resm TFAIL "Timer migration interface test" 69fi 70 71tst_exit 72