From: Guangwen Feng <fenggw-fnst@cn.fujitsu.com>
To: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH] cpuhotplug_hotplug.sh: fix the return of cpu number
Date: Fri, 4 Sep 2015 15:32:57 +0800 [thread overview]
Message-ID: <55E94929.7060903@cn.fujitsu.com> (raw)
In-Reply-To: <1440410664-10266-1-git-send-email-fenggw-fnst@cn.fujitsu.com>
Hello!
ping.
Best Regards,
Guangwen Feng
On 2015/08/24 18:04, Guangwen Feng wrote:
> In shell, function's return value can not exceed 255, if we run
> the test on machines which have more than 255 cpus, the result
> will be incorrect, so fix that by using global variable instead.
>
> Signed-off-by: Guangwen Feng <fenggw-fnst@cn.fujitsu.com>
> ---
> testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug01.sh | 2 +-
> testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug02.sh | 2 +-
> testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug03.sh | 2 +-
> testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug04.sh | 4 ++--
> testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug05.sh | 2 +-
> testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug06.sh | 2 +-
> testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug07.sh | 2 +-
> .../kernel/hotplug/cpu_hotplug/include/cpuhotplug_hotplug.sh | 8 ++++----
> 8 files changed, 12 insertions(+), 12 deletions(-)
>
> diff --git a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug01.sh b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug01.sh
> index 8ae1379..e75da21 100755
> --- a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug01.sh
> +++ b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug01.sh
> @@ -112,7 +112,7 @@ LOOP_COUNT=1
> tst_check_cmds perl
>
> get_present_cpus_num
> -if [ $? -lt 2 ]; then
> +if [ $PRESENT_CPUS_NUM -lt 2 ]; then
> tst_brkm TCONF "system doesn't have required CPU hotplug support"
> fi
>
> diff --git a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug02.sh b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug02.sh
> index c42cc1b..f6b4345 100755
> --- a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug02.sh
> +++ b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug02.sh
> @@ -55,7 +55,7 @@ done
> LOOP_COUNT=1
>
> get_present_cpus_num
> -if [ $? -lt 2 ]; then
> +if [ $PRESENT_CPUS_NUM -lt 2 ]; then
> tst_brkm TCONF "system doesn't have required CPU hotplug support"
> fi
>
> diff --git a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug03.sh b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug03.sh
> index 3469b10..a68ac7d 100755
> --- a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug03.sh
> +++ b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug03.sh
> @@ -64,7 +64,7 @@ done
> LOOP_COUNT=1
>
> get_present_cpus_num
> -cpus_num=$?
> +cpus_num=${PRESENT_CPUS_NUM}
> if [ $cpus_num -lt 2 ]; then
> tst_brkm TCONF "system doesn't have required CPU hotplug support"
> fi
> diff --git a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug04.sh b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug04.sh
> index 58a822e..3ecbb36 100755
> --- a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug04.sh
> +++ b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug04.sh
> @@ -49,13 +49,13 @@ done
> LOOP_COUNT=1
>
> get_present_cpus_num
> -cpus_num=$?
> +cpus_num=${PRESENT_CPUS_NUM}
> if [ $cpus_num -lt 2 ]; then
> tst_brkm TCONF "system doesn't have required CPU hotplug support"
> fi
>
> get_hotplug_cpus_num
> -if [ $? -lt 1 ]; then
> +if [ $HOTPLUG_CPUS_NUM -lt 1 ]; then
> tst_brkm TCONF "system doesn't have at least one hotpluggable CPU"
> fi
>
> diff --git a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug05.sh b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug05.sh
> index 60382c8..8009af2 100755
> --- a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug05.sh
> +++ b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug05.sh
> @@ -56,7 +56,7 @@ LOOP_COUNT=1
> tst_check_cmds sar
>
> get_present_cpus_num
> -if [ $? -lt 2 ]; then
> +if [ $PRESENT_CPUS_NUM -lt 2 ]; then
> tst_brkm TCONF "system doesn't have required CPU hotplug support"
> fi
>
> diff --git a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug06.sh b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug06.sh
> index 6710fad..5e71abf 100755
> --- a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug06.sh
> +++ b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug06.sh
> @@ -50,7 +50,7 @@ done
> LOOP_COUNT=1
>
> get_present_cpus_num
> -if [ $? -lt 2 ]; then
> +if [ $PRESENT_CPUS_NUM -lt 2 ]; then
> tst_brkm TCONF "system doesn't have required CPU hotplug support"
> fi
>
> diff --git a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug07.sh b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug07.sh
> index 7edb3a9..81dc225 100755
> --- a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug07.sh
> +++ b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug07.sh
> @@ -56,7 +56,7 @@ done
> LOOP_COUNT=1
>
> get_present_cpus_num
> -if [ $? -lt 2 ]; then
> +if [ $PRESENT_CPUS_NUM -lt 2 ]; then
> tst_brkm TCONF "system doesn't have required CPU hotplug support"
> fi
>
> diff --git a/testcases/kernel/hotplug/cpu_hotplug/include/cpuhotplug_hotplug.sh b/testcases/kernel/hotplug/cpu_hotplug/include/cpuhotplug_hotplug.sh
> index 6920393..be8bce2 100644
> --- a/testcases/kernel/hotplug/cpu_hotplug/include/cpuhotplug_hotplug.sh
> +++ b/testcases/kernel/hotplug/cpu_hotplug/include/cpuhotplug_hotplug.sh
> @@ -165,11 +165,11 @@ get_present_cpus()
>
> # get_present_cpus_num()
> #
> -# Prints the number of present CPUs
> +# Gets the number of present CPUs
> #
> get_present_cpus_num()
> {
> - return $(get_present_cpus | wc -w)
> + PRESENT_CPUS_NUM=`get_present_cpus | wc -w`
> }
>
> # get_hotplug_cpus()
> @@ -192,11 +192,11 @@ get_hotplug_cpus()
>
> # get_hotplug_cpus_num()
> #
> -# Prints the number of hotpluggable CPUs
> +# Gets the number of hotpluggable CPUs
> #
> get_hotplug_cpus_num()
> {
> - return $(get_hotplug_cpus | wc -w)
> + HOTPLUG_CPUS_NUM=`get_hotplug_cpus | wc -w`
> }
>
> # get_all_cpu_states()
>
------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
next prev parent reply other threads:[~2015-09-04 7:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-24 10:04 [LTP] [PATCH] cpuhotplug_hotplug.sh: fix the return of cpu number Guangwen Feng
2015-09-04 7:32 ` Guangwen Feng [this message]
2015-09-07 17:19 ` Cyril Hrubis
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=55E94929.7060903@cn.fujitsu.com \
--to=fenggw-fnst@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.