diff mbox series

[v3] Skip the test if "htop" is used.

Message ID 20190814091545.147098-1-siliangx.yu@intel.com
State Superseded
Delegated to: Petr Vorel
Headers show
Series [v3] Skip the test if "htop" is used. | expand

Commit Message

SiliangYu Aug. 14, 2019, 9:15 a.m. UTC
From: "Yu,Siliang" <siliangx.yu@intel.com>

In clear linux os, "htop" is used instead "top", which doesn't support '-b'. Skip the test on clear linux.

Signed-off-by: Yu,Siliang <siliangx.yu@intel.com>
---
 .../kernel/hotplug/cpu_hotplug/functional/cpuhotplug06.sh     | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Petr Vorel Aug. 27, 2019, 9:41 a.m. UTC | #1
> From: "Yu,Siliang" <siliangx.yu@intel.com>

> In clear linux os, "htop" is used instead "top", which doesn't support '-b'. Skip the test on clear linux.
There is a bug report in Clear Linux OS [1]:
original top program is named top2, maybe it'd make sense to test for it as well.

> Signed-off-by: Yu,Siliang <siliangx.yu@intel.com>
Acked-by: Petr Vorel <pvorel@suse.cz>

>  .../kernel/hotplug/cpu_hotplug/functional/cpuhotplug06.sh     | 4 ++++
...

> +if top -v | grep -q htop; then
> +	tst_brkm TCONF "htop is used instead of top, Skip the test..."
	tst_brkm TCONF "htop is used instead of top, skip the test"
...

Kind regards,
Petr

[1] https://github.com/clearlinux/distribution/issues/277#issuecomment-442340322
Xiao Yang Aug. 27, 2019, 10:15 a.m. UTC | #2
On 2019/08/27 17:41, Petr Vorel wrote:
>> From: "Yu,Siliang"<siliangx.yu@intel.com>
>> In clear linux os, "htop" is used instead "top", which doesn't support '-b'. Skip the test on clear linux.
> There is a bug report in Clear Linux OS [1]:
> original top program is named top2, maybe it'd make sense to test for it as well.
Hi,

Is the silly rename going to be changed by Clear Linux in future?

If yes, we may keep cpuhotplug06.sh to detect the issue.
If no, we may update cpuhotplug06.sh to use top2 if top is provided by 
htop.

Best Regards,
Xiao Yang
>> Signed-off-by: Yu,Siliang<siliangx.yu@intel.com>
> Acked-by: Petr Vorel<pvorel@suse.cz>
>
>>   .../kernel/hotplug/cpu_hotplug/functional/cpuhotplug06.sh     | 4 ++++
> ...
>
>> +if top -v | grep -q htop; then
>> +	tst_brkm TCONF "htop is used instead of top, Skip the test..."
> 	tst_brkm TCONF "htop is used instead of top, skip the test"
> ...
>
> Kind regards,
> Petr
>
> [1] https://github.com/clearlinux/distribution/issues/277#issuecomment-442340322
>
Petr Vorel Aug. 27, 2019, 11:27 a.m. UTC | #3
Hi,

> On 2019/08/27 17:41, Petr Vorel wrote:
> > > From: "Yu,Siliang"<siliangx.yu@intel.com>
> > > In clear linux os, "htop" is used instead "top", which doesn't support '-b'. Skip the test on clear linux.
> > There is a bug report in Clear Linux OS [1]:
> > original top program is named top2, maybe it'd make sense to test for it as well.

> Is the silly rename going to be changed by Clear Linux in future?

> If yes, we may keep cpuhotplug06.sh to detect the issue.
> If no, we may update cpuhotplug06.sh to use top2 if top is provided by htop.
+1. Let's wait for the reply on Github issue [1].

> Best Regards,
> Xiao Yang

Kind regards,
Petr

> > [1] https://github.com/clearlinux/distribution/issues/277#issuecomment-442340322
Petr Vorel Aug. 29, 2019, 11:58 a.m. UTC | #4
Hi,

> Is the silly rename going to be changed by Clear Linux in future?
According to [2], they does not going to change it.

> If yes, we may keep cpuhotplug06.sh to detect the issue.
> If no, we may update cpuhotplug06.sh to use top2 if top is provided by htop.

I suggest to use proposed solution with extra tip:

if top -v | grep -q htop; then
	tst_brkm TCONF "htop is used instead of top, skip the test (workaround: alias top='/path/to/real/top')"
fi

And leave user to solve it:
alias top='top2'

Kind regards,
Petr
diff mbox series

Patch

diff --git a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug06.sh b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug06.sh
index 18a11197e..da7a4df73 100755
--- a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug06.sh
+++ b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug06.sh
@@ -49,6 +49,10 @@  done
 
 LOOP_COUNT=1
 
+if top -v | grep -q htop; then
+	tst_brkm TCONF "htop is used instead of top, Skip the test..."
+fi
+
 if [ $(get_present_cpus_num) -lt 2 ]; then
 	tst_brkm TCONF "system doesn't have required CPU hotplug support"
 fi