[sheepdog] [PATCH v4 2/2] test: modify _cleanup_devices() to umount loop device by correct order

Robin Dong robin.k.dong at gmail.com
Fri Jun 20 08:03:06 CEST 2014


From: Robin Dong <sanbai at taobao.com>

When using _make_device like:

 _make_device $STORE/0/
 _make_device $STORE/0/d1
 _make_device $STORE/0/d2

the _cleanup_devices() will umount '$STORE/0/' first and then '$STORE/0/d1',
which will cause error message like:

 umount: /tmp/sheepdog/095/0/d1: not found
 umount: /tmp/sheepdog/095/1/d0: not found
 umount: /tmp/sheepdog/095/1/d1: not found
 umount: /tmp/sheepdog/095/2/d0: not found
 umount: /tmp/sheepdog/095/2/d1: not found

So we have to modify _cleanup_devices() to umount long path first.

Signed-off-by: Robin Dong <sanbai at taobao.com>
---
 tests/functional/common.rc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/functional/common.rc b/tests/functional/common.rc
index b8ef7d8..20365ce 100644
--- a/tests/functional/common.rc
+++ b/tests/functional/common.rc
@@ -399,7 +399,7 @@ _make_device()
 _cleanup_devices()
 {
     local d
-    for d in `mount | grep $WD | sort | uniq | awk '{print $3}'`; do
+    for d in `mount | grep $WD | sort -r | uniq | awk '{print $3}'`; do
         umount -l $d
         rm -f $d.img
     done
-- 
1.7.12.4




More information about the sheepdog mailing list