[sheepdog] [PATCH v3 2/2] test: add test case for data path with slash

Robin Dong robin.k.dong at gmail.com
Wed Jun 18 08:49:53 CEST 2014


2014-06-17 13:51 GMT+08:00 Liu Yuan <namei.unix at gmail.com>:

> On Tue, Jun 17, 2014 at 01:37:30PM +0800, Robin Dong wrote:
> > From: Robin Dong <sanbai at taobao.com>
> >
> > Signed-off-by: Robin Dong <sanbai at taobao.com>
> > ---
> > v1-->v2:
> >   1. remove wrong 'exit' code from test case
> >   2. add 095.out
> >
> > v2-->v3:
> >   1. use _make_device() instead of doing dd and mount
> >
> >  tests/functional/095     | 39 +++++++++++++++++++++++++++++++++++++++
> >  tests/functional/095.out |  2 ++
> >  tests/functional/group   |  1 +
> >  3 files changed, 42 insertions(+)
> >  create mode 100755 tests/functional/095
> >  create mode 100644 tests/functional/095.out
> >
> > diff --git a/tests/functional/095 b/tests/functional/095
> > new file mode 100755
> > index 0000000..7a479a0
> > --- /dev/null
> > +++ b/tests/functional/095
> > @@ -0,0 +1,39 @@
> > +#!/bin/bash
> > +
> > +# Test disk error handling with full path name
> > +
> > +. ./common
> > +
> > +# make different size of devices
> > +for i in `seq 0 2`; do
> > +     _make_device $i    $((100 * 1024 ** 2))
> > +     _make_device $i/d0 $((100 * 1024 ** 2))
> > +     _make_device $i/d1 $((100 * 1024 ** 2))
> > +done
> > +
> > +for i in `seq 0 2`; do
> > +     $SHEEP $STORE/$i/,$STORE/$i/d0/,$STORE/$i/d1/ -z $i -p
> $((7000+$i)) -c $DRIVER $SHEEP_OPTIONS
> > +done
> > +
> > +_wait_for_sheep 3
> > +
> > +_cluster_format -c 2:1
> > +
> > +_vdi_create test 99M
> > +
> > +_random | $DOG vdi write test
> > +
> > +$DOG vdi read test | md5sum > $STORE/csum.1
> > +
> > +# remove obj directory to occut EIO
> > +umount $STORE/0/d0
> > +rm -rf $STORE/0/d0
> > +
> > +$DOG vdi read test | md5sum > $STORE/csum.2
> > +
> > +diff -u $STORE/csum.1 $STORE/csum.2
> > +
> > +for i in `seq 0 2`; do
> > +     umount $STORE/$i/d0 &> /dev/null
> > +     umount $STORE/$i/d1 &> /dev/null
> > +done
>
> you _make_device $i but don't umount it.
>

The script 'check' will call _cleanup() in common.rc, and then
_cleanup_devices() which will umount all loop device.

the test case such as 011 064 also use _make_device without umounting them
because 'check' do it automaticly.

>
> Thanks
> Yuan
>



-- 
--
Best Regard
Robin Dong
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wpkg.org/pipermail/sheepdog/attachments/20140618/7171339c/attachment-0004.html>


More information about the sheepdog mailing list