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 21export TCID="Power_Management_exclusive02" 22export TST_TOTAL=1 23 24. test.sh 25. pm_include.sh 26 27# Checking test environment 28check_kervel_arch 29 30if tst_kvcmp -gt "2.6.29"; then 31 max_sched_smt=2 32else 33 max_sched_smt=1 34fi 35 36tst_test_cmds python 37 38hyper_threaded=$(is_hyper_threaded) 39multi_socket=$(is_multi_socket) 40multi_core=$(is_multi_core) 41if [ $hyper_threaded -ne 0 -o $multi_socket -ne 0 \ 42 -o $multi_core -eq 0 ]; then 43 tst_brkm TCONF "System is a multi core but not multi" \ 44 "socket & hyper-threaded" 45fi 46 47#Testcase to validate consolidation at core level 48RC=0 49for sched_smt in `seq 0 $max_sched_smt`; do 50 if [ $sched_smt -eq 2 ]; then 51 work_load="kernbench" 52 else 53 work_load="ebizzy" 54 fi 55 sched_smt_pass_cnt=0 56 stress="thread" 57 for repeat_test in `seq 1 10`; do 58 if pm_cpu_consolidation.py -t $sched_smt -w $work_load \ 59 -s $stress; then 60 : $(( sched_smt_pass_cnt += 1 )) 61 fi 62 done 63 analyze_core_consolidation_result $sched_smt \ 64 $sched_smt_pass_cnt; RC=$? 65done 66if [ $RC -eq 0 ]; then 67 tst_resm TPASS "Consolidation test at core level for sched_smt" 68else 69 tst_resm TFAIL "Consolidation test at core level for sched_smt" 70fi 71 72tst_exit 73