runpwtests_exclusive01.sh 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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_Management_exclusive01"
  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. hyper_threaded=$(is_hyper_threaded)
  35. multi_socket=$(is_multi_socket)
  36. multi_core=$(is_multi_core)
  37. if [ $multi_socket -ne 0 -o $multi_core -ne 0 -o \
  38. $hyper_threaded -ne 0 ]; then
  39. tst_brkm TCONF "System is not a multi socket & multi core" \
  40. "& hyper-threaded"
  41. fi
  42. # Test CPU consolidation
  43. RC=0
  44. for sched_mc in `seq 0 $max_sched_mc`; do
  45. sched_mc_pass_cnt=0
  46. if [ $sched_mc -eq 2 ]; then
  47. work_load="kernbench"
  48. else
  49. work_load="ebizzy"
  50. fi
  51. for repeat_test in `seq 1 10`; do
  52. #Testcase to validate CPU consolidation for sched_mc
  53. if pm_cpu_consolidation.py -c $sched_mc -w $work_load ; then
  54. : $(( sched_mc_pass_cnt += 1 ))
  55. fi
  56. done
  57. analyze_package_consolidation_result $sched_mc \
  58. $sched_mc_pass_cnt; RC=$?
  59. done
  60. if [ $RC -eq 0 ]; then
  61. tst_resm TPASS "CPU consolidation test for sched_mc"
  62. else
  63. tst_resm TFAIL "CPU consolidation test for sched_mc"
  64. fi
  65. RC=0
  66. for sched_mc in `seq 0 $max_sched_mc`; do
  67. if [ $sched_mc -eq 2 ]; then
  68. work_load="kernbench"
  69. else
  70. work_load="ebizzy"
  71. fi
  72. for sched_smt in `seq 0 $max_sched_smt`; do
  73. sched_mc_smt_pass_cnt=0
  74. for repeat_test in `seq 1 10`; do
  75. # Testcase to validate CPU consolidation for
  76. # for sched_mc & sched_smt with stress=50%
  77. if pm_cpu_consolidation.py -c $sched_mc -t $sched_smt \
  78. -w $work_load ; then
  79. : $(( sched_mc_smt_pass_cnt += 1 ))
  80. fi
  81. done
  82. analyze_package_consolidation_result $sched_mc \
  83. $sched_mc_smt_pass_cnt $sched_smt; RC=$?
  84. done
  85. done
  86. if [ $RC -eq 0 ]; then
  87. tst_resm TPASS "CPU consolidation test for sched_mc &" \
  88. "sched_smt with stress=50%"
  89. else
  90. tst_resm TFAIL "CPU consolidation test for sched_mc &" \
  91. "sched_smt with stress=50%"
  92. fi
  93. tst_exit