[sheepdog] [PATCH v3 4/4] tests: fix mistake in _cleanup_devices()

Robin Dong robin.k.dong at gmail.com
Fri Mar 7 10:48:59 CET 2014


From: Robin Dong <sanbai at taobao.com>

At present, it reports wrong message when running test cases:

	yliu at ubuntu-precise:~/sheepdog/tests/functional$ sudo ./check 089
	PLATFORM      -- Linux/x86_64 ubuntu-precise 3.11.0-14-generic

	089 Last Used:9s.  Test http interface of sheepfs
	umount: /tmp/sheepdog/089/s: not found
	rm: cannot remove '/tmp/sheepdog/089/sheepfs': Device or resource busy
	Passed all 1 tests

The "grep -o $WD/.../." sometimes will match out the wrong term
"/tmp/sheepdog/s" for "/tmp/sheepdog/sheepfs". So we use awk to
fetch term instead of reguler-expression in grep.

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 5388e48..4b7d04e 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 -o $WD/.../. | sort | uniq`; do
+    for d in `mount | grep $WD | sort | uniq | awk '{print $3}'`; do
         umount -l $d
         rm -f $d.img
     done
-- 
1.7.12.4




More information about the sheepdog mailing list