Whamcloud - gitweb
LU-2918 tests: sanity 184c to start copy before layout swap
authorJinshan Xiong <jinshan.xiong@intel.com>
Wed, 6 Mar 2013 18:25:38 +0000 (10:25 -0800)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 13 Mar 2013 17:38:52 +0000 (13:38 -0400)
The test script has to make sure dd already starts to copy file
before swapping layout, otherwise the attempt to open file1 would
fail.

Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Change-Id: I8217c9a38f1d09830c0ab259f65c9716c06736d1
Reviewed-on: http://review.whamcloud.com/5617
Tested-by: Hudson
Reviewed-by: Keith Mannthey <keith.mannthey@intel.com>
Reviewed-by: Jian Yu <jian.yu@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/tests/sanity.sh

index 8778301..af29ca2 100644 (file)
@@ -9532,7 +9532,8 @@ test_184c() {
        dd if=$ref1 of=$file1 bs=16k &
        local DD_PID=$!
 
-       sleep 0.$((RANDOM % 5 + 1))
+       # Make sure dd starts to copy file
+       while [ ! -f $file1 ]; do sleep 0.1; done
 
        $LFS swap_layouts $file1 $file2
        local rc=$?