runpwtests_exclusive05.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_exclusive05"
  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. # Verify ILB runs in same package as workload.
  43. RC=0
  44. for sched_mc in `seq 1 $max_sched_mc`; do
  45. if [ $sched_mc -eq 2 ]; then
  46. work_load="kernbench"
  47. else
  48. work_load="ebizzy"
  49. fi
  50. pm_ilb_test.py -c $sched_mc -w $work_load
  51. if [ $? -eq 0 ]; then
  52. echo "Test PASS: ILB & workload in same package for" \
  53. "sched_mc=$sched_mc"
  54. else
  55. RC=1
  56. echo "Test FAIL: ILB & workload did not run in same package" \
  57. "for sched_mc=$sched_mc. Ensure CONFIG_NO_HZ is set"
  58. fi
  59. done
  60. if [ $RC -eq 0 ]; then
  61. tst_resm TPASS "ILB & workload test in same package for sched_mc"
  62. else
  63. tst_resm TFAIL "ILB & workload test in same package for sched_mc"
  64. fi
  65. RC=0
  66. for sched_mc in `seq 1 $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 1 $max_sched_smt`; do
  73. pm_ilb_test.py -c $sched_mc -t sched_smt -w $work_load
  74. if [ $? -eq 0 ]; then
  75. echo "Test PASS: ILB & workload in same package for" \
  76. "sched_mc=$sched_mc & sched_smt=$sched_smt"
  77. else
  78. RC=1
  79. echo "Test FAIL: ILB & workload did not execute in" \
  80. "same package for sched_mc=$sched_mc &" \
  81. "sched_smt=$sched_smt. Ensure CONFIG_NO_HZ is set"
  82. fi
  83. done
  84. done
  85. if [ $RC -eq 0 ]; then
  86. tst_resm TPASS "ILB & workload test in same package for" \
  87. "sched_mc & sched_smt"
  88. else
  89. tst_resm TFAIL "ILB & workload test in same package for" \
  90. "sched_mc & sched_smt"
  91. fi
  92. tst_exit