1#! /bin/sh 2# 3# Copyright (c) International Business Machines Corp., 2001 4# Author: Nageswara R Sastry <[email protected]> 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_arch 49 50timer_migr_support_compatible=0 51 52if [ $timer_migr_support_compatible -eq 1 ]; then 53 tst_brkm TCONF "Kernel version does not support Timer migration" 54else 55 if [ ! -f /proc/sys/kernel/timer_migration ]; then 56 tst_brkm TBROK "Timer migration interface missing" 57 fi 58fi 59 60if test_timer_migration ; then 61 tst_resm TPASS "Timer Migration interface test" 62else 63 tst_resm TFAIL "Timer migration interface test" 64fi 65 66tst_exit 67