<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">2014-06-17 13:51 GMT+08:00 Liu Yuan <span dir="ltr"><<a href="mailto:namei.unix@gmail.com" target="_blank">namei.unix@gmail.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Tue, Jun 17, 2014 at 01:37:30PM +0800, Robin Dong wrote:<br>
> From: Robin Dong <<a href="mailto:sanbai@taobao.com">sanbai@taobao.com</a>><br>
><br>
> Signed-off-by: Robin Dong <<a href="mailto:sanbai@taobao.com">sanbai@taobao.com</a>><br>
> ---<br>
> v1-->v2:<br>
> 1. remove wrong 'exit' code from test case<br>
> 2. add 095.out<br>
><br>
> v2-->v3:<br>
> 1. use _make_device() instead of doing dd and mount<br>
><br>
> tests/functional/095 | 39 +++++++++++++++++++++++++++++++++++++++<br>
> tests/functional/095.out | 2 ++<br>
> tests/functional/group | 1 +<br>
> 3 files changed, 42 insertions(+)<br>
> create mode 100755 tests/functional/095<br>
> create mode 100644 tests/functional/095.out<br>
><br>
> diff --git a/tests/functional/095 b/tests/functional/095<br>
> new file mode 100755<br>
> index 0000000..7a479a0<br>
> --- /dev/null<br>
> +++ b/tests/functional/095<br>
> @@ -0,0 +1,39 @@<br>
> +#!/bin/bash<br>
> +<br>
> +# Test disk error handling with full path name<br>
> +<br>
> +. ./common<br>
> +<br>
> +# make different size of devices<br>
> +for i in `seq 0 2`; do<br>
> + _make_device $i $((100 * 1024 ** 2))<br>
> + _make_device $i/d0 $((100 * 1024 ** 2))<br>
> + _make_device $i/d1 $((100 * 1024 ** 2))<br>
> +done<br>
> +<br>
> +for i in `seq 0 2`; do<br>
> + $SHEEP $STORE/$i/,$STORE/$i/d0/,$STORE/$i/d1/ -z $i -p $((7000+$i)) -c $DRIVER $SHEEP_OPTIONS<br>
> +done<br>
> +<br>
> +_wait_for_sheep 3<br>
> +<br>
> +_cluster_format -c 2:1<br>
> +<br>
> +_vdi_create test 99M<br>
> +<br>
> +_random | $DOG vdi write test<br>
> +<br>
> +$DOG vdi read test | md5sum > $STORE/csum.1<br>
> +<br>
> +# remove obj directory to occut EIO<br>
> +umount $STORE/0/d0<br>
> +rm -rf $STORE/0/d0<br>
> +<br>
> +$DOG vdi read test | md5sum > $STORE/csum.2<br>
> +<br>
> +diff -u $STORE/csum.1 $STORE/csum.2<br>
> +<br>
> +for i in `seq 0 2`; do<br>
> + umount $STORE/$i/d0 &> /dev/null<br>
> + umount $STORE/$i/d1 &> /dev/null<br>
> +done<br>
<br>
</div></div>you _make_device $i but don't umount it.<br></blockquote><div><br></div><div>The script 'check' will call _cleanup() in common.rc, and then _cleanup_devices() which will umount all loop device.</div>
<div><br></div><div>the test case such as 011 064 also use _make_device without umounting them because 'check' do it automaticly.</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Thanks<br>
<span class="HOEnZb"><font color="#888888">Yuan<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>--<br>Best Regard<br>Robin Dong
</div></div>