-Cpuhotplug06:Skip the test if "htop" is used.
Siliang
PATCH 1/1 -Cpuhotplug06:Skip the test if "htop" is used.
From: "Yu,Siliang" <[email protected]>
In some distro, "htop" is used instead "top", which doesn't support '-b'. Skip the test if "htop" is used.
--- .../kernel/hotplug/cpu_hotplug/functional/cpuhotplug06.sh | 5 +++++ 1 file changed, 5 insertions(+)
testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug06.sh +5 -0
@@ -49,6 +49,11 @@ done LOOP_COUNT=1 +LNTOP=$(ls -l $(which top) | cut -s -d ">" -f2) +if [[ -n $LNTOP ]] && [[ $LNTOP != "top" ]] ; then + tst_brkm TCONF "Command doesn't support , Skip the test..." +fi + if [ $(get_present_cpus_num) -lt 2 ]; then tst_brkm TCONF "system doesn't have required CPU hotplug support" fi
Signature · 1 line
2.22.0
Yu
PATCH 1/1 -Cpuhotplug06:Skip the test if "htop" is used.
Hi,all
So sorry for this.
Please ignore this mail.
Best Regards
Siliang Yu
-----Original Message-----
From: Yu, SiliangX
Sent: Thursday, July 25, 2019 7:45 AM
To: ltp <[email protected]>; ltp-request <[email protected]>; ltp-owner <[email protected]>; Yu, SiliangX <[email protected]>; Zhang, Yixin <[email protected]>; Chen, Jerry T <[email protected]>
Subject: [PATCH LTP] -Cpuhotplug06:Skip the test if "htop" is used.
From: "Yu,Siliang" <[email protected]>
In some distro, "htop" is used instead "top", which doesn't support '-b'. Skip the test if "htop" is used.
--- .../kernel/hotplug/cpu_hotplug/functional/cpuhotplug06.sh | 5 +++++ 1 file changed, 5 insertions(+)
testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug06.sh +5 -0
@@ -49,6 +49,11 @@ done LOOP_COUNT=1 +LNTOP=$(ls -l $(which top) | cut -s -d ">" -f2) if [[ -n $LNTOP ]] && +[[ $LNTOP != "top" ]] ; then + tst_brkm TCONF "Command doesn't support , Skip the test..." +fi + if [ $(get_present_cpus_num) -lt 2 ]; then tst_brkm TCONF "system doesn't have required CPU hotplug support" fi
--
2.22.0
PATCH 1/1 -Cpuhotplug06:Skip the test if "htop" is used.
In reply to SiliangHi,
Quoted 3 lines
From: "Yu,Siliang" <[email protected]>
In some distro, "htop" is used instead "top", which doesn't support '-b'. Skip the test if "htop" is used.
Could you be more specific (which distro, ...)?
Do you mean binary is top and it's a symlink (or something) to htop? Trying to detect '>' suggests you target to symlink and the command on linew 76 is top top -b -d 00.10 > /dev/null 2>&1 &
But in that case it'd be better to parse 'top -v'.
Quoted 9 lines
--- .../kernel/hotplug/cpu_hotplug/functional/cpuhotplug06.sh | 5 +++++ 1 file changed, 5 insertions(+)testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug06.sh +0
-0
testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug06.sh done · line 53
Quoted 5 lines
testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug06.sh +2
-0@@ -49,6 +49,11 @@ done LOOP_COUNT=1 +LNTOP=$(ls -l $(which top) | cut -s -d ">" -f2) +if [[ -n $LNTOP ]] && [[ $LNTOP != "top" ]] ; then
[[ ]] is a bashism, please use [ ].
https://github.com/linux-test-project/ltp/wiki/Test-Writing-Guidelines#132-shell-coding-style
testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug06.sh done · line 59
Quoted 6 lines
testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug06.sh +3
-0+ tst_brkm TCONF "Command doesn't support , Skip the test..." +fi + if [ $(get_present_cpus_num) -lt 2 ]; then tst_brkm TCONF "system doesn't have required CPU hotplug support" fi
Kind regards,
Petr