public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: <jin.li@windriver.com>
To: jin.li@windriver.com, gaowanlong@cn.fujitsu.com,
	ltp-list@lists.sourceforge.net
Subject: [LTP] [PATCH 1/3] Fix cpuhotplug test case cpuhotplug01
Date: Mon, 12 Nov 2012 15:33:59 +0800	[thread overview]
Message-ID: <1352705641-27644-2-git-send-email-jin.li@windriver.com> (raw)
In-Reply-To: <1352705641-27644-1-git-send-email-jin.li@windriver.com>

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    | 11 +++++------
 testcases/kernel/hotplug/cpu_hotplug/include/hotplug.fns     | 12 ++++++++----
 2 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug01.sh b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug01.sh
index acf7df1..995c21b 100755
--- a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug01.sh
+++ b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug01.sh
@@ -81,11 +81,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 +93,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 +186,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


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_nov
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

  reply	other threads:[~2012-11-12  7:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-12  7:33 [LTP] Fix cpuhotplug testcase cpuhotplug01 and cpuhotplug03 jin.li
2012-11-12  7:33 ` jin.li [this message]
2012-11-14  6:04   ` [LTP] [PATCH 1/3] Fix cpuhotplug test case cpuhotplug01 Wanlong Gao
2012-11-14  6:14     ` Li, Jin
2012-11-12  7:34 ` [LTP] [PATCH 2/3] Fix cpuhotplug test case cpuhotplug03 jin.li
2012-11-14  6:29   ` Wanlong Gao
2012-11-14  7:01     ` Li, Jin
2012-11-14  7:17       ` Wanlong Gao
2012-11-14  7:23         ` Li, Jin
2012-11-14  8:23   ` Wanlong Gao
2012-11-12  7:34 ` [LTP] [PATCH 3/3] Fix cpuhotplug test case cpuhotplug05 jin.li
2012-11-14  6:38   ` Wanlong Gao
2012-11-14  8:23   ` Wanlong Gao

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=1352705641-27644-2-git-send-email-jin.li@windriver.com \
    --to=jin.li@windriver.com \
    --cc=gaowanlong@cn.fujitsu.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