runpwtests05.sh 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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_Management05"
  21. export TST_TOTAL=2
  22. . test.sh
  23. . pm_include.sh
  24. # Checking test environment
  25. check_kervel_arch
  26. if tst_kvcmp -gt "2.6.29"; then
  27. max_sched_mc=2
  28. max_sched_smt=2
  29. else
  30. max_sched_mc=1
  31. max_sched_smt=1
  32. fi
  33. tst_require_cmds python3
  34. if ! grep sched_debug -qw /proc/cmdline ; then
  35. tst_brkm TCONF "Kernel cmdline parameter 'sched_debug' needed," \
  36. "CPU Consolidation test cannot run"
  37. fi
  38. hyper_threaded=$(is_hyper_threaded)
  39. if [ ! -f /sys/devices/system/cpu/sched_mc_power_savings \
  40. -o $hyper_threaded -ne 0 ] ; then
  41. tst_brkm TCONF "Required kernel configuration for SCHED_MC" \
  42. "NOT set, or sched_mc_power_savings interface in system" \
  43. "which is not hyper-threaded"
  44. fi
  45. # sched_domain test
  46. echo "max sched mc $max_sched_mc"
  47. RC=0
  48. for sched_mc in `seq 0 $max_sched_mc`; do
  49. pm_sched_domain.py -c $sched_mc; ret=$?
  50. analyze_sched_domain_result $sched_mc $ret; RC=$?
  51. done
  52. if [ $RC -eq 0 ]; then
  53. tst_resm TPASS "Sched_domain test for sched_mc"
  54. else
  55. tst_resm TFAIL "Sched_domain test for sched_mc"
  56. fi
  57. # Testcase to validate sched_domain tree
  58. RC=0
  59. for sched_mc in `seq 0 $max_sched_mc`; do
  60. pm_get_sched_values sched_smt; max_sched_smt=$?
  61. for sched_smt in `seq 0 $max_sched_smt`; do
  62. pm_sched_domain.py -c $sched_mc -t $sched_smt; ret=$?
  63. analyze_sched_domain_result $sched_mc $ret $sched_smt; RC=$?
  64. done
  65. done
  66. if [ $RC -eq 0 ]; then
  67. tst_resm TPASS "Sched_domain test for sched_mc & sched_smt"
  68. else
  69. tst_resm TFAIL "Sched_domain test for sched_mc & sched_smt"
  70. fi
  71. tst_exit