* [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
* Re: [LTP] [PATCH] cgroup/cgroup_regression_test.sh: fix an issue about removing directories 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 1 sibling, 0 replies; 3+ messages in thread From: Mike Frysinger @ 2014-08-04 8:34 UTC (permalink / raw) To: ltp-list [-- Attachment #1.1: Type: text/plain, Size: 228 bytes --] On Mon 04 Aug 2014 15:59:34 Xing Gu wrote: > -rmdir -p cgroup/* > +if [ "$(ls -A cgroup/)" ]; then > + rmdir -p cgroup/* > +else > + rmdir cgroup/ > +fi one line: find cgroup/ -maxdepth 1 -depth -exec rmdir {} + -mike [-- Attachment #1.2: This is a digitally signed message part. --] [-- Type: application/pgp-signature, Size: 819 bytes --] [-- Attachment #2: Type: text/plain, Size: 332 bytes --] ------------------------------------------------------------------------------ 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 [-- Attachment #3: Type: text/plain, Size: 155 bytes --] _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [LTP] [PATCH] cgroup/cgroup_regression_test.sh: fix an issue about removing directories 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 1 sibling, 0 replies; 3+ messages in thread From: chrubis @ 2014-08-05 15:28 UTC (permalink / raw) To: Xing Gu; +Cc: ltp-list Hi! > 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. I've pushed the one line version from Mike. Thank you both. -- Cyril Hrubis chrubis@suse.cz ------------------------------------------------------------------------------ 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 [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