public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] cgroup/cgroup_regression_test.sh: fix an issue about removing directories
@ 2014-08-04  7:59 Xing Gu
  2014-08-04  8:34 ` Mike Frysinger
  2014-08-05 15:28 ` chrubis
  0 siblings, 2 replies; 3+ messages in thread
From: Xing Gu @ 2014-08-04  7:59 UTC (permalink / raw)
  To: ltp-list

After running test_$cur cases successfully, executing
"rmdir -p cgroup/*" outputs "rmdir: failed to
remove cgroup/*: No such file or directory" error
message, this is because cgroup is an empty directory
here. Fix it.

Signed-off-by: Xing Gu <gux.fnst@cn.fujitsu.com>
---
 testcases/kernel/controllers/cgroup/cgroup_regression_test.sh | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/testcases/kernel/controllers/cgroup/cgroup_regression_test.sh b/testcases/kernel/controllers/cgroup/cgroup_regression_test.sh
index 356c000..e83ad1d 100755
--- a/testcases/kernel/controllers/cgroup/cgroup_regression_test.sh
+++ b/testcases/kernel/controllers/cgroup/cgroup_regression_test.sh
@@ -525,7 +525,11 @@ for ((cur = 1; cur <= $TST_TOTAL; cur++))
 	test_$cur
 }
 
-rmdir -p cgroup/*
+if [ "$(ls -A cgroup/)" ]; then
+	rmdir -p cgroup/*
+else
+	rmdir cgroup/
+fi
 
 exit $failed
 
-- 
1.9.3


------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls. 
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-08-05 15:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-04  7:59 [LTP] [PATCH] cgroup/cgroup_regression_test.sh: fix an issue about removing directories Xing Gu
2014-08-04  8:34 ` Mike Frysinger
2014-08-05 15:28 ` chrubis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox