runpwtests_exclusive02.sh 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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_exclusive02"
  21. export TST_TOTAL=1
  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_smt=2
  28. else
  29. max_sched_smt=1
  30. fi
  31. tst_require_cmds python3
  32. hyper_threaded=$(is_hyper_threaded)
  33. multi_socket=$(is_multi_socket)
  34. multi_core=$(is_multi_core)
  35. if [ $hyper_threaded -ne 0 -o $multi_socket -ne 0 \
  36. -o $multi_core -eq 0 ]; then
  37. tst_brkm TCONF "System is a multi core but not multi" \
  38. "socket & hyper-threaded"
  39. fi
  40. #Testcase to validate consolidation at core level
  41. RC=0
  42. for sched_smt in `seq 0 $max_sched_smt`; do
  43. if [ $sched_smt -eq 2 ]; then
  44. work_load="kernbench"
  45. else
  46. work_load="ebizzy"
  47. fi
  48. sched_smt_pass_cnt=0
  49. stress="thread"
  50. for repeat_test in `seq 1 10`; do
  51. if pm_cpu_consolidation.py -t $sched_smt -w $work_load \
  52. -s $stress; then
  53. : $(( sched_smt_pass_cnt += 1 ))
  54. fi
  55. done
  56. analyze_core_consolidation_result $sched_smt \
  57. $sched_smt_pass_cnt; RC=$?
  58. done
  59. if [ $RC -eq 0 ]; then
  60. tst_resm TPASS "Consolidation test at core level for sched_smt"
  61. else
  62. tst_resm TFAIL "Consolidation test at core level for sched_smt"
  63. fi
  64. tst_exit