* [LTP] [PATCH LTP] -Cpuhotplug06:Skip the test if "htop" is used.
@ 2019-07-24 23:45 Siliang, Yu
2019-07-25 2:15 ` Yu, SiliangX
2019-07-25 20:27 ` Petr Vorel
0 siblings, 2 replies; 3+ messages in thread
From: Siliang, Yu @ 2019-07-24 23:45 UTC (permalink / raw)
To: ltp
From: "Yu,Siliang" <siliangx.yu@intel.com>
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(+)
diff --git a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug06.sh b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug06.sh
index 18a11197e..ecf4eedea 100755
--- a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug06.sh
+++ b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug06.sh
@@ -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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [LTP] [PATCH LTP] -Cpuhotplug06:Skip the test if "htop" is used.
2019-07-24 23:45 [LTP] [PATCH LTP] -Cpuhotplug06:Skip the test if "htop" is used Siliang, Yu
@ 2019-07-25 2:15 ` Yu, SiliangX
2019-07-25 20:27 ` Petr Vorel
1 sibling, 0 replies; 3+ messages in thread
From: Yu, SiliangX @ 2019-07-25 2:15 UTC (permalink / raw)
To: ltp
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 <ltp@lists.linux.it>; ltp-request <ltp-request@lists.linux.it>; ltp-owner <ltp-owner@lists.linux.it>; Yu, SiliangX <siliangx.yu@intel.com>; Zhang, Yixin <yixin.zhang@intel.com>; Chen, Jerry T <jerry.t.chen@intel.com>
Subject: [PATCH LTP] -Cpuhotplug06:Skip the test if "htop" is used.
From: "Yu,Siliang" <siliangx.yu@intel.com>
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(+)
diff --git a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug06.sh b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug06.sh
index 18a11197e..ecf4eedea 100755
--- a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug06.sh
+++ b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug06.sh
@@ -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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [LTP] [PATCH LTP] -Cpuhotplug06:Skip the test if "htop" is used.
2019-07-24 23:45 [LTP] [PATCH LTP] -Cpuhotplug06:Skip the test if "htop" is used Siliang, Yu
2019-07-25 2:15 ` Yu, SiliangX
@ 2019-07-25 20:27 ` Petr Vorel
1 sibling, 0 replies; 3+ messages in thread
From: Petr Vorel @ 2019-07-25 20:27 UTC (permalink / raw)
To: ltp
Hi,
> From: "Yu,Siliang" <siliangx.yu@intel.com>
> 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'.
> ---
> .../kernel/hotplug/cpu_hotplug/functional/cpuhotplug06.sh | 5 +++++
> 1 file changed, 5 insertions(+)
> diff --git a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug06.sh b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug06.sh
> index 18a11197e..ecf4eedea 100755
> --- a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug06.sh
> +++ b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug06.sh
> @@ -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
> + 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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-07-25 20:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-24 23:45 [LTP] [PATCH LTP] -Cpuhotplug06:Skip the test if "htop" is used Siliang, Yu
2019-07-25 2:15 ` Yu, SiliangX
2019-07-25 20:27 ` Petr Vorel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox