runpwtests04.sh 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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_Management04"
  21. export TST_TOTAL=1
  22. . test.sh
  23. . pm_include.sh
  24. check_cpuidle_sysfs_files() {
  25. RC=0
  26. if [ -d /sys/devices/system/cpu/cpuidle ] ; then
  27. for files in current_governor_ro current_driver
  28. do
  29. cat /sys/devices/system/cpu/cpuidle/${files} \
  30. >/dev/null 2>&1
  31. if [ $? -ne 0 ] ; then
  32. echo "${0}: FAIL: cat ${files}"
  33. RC=1
  34. fi
  35. done
  36. fi
  37. if [ ${RC} -eq 0 ] ; then
  38. echo "${0}: PASS: Checking cpu idle sysfs files"
  39. else
  40. echo "${0}: FAIL: Checking cpu idle sysfs files"
  41. fi
  42. return $RC
  43. }
  44. # Checking test environment
  45. check_kervel_arch
  46. # Checking cpuidle sysfs interface files
  47. if check_cpuidle_sysfs_files ; then
  48. tst_resm TPASS "CPUIDLE sysfs tests passed"
  49. else
  50. tst_resm TFAIL "CPUIDLE sysfs tests failed"
  51. fi
  52. tst_exit