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