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-f...@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