* [LTP] [PATCH] hotplug/cpu_hotplug: add it to run default
@ 2014-09-11 12:15 Xing Gu
2014-09-24 7:09 ` chrubis
0 siblings, 1 reply; 2+ messages in thread
From: Xing Gu @ 2014-09-11 12:15 UTC (permalink / raw)
To: ltp-list
Fix test cases' exit status with TCONF on single cpu
machine, and add it to run default.
Signed-off-by: Xing Gu <gux.fnst@cn.fujitsu.com>
---
scenario_groups/default | 1 +
.../kernel/hotplug/cpu_hotplug/functional/cpuhotplug01.sh | 7 ++++---
.../kernel/hotplug/cpu_hotplug/functional/cpuhotplug02.sh | 9 +++++++--
.../kernel/hotplug/cpu_hotplug/functional/cpuhotplug03.sh | 9 +++++++--
.../kernel/hotplug/cpu_hotplug/functional/cpuhotplug04.sh | 5 +++++
.../kernel/hotplug/cpu_hotplug/functional/cpuhotplug05.sh | 9 +++++++--
.../kernel/hotplug/cpu_hotplug/functional/cpuhotplug06.sh | 7 ++++++-
.../kernel/hotplug/cpu_hotplug/functional/cpuhotplug07.sh | 10 ++++++++++
.../kernel/hotplug/cpu_hotplug/include/cpuhotplug_hotplug.sh | 12 ++++++++++++
9 files changed, 59 insertions(+), 10 deletions(-)
diff --git a/scenario_groups/default b/scenario_groups/default
index 00da222..3a55702 100644
--- a/scenario_groups/default
+++ b/scenario_groups/default
@@ -31,3 +31,4 @@ pipes
dma_thread_diotest
cpuacct
can
+cpuhotplug
diff --git a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug01.sh b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug01.sh
index e1a1855..f91cf88 100755
--- a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug01.sh
+++ b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug01.sh
@@ -116,7 +116,8 @@ LOOP_COUNT=1
tst_check_cmds perl
-if ! get_all_cpus >/dev/null 2>&1; then
+get_cpus_num
+if [ $? -lt 2 ]; then
tst_brkm TCONF "system doesn't have required CPU hotplug support"
fi
@@ -124,9 +125,9 @@ if [ -z "${CPU_TO_TEST}" ]; then
tst_brkm TBROK "usage: ${0##*/} <CPU to online>"
fi
-# Validate the specified CPU exists
+# Validate the specified CPU is available
if ! cpu_is_valid "${CPU_TO_TEST}" ; then
- tst_brkm TBROK "cpu${CPU_TO_TEST} not found"
+ tst_brkm TCONF "cpu${CPU_TO_TEST} doesn't support hotplug"
fi
if ! cpu_is_online "${CPU_TO_TEST}" ; then
diff --git a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug02.sh b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug02.sh
index edfdd35..3b33720 100755
--- a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug02.sh
+++ b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug02.sh
@@ -54,13 +54,18 @@ done
LOOP_COUNT=1
+get_cpus_num
+if [ $? -lt 2 ]; then
+ tst_brkm TCONF "system doesn't have required CPU hotplug support"
+fi
+
if [ -z "${CPU_TO_TEST}" ]; then
tst_brkm TBROK "usage: ${0##*/} <CPU to online>"
fi
-# Validate the specified CPU exists
+# Validate the specified CPU is available
if ! cpu_is_valid "${CPU_TO_TEST}" ; then
- tst_brkm TBROK "cpu${CPU_TO_TEST} not found"
+ tst_brkm TCONF "cpu${CPU_TO_TEST} doesn't support hotplug"
fi
# Validate the specified CPU is online; if not, online it
diff --git a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug03.sh b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug03.sh
index 61c7ba5..8176fb3 100755
--- a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug03.sh
+++ b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug03.sh
@@ -66,13 +66,18 @@ done
LOOP_COUNT=1
+get_cpus_num
+if [ $? -lt 2 ]; then
+ tst_brkm TCONF "system doesn't have required CPU hotplug support"
+fi
+
if [ -z $CPU_TO_TEST ]; then
tst_brkm TBROK "usage: ${0##*} <CPU to online>"
fi
-# Verify the specified CPU exists
+# Validate the specified CPU is available
if ! cpu_is_valid "${CPU_TO_TEST}" ; then
- tst_brkm TBROK "CPU${CPU_TO_TEST} not found"
+ tst_brkm TCONF "cpu${CPU_TO_TEST} doesn't support hotplug"
fi
TST_CLEANUP=do_clean
diff --git a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug04.sh b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug04.sh
index 0e3d5f4..72fbc6e 100755
--- a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug04.sh
+++ b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug04.sh
@@ -57,6 +57,11 @@ done
LOOP_COUNT=1
+get_cpus_num
+if [ $? -lt 2 ]; then
+ tst_brkm TCONF "system doesn't have required CPU hotplug support"
+fi
+
TST_CLEANUP=do_clean
until [ $LOOP_COUNT -gt $HOTPLUG04_LOOPS ]; do
diff --git a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug05.sh b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug05.sh
index 34b160a..bb0e896 100755
--- a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug05.sh
+++ b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug05.sh
@@ -54,13 +54,18 @@ LOOP_COUNT=1
tst_check_cmds sar
+get_cpus_num
+if [ $? -lt 2 ]; then
+ tst_brkm TCONF "system doesn't have required CPU hotplug support"
+fi
+
if [ -z "$CPU_TO_TEST" ]; then
tst_brkm TBROK "usage: ${0##*} <CPU to offline>"
fi
-# Verify the specified CPU is available
+# Validate the specified CPU is available
if ! cpu_is_valid "${CPU_TO_TEST}" ; then
- tst_brkm TBROK "CPU${CPU_TO_TEST} not found"
+ tst_brkm TCONF "cpu${CPU_TO_TEST} doesn't support hotplug"
fi
# Check that the specified CPU is offline; if not, offline it
diff --git a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug06.sh b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug06.sh
index d382fc8..2e48242 100755
--- a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug06.sh
+++ b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug06.sh
@@ -49,13 +49,18 @@ done
LOOP_COUNT=1
+get_cpus_num
+if [ $? -lt 2 ]; then
+ tst_brkm TCONF "system doesn't have required CPU hotplug support"
+fi
+
if [ -z "$CPU_TO_TEST" ]; then
tst_brkm TBROK "Usage: ${0##*/} <CPU to offline>"
fi
# Verify that the specified CPU is available
if ! cpu_is_valid "${CPU_TO_TEST}" ; then
- tst_brkm TBROK "CPU${CPU_TO_TEST} not found"
+ tst_brkm TCONF "cpu${CPU_TO_TEST} doesn't support hotplug"
fi
# Check that the specified CPU is online; if not, online it
diff --git a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug07.sh b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug07.sh
index 32bbf1c..723f3de 100755
--- a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug07.sh
+++ b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug07.sh
@@ -55,6 +55,11 @@ done
LOOP_COUNT=1
+get_cpus_num
+if [ $? -lt 2 ]; then
+ tst_brkm TCONF "system doesn't have required CPU hotplug support"
+fi
+
if [ ! -d "${KERNEL_DIR}" ]; then
tst_brkm TCONF "kernel directory - $KERNEL_DIR - does not exist"
fi
@@ -64,6 +69,11 @@ if [ -z "${CPU_TO_TEST}" ]; then
source code directory>"
fi
+# Validate the specified CPU is available
+if ! cpu_is_valid "${CPU_TO_TEST}" ; then
+ tst_brkm TCONF "cpu${CPU_TO_TEST} doesn't support hotplug"
+fi
+
if ! cpu_is_online ${CPU_TO_TEST}; then
if ! online_cpu ${CPU_TO_TEST}; then
tst_brkm TBROK "CPU${CPU_TO_TEST} cannot be onlined"
diff --git a/testcases/kernel/hotplug/cpu_hotplug/include/cpuhotplug_hotplug.sh b/testcases/kernel/hotplug/cpu_hotplug/include/cpuhotplug_hotplug.sh
index 8ded6bb..dd8472f 100644
--- a/testcases/kernel/hotplug/cpu_hotplug/include/cpuhotplug_hotplug.sh
+++ b/testcases/kernel/hotplug/cpu_hotplug/include/cpuhotplug_hotplug.sh
@@ -97,6 +97,18 @@ offline_cpu()
return $RC
}
+# get_cpus_num()
+#
+# Prints the number of all available CPUs, regardless of whether they're
+# currently online or offline.
+#
+get_cpus_num()
+{
+ [ -d /sys/devices/system/cpu/cpu0 ] || return -1
+ NUM=`ls /sys/devices/system/cpu/ \
+ | grep -c "cpu[0-9][0-9]*"`
+ return $NUM
+}
# get_all_cpus()
#
--
1.9.3
------------------------------------------------------------------------------
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [LTP] [PATCH] hotplug/cpu_hotplug: add it to run default
2014-09-11 12:15 [LTP] [PATCH] hotplug/cpu_hotplug: add it to run default Xing Gu
@ 2014-09-24 7:09 ` chrubis
0 siblings, 0 replies; 2+ messages in thread
From: chrubis @ 2014-09-24 7:09 UTC (permalink / raw)
To: Xing Gu; +Cc: ltp-list
Hi!
> Fix test cases' exit status with TCONF on single cpu
> machine, and add it to run default.
Pushed, thanks.
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-09-24 7:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-11 12:15 [LTP] [PATCH] hotplug/cpu_hotplug: add it to run default Xing Gu
2014-09-24 7:09 ` chrubis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox