Skip to contentSkip to conversation

controllers/cpuacct: Simplify deleting directories

PATCH New Petr Vorel 1 participant 2 messages Sep 2, 2021 – Sep 10, 2021

lore
Share & tools
lore

Petr Vorel

author
#0 lore raw

PATCH 1/1 controllers/cpuacct: Simplify deleting directories

by using rm -rf instead of 2x rmdir and checks for dir presence.

Also move TINFO to print it only when relevant.

---
 testcases/kernel/controllers/cpuacct/cpuacct.sh | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
testcases/kernel/controllers/cpuacct/cpuacct.sh +2 -5
index b2347e801..99258c266 100755
@@ -119,13 +119,10 @@ setup()
 
 cleanup()
 {
-	tst_res TINFO "removing created directories"
 
 	if [ "$testpath" ]; then
-		if [ -d "$testpath/subgroup_1" ]; then
-			rmdir $testpath/subgroup_*
-		fi
-		rmdir $testpath
+		tst_res TINFO "removing created directories"
+		rm -rf $testpath
 	fi
 
 	if [ "$mounted" -ne 1 ]; then
Signature · 1 line
2.33.0
author
#1 lore raw

PATCH 1/1 controllers/cpuacct: Simplify deleting directories

Hi,

merged.

Kind regards,
Petr