public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] Fix cpuhotplug testcase cpuhotplug01
@ 2012-11-14  7:57 jin.li
  2012-11-14  7:57 ` [LTP] [V2] [PATCH] Fix cpuhotplug test case cpuhotplug01 jin.li
  0 siblings, 1 reply; 3+ messages in thread
From: jin.li @ 2012-11-14  7:57 UTC (permalink / raw)
  To: jin.li, ltp-list

Hi Wenlong,

This V2 version remove the variable cpustate which will never used in
case cpuhotplug01

Regards,

Jin

------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [LTP] [V2] [PATCH] Fix cpuhotplug test case cpuhotplug01
  2012-11-14  7:57 [LTP] Fix cpuhotplug testcase cpuhotplug01 jin.li
@ 2012-11-14  7:57 ` jin.li
  2012-11-14  8:23   ` Wanlong Gao
  0 siblings, 1 reply; 3+ messages in thread
From: jin.li @ 2012-11-14  7:57 UTC (permalink / raw)
  To: jin.li, ltp-list

From: Jin Li <jin.li@windriver.com>

Fix for case cpuhotplug01:

1. Give all available parameters to function migrate_irq.
2. Add the INFO note for the IRQ whose IRQ affinity is NOT permitted to changed.
3. Remove the variable cpustate and related code in function do_clean. The cpu,
which was off before the test start, has been closed correctly in do_clean.
4. Add test case PASS at the end of the passed case

Signed-off-by: Jin Li <jin.li@windriver.com>
---
 .../kernel/hotplug/cpu_hotplug/functional/cpuhotplug01.sh   | 13 +++++--------
 testcases/kernel/hotplug/cpu_hotplug/include/hotplug.fns    | 12 ++++++++----
 2 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug01.sh b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug01.sh
index acf7df1..07379dc 100755
--- a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug01.sh
+++ b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug01.sh
@@ -54,14 +54,12 @@ if ! cpu_is_valid "${CPU_TO_TEST}" ; then
 fi
 
 CPU_COUNT=0
-cpustate=1
 
 if ! cpu_is_online "${CPU_TO_TEST}" ; then
 	if ! online_cpu ${CPU_TO_TEST} ; then
 		tst_resm TFAIL "Could not online cpu $CPU_TO_TEST"
 		exit_clean 1
 	fi
-	cpustate=0
 fi
 
 # do_clean()
@@ -81,11 +79,6 @@ do_clean()
 		offline_cpu $offline_cpu
 		: $(( CPU_COUNT -= 1 ))
 	done
-	if [ "x${cpustate}" = x1 ]; then
-		online_cpu ${CPU_TO_TEST}
-	else
-		offline_cpu ${CPU_TO_TEST}
-	fi
 }
 
 
@@ -98,7 +91,7 @@ do_offline()
 	CPU=${1#cpu}
 	# Migrate some irq's this way first.
 	IRQS=`get_all_irqs`
-	migrate_irq ${CPU} ${IRQS}
+	migrate_irq "${CPU}" "${IRQS}"
 	offline_cpu ${CPU}
 	if [ $? -ne 0 ]; then
 		if [ "$CPU" -ne 0 ]; then
@@ -191,4 +184,8 @@ do
 
 done
 
+if [ "$RC" -eq 0 ];then
+        tst_resm TPASS "online and offline cpu${CPU} when writing disk"
+fi
+
 exit_clean $RC
diff --git a/testcases/kernel/hotplug/cpu_hotplug/include/hotplug.fns b/testcases/kernel/hotplug/cpu_hotplug/include/hotplug.fns
index 8a7cc32..6b3c933 100644
--- a/testcases/kernel/hotplug/cpu_hotplug/include/hotplug.fns
+++ b/testcases/kernel/hotplug/cpu_hotplug/include/hotplug.fns
@@ -1,3 +1,5 @@
+#!/bin/sh
+
 # hotplug.fns - Collection of functions for hotplugging
 # operations.
 
@@ -27,7 +29,8 @@ migrate_irq()
     IRQS=$2
     for irq in ${IRQS}
       do
-      echo $MASK > /proc/irq/${irq}/smp_affinity
+      echo $MASK > /proc/irq/${irq}/smp_affinity || \
+        tst_resm TINFO "It is NOT permitted to change the IRQ $irq smp_affinity"
     done
 }
 
@@ -106,7 +109,8 @@ offline_cpu()
 get_all_cpus()
 {
     [ -d /sys/devices/system/cpu/cpu0 ] || return 1
-    ls -dr /sys/devices/system/cpu/cpu[0-9]* || return 2
+    ls -dr /sys/devices/system/cpu/cpu[0-9]* | \
+        sed "s/\/sys\/devices\/system\/cpu\///g" || return 2
 }
 
 
@@ -183,8 +187,8 @@ cpu_is_valid()
 
 # cpu_is_online(CPU)
 #
-#  Returns a true value if the given CPU number is currently online,
-#  false otherwise.  This function requires the system's CPUs have
+#  Returns a 0 value if the given CPU number is currently online,
+#  1 otherwise.  This function requires the system's CPUs have
 #  hotplug capabilities.
 #
 cpu_is_online()
-- 
1.7.11


------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [LTP] [V2] [PATCH] Fix cpuhotplug test case cpuhotplug01
  2012-11-14  7:57 ` [LTP] [V2] [PATCH] Fix cpuhotplug test case cpuhotplug01 jin.li
@ 2012-11-14  8:23   ` Wanlong Gao
  0 siblings, 0 replies; 3+ messages in thread
From: Wanlong Gao @ 2012-11-14  8:23 UTC (permalink / raw)
  To: jin.li; +Cc: ltp-list

On 11/14/2012 03:57 PM, jin.li@windriver.com wrote:
> From: Jin Li <jin.li@windriver.com>
> 
> Fix for case cpuhotplug01:
> 
> 1. Give all available parameters to function migrate_irq.
> 2. Add the INFO note for the IRQ whose IRQ affinity is NOT permitted to changed.
> 3. Remove the variable cpustate and related code in function do_clean. The cpu,
> which was off before the test start, has been closed correctly in do_clean.
> 4. Add test case PASS at the end of the passed case


Applied, thank you.

Wanlong Gao


------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-11-14  8:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-14  7:57 [LTP] Fix cpuhotplug testcase cpuhotplug01 jin.li
2012-11-14  7:57 ` [LTP] [V2] [PATCH] Fix cpuhotplug test case cpuhotplug01 jin.li
2012-11-14  8:23   ` Wanlong Gao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox