runpwtests06.sh 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. export TCID="Power_Management06"
  21. export TST_TOTAL=1
  22. . test.sh
  23. . pm_include.sh
  24. test_timer_migration() {
  25. valid_input="0 1"
  26. invalid_input="3 4 5 6 7 8 a abcefg x1999 xffff -1 -00000
  27. 2000000000000000000000000000000000000000000000000000000000000000000000
  28. ox324 -0xfffffffffffffffffffff"
  29. test_file="/proc/sys/kernel/timer_migration"
  30. if [ ! -f ${test_file} ] ; then
  31. tst_brkm TBROK "MISSING_FILE: missing file ${test_file}"
  32. fi
  33. RC=0
  34. echo "${0}: ---Valid test cases---"
  35. check_input "${valid_input}" valid $test_file
  36. RC=$?
  37. echo "${0}: ---Invalid test cases---"
  38. check_input "${invalid_input}" invalid $test_file
  39. RC=$(( RC | $? ))
  40. return $RC
  41. }
  42. # Checking test environment
  43. check_kervel_arch
  44. if tst_kvcmp -ge "2.6.31"; then
  45. timer_migr_support_compatible=0
  46. else
  47. timer_migr_support_compatible=1
  48. fi
  49. if [ $timer_migr_support_compatible -eq 1 ]; then
  50. tst_brkm TCONF "Kernel version does not support Timer migration"
  51. else
  52. if [ ! -f /proc/sys/kernel/timer_migration ]; then
  53. tst_brkm TBROK "Timer migration interface missing"
  54. fi
  55. fi
  56. if test_timer_migration ; then
  57. tst_resm TPASS "Timer Migration interface test"
  58. else
  59. tst_resm TFAIL "Timer migration interface test"
  60. fi
  61. tst_exit