Skip to contentSkip to conversation

- cpuhotplug06.sh:Add judgment for command "top".

PATCH New Siliang 1 participant 2 messages Jul 19, 2019

lore
Share & tools
lore

Siliang

#0 lore raw

PATCH 1/1 - cpuhotplug06.sh:Add judgment for command "top".

From: "Yu,Siliang" <[email protected]>

Only on clear linux OS,"top" is a link file.
If it's clear linux,skip the test.

---
 .../kernel/hotplug/cpu_hotplug/functional/cpuhotplug06.sh     | 4 ++++
 1 file changed, 4 insertions(+)
testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug06.sh +4 -0
index 18a11197e..d5877d085 100755
@@ -49,6 +49,10 @@ done
 
 LOOP_COUNT=1
 
+if [[ -L "/usr/bin/top" ]];then
+        tst_brkm TCONF "Invalid argument on Clear Linux 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 1/1 - cpuhotplug06.sh:Add judgment for command "top".

Hi Siliang,
There is some issue in your patch:

1. The "top" tool is not 100% located at /usr/bin/, you should use "which" cmd to check it
2. [[ -L "/usr/bin/top" ]] does not mean the case should go to TCONF. The real logic is the check the realpath of the top tool and check it's name, if the real name is not "top" (like "htop" in Clear Liunx case), TCONF the case. We don't care if it's a symlink or not, we just care if it's using the oringal top or an other top which may not support "top -b".
3. The error log is not correct. Clear Linux use symlink or Clear Liunx use "htop" doesn't go to the conclusion that if a distro use symlink or it use "htop" or some other "Xtop" so it's Clear Linux. We should not mention a specific distro name here. Same for commit message.
4. Take care of white spaces v.s. <tab>

Yixin

Quoted 28 lines · Siliang,Yu

From: "Yu,Siliang" <[email protected]>

Only on clear linux OS,"top" is a link file.
If it's clear linux,skip the test.

---
 .../kernel/hotplug/cpu_hotplug/functional/cpuhotplug06.sh     | 4 ++++
 1 file changed, 4 insertions(+)
testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug06.sh +4 -0
index 18a11197e..d5877d085 100755
@@ -49,6 +49,10 @@ done
 
 LOOP_COUNT=1
 
+if [[ -L "/usr/bin/top" ]];then
+        tst_brkm TCONF "Invalid argument on Clear Linux 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