public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Poornima Nayak <mpnayak@linux.vnet.ibm.com>
To: ltp-list@lists.sourceforge.net
Subject: [LTP] [Patch 9/10]Master script modified to cover additional test scenarios
Date: Tue, 30 Jun 2009 20:28:24 +0530	[thread overview]
Message-ID: <20090630145824.11163.54300.sendpatchset@localhost.localdomain> (raw)
In-Reply-To: <20090630145706.11163.54040.sendpatchset@localhost.localdomain>

[Patch 9/10]Master script modified to cover additional test scenarios

Signed-off-by: poornima nayak <mpnayak@linux.vnet.ibm.com>

diff -uprN ltp_orig/testcases/kernel/power_management/runpwtests.sh ltp_patched/testcases/kernel/power_management/runpwtests.sh
--- ltp_orig/testcases/kernel/power_management/runpwtests.sh	2009-06-30 15:04:19.000000000 +0530
+++ ltp_patched/testcases/kernel/power_management/runpwtests.sh	2009-06-30 16:15:18.000000000 +0530
@@ -30,15 +30,18 @@
 #
 
 # Exporting Required variables
-
+echo Are we really executing this ?
 export TST_TOTAL=1
-LTPTMP=${TMP}
+#LTPTMP=${TMP}
 export PATH=${PATH}:.
-export TCID="Power Management"
+export TCID="Power_Management"
 export TST_COUNT=0
+export contacts="mpnayak@linux.vnet.ibm.com"
+export analysis="/proctstat"
 
+YES=0
 #List of reusable functions defined in pm_include.sh
-. pm_include.sh
+. ./pm_include.sh
 
 # Function:     main
 #
@@ -50,158 +53,172 @@ export TST_COUNT=0
 RC=0		#Return status
 
 # Checking required kernel version and architecture
-check_kv_arch; RC=$?
+check_kv_arch
+RC=$?
 if [ $RC -eq 1 ] ; then
-	tst_resm TCONF "Kernel version or Architecture not supported:\
-Not running testcases"
+	tst_resm TCONF "Kernel version or Architecture not supported: Not running testcases"
 	exit 0
 fi
 
-# Checking sched_mc sysfs interface
+is_hyper_threaded; hyper_threaded=$?
+
+#Checking sched_mc sysfs interface
 #check_config.sh config_sched_mc || RC=$?
+TST_COUNT=1
 if [ -f /sys/devices/system/cpu/sched_mc_power_savings ] ; then
 	if test_sched_mc.sh ; then
-		tst_resm TPASS "SCHED_MC sysfs tests passed"
+		tst_resm TPASS "SCHED_MC sysfs tests"
 	else
 		RC=$?
-		tst_resm TFAIL "SCHED_MC sysfs tests failed"
+		tst_resm TFAIL "SCHED_MC sysfs tests"
 	fi
-	# Test CPU consolidation for corresponding sched_mc
-	which python > /dev/null
-	if [ $? -ne 0 ] ; then
-		tst_resm TCONF "Python is not installed, CPU Consoldation\
-		 test not run"
-	else
-		# Test CPU consolidation on hyper-threaded system
-		hyper_threaded=$(is_hyper_threaded)
-		if [ $hyper_threaded -eq 1 ]; then
-			for sched_mc in `seq 0 2`; do
-				for sched_smt in `seq 0 1`; do
-					if [ $sched_smt -eq 0 -a $sched_mc -eq 0 ]; then 
-						continue
-					fi
-					if cpu_consolidation.py -c $sched_mc -t $sched_smt ; then
-						tst_resm TPASS "cpu consolidation sched_mc=$sched_mc,\
- sched_smt=$sched_smt"
-					else
-						RC=$?
-						tst_resm TFAIL "cpu consolidation \
- sched_mc=$sched_mc, sched_smt=$sched_smt"
-					fi
-				done
-			done
-		else
-			# Test CPU consolidation for sched_mc=1 & 2
-			for sched_mc in `seq 1 2`; do
-				if cpu_consolidation.py -c $sched_mc ; then
-					tst_resm TPASS "cpu consolidation test for \
-sched_mc_power set to $sched_mc"
-				else
-					RC=$?
-					tst_resm TFAIL "cpu consolidation test\
- sched_mc_power set to $sched_mc"
-				fi
-			done
-		fi
+else
+    tst_resm TCONF "Required kernel configuration for SCHED_MC NOT set"
+fi
 
-		# Testcase to validate sched_domain tree
-		if [ $hyper_threaded -eq 1 ]; then
-			for sched_mc in `seq 0 2`; do
-                for sched_smt in `seq 0 1`; do
-					if [ $sched_smt -eq 0 -a $sched_mc -eq 0 ]; then
-                        continue
-                    fi
-
-					if sched_domain.py -c $sched_mc -t $sched_smt; then
-						tst_resm TPASS "sched domain test sched_mc=$sched_mc,\
-sched_smt=$sched_smt "
-					else
-						RC=$?
-						tst_resm TFAIL "sched domain test sched_mc=$sched_mc,\
-sched_smt=$sched_smt "
-					fi
-				done
-			done
-		else
-			# Validate CPU level sched domain topology validation
-			for sched_mc in `seq 1 2`; do
-				if sched_domain.py -c $sched_mc ; then
-					tst_resm TPASS "sched domain test for sched_mc=$sched_mc "
-				else
-					RC=$?
-					tst_resm TFAIL "sched domain test for sched_mc=$sched_mc "
-				fi
-			done
-			
-		fi
-	fi
+# Test sched_smt_power_savings interface on HT machines
+((TST_COUNT= $TST_COUNT + 1))
+if [ -f /sys/devices/system/cpu/sched_smt_power_savings ] ; then
+    if test_sched_smt.sh; then
+		tst_resm TPASS "SCHED_SMT sysfs test"
+	else
+		RC=$?
+        tst_resm TFAIL "SCHED_SMT sysfs test"
+    fi
 else
-	tst_resm TCONF "Required kernel configuration for SCHED_MC NOT set"
+    if [ $hyper_threaded -eq $YES ]; then
+		RC=$?
+        tst_resm TFAIL "Required kernel configuration for SCHED_SMT NOT set"
+    else
+        tst_resm TCONF "Required Hyper Threading support for SCHED_SMT test"
+    fi
 fi
+
 # Checking cpufreq sysfs interface files
 #check_config.sh config_cpu_freq || RC=$?
+((TST_COUNT= $TST_COUNT + 1))
 if [ -d /sys/devices/system/cpu/cpu0/cpufreq ] ; then
-	if check_cpufreq_sysfs_files.sh ; then
-		tst_resm TPASS "CPUFREQ sysfs tests "
+    if check_cpufreq_sysfs_files.sh; then
+		tst_resm TPASS "CPUFREQ sysfs tests"
 	else
 		RC=$?
 		tst_resm TFAIL "CPUFREQ sysfs tests "
 	fi
 
-	# Changing governors
-	if change_govr.sh ; then
+    # Changing governors
+	((TST_COUNT= $TST_COUNT + 1))
+	if change_govr.sh; then
 		tst_resm TPASS "Changing governors "
 	else
 		RC=$?
 		tst_resm TFAIL "Changing governors "
 	fi
 
-	# Changing frequencies
-	if change_freq.sh ; then
+    # Changing frequencies
+	((TST_COUNT= $TST_COUNT + 1))
+    if change_freq.sh ; then
 		tst_resm TPASS "Changing frequncies "
 	else
 		RC=$?
-		tst_resm TFAIL "Changing frequncies "
-	fi
+        tst_resm TFAIL "Changing frequncies "
+    fi
 
-	# Loading and Unloading governor related kernel modules
-	if pwkm_load_unload.sh ; then
+    # Loading and Unloading governor related kernel modules
+	((TST_COUNT= $TST_COUNT + 1))
+    if pwkm_load_unload.sh ; then
 		tst_resm TPASS "Loading and Unloading of governor kernel \
-		modules got failed"
+modules"
 	else
 		RC=$?
-		tst_resm TFAIL "Loading and Unloading of governor kernel \
-		modules got failed"
-	fi
+        tst_resm TFAIL "Loading and Unloading of governor kernel \
+        modules got failed"
+    fi
 else
-	tst_resm TCONF "Required kernel configuration for CPU_FREQ NOT set"
+    tst_resm TCONF "Required kernel configuration for CPU_FREQ NOT set"
 fi
 
 # Checking cpuidle sysfs interface files
+(( TST_COUNT= $TST_COUNT +1))
 if check_cpuidle_sysfs_files.sh ; then
-	tst_resm TPASS "CPUIDLE sysfs tests failed"
+	tst_resm TPASS "CPUIDLE sysfs tests passed"
 else
 	RC=$?
-	tst_resm TFAIL "CPUIDLE sysfs tests failed"
+    tst_resm TFAIL "CPUIDLE sysfs tests failed"
 fi
 
-# Test sched_smt_power_savings interface on HT machines
-if [ -f /sys/devices/system/cpu/sched_smt_power_savings ] ; then
-	if test_sched_smt.sh ; then
-		tst_resm TPASS "SCHED_MC sysfs tests failed"
-	else
-		RC=$?
-		tst_resm TFAIL "SCHED_MC sysfs tests failed"
-	fi
+# sched_domain test
+which python > /dev/null
+if [ $? -ne 0 ] ; then
+	tst_resm TCONF "Python is not installed, CPU Consoldation\
+test cannot run"
 else
-	hyper_threaded=$(is_hyper_threaded)
-	if [ $hyper_threaded -eq 1 ]; then
-		tst_resm TFAIL "Required kernel configuration for SCHED_SMT NOT set"
-		RC=1
+	get_max_sched_mc; max_sched_mc=$?
+	for sched_mc in `seq 0 $max_sched_mc`; do
+		(( TST_COUNT= $TST_COUNT +1))
+		sched_domain.py -c $sched_mc; RC=$?
+		analyze_sched_domain_result $sched_mc $RC 
+		if [ $hyper_threaded -eq $YES ]; then
+			get_max_sched_smt ; max_sched_smt=$?
+			for sched_smt in `seq 0 $max_sched_smt`; do
+				# Testcase to validate sched_domain tree
+				(( TST_COUNT= $TST_COUNT +1))
+				sched_domain.py -c $sched_mc -t $sched_smt; RC=$?
+				analyze_sched_domain_result $sched_mc $RC $sched_smt ;
+			done
+		fi
+	done
+fi
+if [ $# -gt 0 -a $1 == "-exclusive" ]; then 
+	# Test CPU consolidation 
+	which python > /dev/null
+	if [ $? -ne 0 ] ; then
+		tst_resm TCONF "Python is not installed, CPU Consoldation\
+ test not run"
 	else
-		tst_resm TCONF "Required Hyper Threading support in the\
-system under test"
+		sched_mc_smt_pass_cnt=0
+		work_loads_list="ebizzy kernbench"
+		for sched_mc in `seq 0 $max_sched_mc`; do
+			for work_load in ${work_loads_list}
+            do
+				((TST_COUNT= $TST_COUNT + 1))
+				sched_mc_pass_cnt=0
+				for repeat_test in `seq 1  10`; do
+					 #Testcase to validate CPU consolidation for sched_mc
+					if cpu_consolidation.py -c $sched_mc -w $work_load ; then
+						((sched_mc_pass_cnt= $sched_mc_pass_cnt +1))
+					fi
+				done
+				analyze_consolidation_result $sched_mc $work_load $sched_mc_pass_cnt	
+			done	
+			if [ $hyper_threaded -eq $YES ]; then
+				for sched_smt in `seq 0 $max_sched_smt`; do
+					for work_load in ${work_loads_list}; do
+                    	((TST_COUNT= $TST_COUNT + 1))
+						sched_mc_smt_pass_cnt=0
+						for repeat_test in `seq 1  10`; do
+							# Testcase to validate CPU consolidation for
+							# for sched_mc & sched_smt with stress=50%
+							if cpu_consolidation.py -c $sched_mc -t $sched_smt -w $work_load; then
+								((sched_mc_smt_pass_cnt= $sched_mc_smt_pass_cnt +1))
+							fi
+						done
+						analyze_consolidation_result $sched_mc $work_load $sched_mc_smt_pass_cnt $sched_smt
+
+						#Testcase to validate consolidation at core level
+						sched_mc_smt_pass_cnt=0
+						stress="thread"
+						((TST_COUNT= $TST_COUNT + 1))
+						for repeat_test in `seq 1  10`; do
+							if cpu_consolidation.py -c $sched_mc -t $sched_smt -w $work_load -s $stress; then
+								((sched_mc_smt_pass_cnt= $sched_mc_smt_pass_cnt +1))
+							fi
+						done
+						analyze_consolidation_result $sched_mc $work_load $sched_mc_smt_pass_cnt $sched_smt $stress
+					done
+				done
+			fi
+		done
 	fi
 fi
 
-exit $RC
\ No newline at end of file
+exit $RC

------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

  parent reply	other threads:[~2009-06-30 14:58 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-30 14:57 [LTP] [Patch 1/10]Patch to integrate kernbench to LTP to test sched_mc=2 Poornima Nayak
2009-06-30 14:57 ` [LTP] [Patch 2/10]Makefile patch to integrate to LTP Poornima Nayak
2009-06-30 16:10   ` Subrata Modak
2009-06-30 14:57 ` [LTP] [Patch 3/10]Readme modified with pre-requisite for sched_mc=2 test Poornima Nayak
2009-06-30 16:10   ` Subrata Modak
2009-06-30 14:57 ` [LTP] [Patch 4/10]Reusable functions for consolidation test modified Poornima Nayak
2009-06-30 14:57 ` [LTP] [Patch 5/10]CPU consolidation testcase updated to handle exceptions Poornima Nayak
2009-06-30 14:57 ` [LTP] [Patch 6/10]sched domian " Poornima Nayak
2009-06-30 14:58 ` [LTP] [Patch 7/10]Fixes for sched_mc & sched_smt interface test Poornima Nayak
2009-06-30 14:58 ` [LTP] [Patch 8/10]New set of reusbale Library functions and fixes Poornima Nayak
2009-06-30 14:58 ` Poornima Nayak [this message]
2009-06-30 14:58 ` [LTP] [Patch 10/10]Patch to add another command file in runtest Poornima Nayak
2009-06-30 16:10   ` Subrata Modak
2009-06-30 16:09 ` [LTP] [Patch 1/10]Patch to integrate kernbench to LTP to test sched_mc=2 Subrata Modak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090630145824.11163.54300.sendpatchset@localhost.localdomain \
    --to=mpnayak@linux.vnet.ibm.com \
    --cc=ltp-list@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox