test_controllers.sh revision 3c744274b453bf857361a94a6950422215c529a9
1#!/bin/bash 2#usage ./test_controllers.sh 3################################################################################## 4# Copyright (c) International Business Machines Corp., 2007 # 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, # 12# but WITHOUT ANY WARRANTY; without even the implied warranty of # 13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See # 14# the GNU General Public License 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 # 18# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # 19# # 20################################################################################## 21# Name Of File: test_controllers.sh # 22# # 23# Description: # 24# This file runs the tests for resource management ie to test cpu # 25# controller and memory controller. (for now cpu controller only) # 26# # 27# Author: Sudhir Kumar <sudhirkumarmalik@In.ibm.com> # 28# # 29# History: # 30# # 31# DATE NAME EMAIL DESC # 32# # 33# 20/12/07 Sudhir Kumar <sudhirkumarmalik@in.ibm.com> Created this test # 34# # 35################################################################################## 36 37if [ -f /proc/cgroups ] 38then 39 CPU_CONTROLLER=`grep -w cpu /proc/cgroups | cut -f1`; 40 if [ "$CPU_CONTROLLER" = "cpu" ] 41 then 42 $LTPROOT/testcases/bin/run_cpuctl_test.sh 1; 43 $LTPROOT/testcases/bin/run_cpuctl_test.sh 2; 44 $LTPROOT/testcases/bin/run_cpuctl_test.sh 3; 45 $LTPROOT/testcases/bin/run_cpuctl_test.sh 4; 46 $LTPROOT/testcases/bin/run_cpuctl_stress_test.sh 1; 47 $LTPROOT/testcases/bin/run_cpuctl_stress_test.sh 2; 48 $LTPROOT/testcases/bin/run_cpuctl_stress_test.sh 3; 49 $LTPROOT/testcases/bin/run_cpuctl_stress_test.sh 4; 50 else 51 echo "CONTROLLERS TESTCASES: WARNING"; 52 echo "Kernel does not support for cpu controller"; 53 echo "Skipping all controllers testcases...."; 54 fi 55else 56 echo "CONTROLLERS TESTCASES: WARNING" 57 echo "Kernel does not support for control groups"; 58 echo "Skipping all controllers testcases...."; 59fi 60 61exit 0; 62