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