Skip to contentSkip to conversation

:Skip the test if "htop" is used.

PATCH New Siliang 2 participants 2 messages Jul 25, 2019

lore
Share & tools
lore

Siliang

#0 lore raw

PATCH v2 1/1 :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
index 18a11197e..ddb6abf95 100755
@@ -49,6 +49,11 @@ done
 
 LOOP_COUNT=1
 
+realtop=$(which top | xargs realpath | xargs basename)
+if [[ $realtop == "htop" ]] ; then
+	tst_brkm TCONF "$realtop 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
Signature · 1 line
2.22.0
#1 lore raw

PATCH v2 1/1 :Skip the test if "htop" is used.

Hi,

Quoted 12 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.

---
 .../kernel/hotplug/cpu_hotplug/functional/cpuhotplug06.sh    | 5 +++++
 1 file changed, 5 insertions(+)
testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug06.sh +0 -0
index 18a11197e..ddb6abf95 100755

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
 
+realtop=$(which top | xargs realpath | xargs basename)
+if [[ $realtop == "htop" ]] ; then

== is also a bashism, please use = (+ [[ ]] => [ ]).

testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug06.sh done · line 55

Quoted 2 lines
testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug06.sh +2 -0
+	tst_brkm TCONF "$realtop is used instead of top, Skip the test..."
+fi

OK, v2. This looks better than v2, but I'd really use command version output (top -v) to detect top vs. htop.

testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug06.sh done · line 59

Quoted 4 lines
testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug06.sh +1 -0
+
 if [ $(get_present_cpus_num) -lt 2 ]; then
 	tst_brkm TCONF "system doesn't have required CPU hotplug support"
 fi

Kind regards,
Petr

PS: please don't use ltp-request and ltp-owner, these aren't meant for patch submission.