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_exclusive05"
22export TST_TOTAL=2
23
24. test.sh
25. pm_include.sh
26
27# Checking test environment
28check_kervel_arch
29
30tst_kvercmp 2 6 29; rc=$?
31if [ $rc -eq 2 ] ; then
32	max_sched_mc=2
33	max_sched_smt=2
34else
35	max_sched_mc=1
36	max_sched_smt=1
37fi
38
39tst_check_cmds python
40
41hyper_threaded=$(is_hyper_threaded)
42multi_socket=$(is_multi_socket)
43multi_core=$(is_multi_core)
44if [ $multi_socket -ne 0 -o $multi_core -ne 0 -o \
45	$hyper_threaded -ne 0 ]; then
46	tst_brkm TCONF "System is not a multi socket & multi core" \
47		"& hyper-threaded"
48fi
49
50# Verify ILB runs in same package as workload.
51RC=0
52for sched_mc in `seq 1 $max_sched_mc`; do
53	if [ $sched_mc -eq 2 ]; then
54		work_load="kernbench"
55	else
56		work_load="ebizzy"
57	fi
58
59	pm_ilb_test.py -c $sched_mc -w $work_load
60	if [ $? -eq 0 ]; then
61		echo "Test PASS: ILB & workload in same package for" \
62			"sched_mc=$sched_mc"
63	else
64		RC=1
65		echo "Test FAIL: ILB & workload did not run in same package" \
66			"for sched_mc=$sched_mc. Ensure CONFIG_NO_HZ is set"
67	fi
68done
69if [ $RC -eq 0 ]; then
70	tst_resm TPASS "ILB & workload test in same package for sched_mc"
71else
72	tst_resm TFAIL "ILB & workload test in same package for sched_mc"
73fi
74
75RC=0
76for sched_mc in `seq 1 $max_sched_mc`; do
77	if [ $sched_mc -eq 2 ]; then
78		work_load="kernbench"
79	else
80		work_load="ebizzy"
81	fi
82	for sched_smt in `seq 1 $max_sched_smt`; do
83		pm_ilb_test.py -c $sched_mc -t sched_smt -w $work_load
84		if [ $? -eq 0 ]; then
85			echo "Test PASS: ILB & workload in same package for" \
86				"sched_mc=$sched_mc & sched_smt=$sched_smt"
87		else
88			RC=1
89			echo "Test FAIL: ILB & workload did not execute in" \
90				"same package for sched_mc=$sched_mc &" \
91				"sched_smt=$sched_smt. Ensure CONFIG_NO_HZ is set"
92		fi
93	done
94done
95if [ $RC -eq 0 ]; then
96	tst_resm TPASS "ILB & workload test in same package for" \
97		"sched_mc & sched_smt"
98else
99	tst_resm TFAIL "ILB & workload test in same package for" \
100		"sched_mc & sched_smt"
101fi
102
103tst_exit
104