From 457a70dabb2e61ae40f1d0f6f9e91cba2b32f258 Mon Sep 17 00:00:00 2001 From: Andrey Vagin Date: Tue, 26 Aug 2014 15:26:00 +0400 Subject: [PATCH] zdtm: don't hide errors in cgroup02.hook rmdir is executed for non-existent directories, so we don't check an exit code of this operation. This patch executs rmdir only for existent directories and check an exit code of rmdir. Signed-off-by: Andrey Vagin Acked-by: Tycho Andersen Signed-off-by: Pavel Emelyanov --- test/zdtm/live/static/cgroup02.hook | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/test/zdtm/live/static/cgroup02.hook b/test/zdtm/live/static/cgroup02.hook index 5f4d042f3..75bfb42ef 100755 --- a/test/zdtm/live/static/cgroup02.hook +++ b/test/zdtm/live/static/cgroup02.hook @@ -7,11 +7,9 @@ rmroots() { mount -t cgroup none $tname -o "$1" - set +e - rmdir "$tname/oldroot" - rmdir "$tname/newroot" - rmdir "$tname/zdtmtstroot" - set -e + for d in "$tname/oldroot" "$tname/newroot" "$tname/zdtmtstroot"; do + test -d "$d" && rmdir "$d" + done echo "Left there is:" ls "$tname"