[sheepdog] [PATCH v1 2/2] test: add test case for data path with slash
Liu Yuan
namei.unix at gmail.com
Mon Jun 16 12:05:51 CEST 2014
On Mon, Jun 16, 2014 at 05:47:14PM +0800, Robin Dong wrote:
> From: Robin Dong <sanbai at taobao.com>
>
> Siged-off-by: Robin Dong <sanbai at taobao.com>
> ---
> tests/functional/095 | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
> tests/functional/group | 1 +
> 2 files changed, 50 insertions(+)
> create mode 100755 tests/functional/095
>
> diff --git a/tests/functional/095 b/tests/functional/095
> new file mode 100755
> index 0000000..b4ff2f6
> --- /dev/null
> +++ b/tests/functional/095
> @@ -0,0 +1,49 @@
> +#!/bin/bash
> +
> +# Test disk error handling with full path name
> +
> +. ./common
> +
> +# make different size of devices
> +for i in `seq 0 2`; do
> + dd if=/dev/zero of=$STORE/big$i.img seek=1048576 bs=1M count=1 &> /dev/null
> + dd if=/dev/zero of=$STORE/small$i.img seek=512 bs=1M count=1 &> /dev/null
> +
> + mkops="-t ext4 -q -F -O ^has_journal -I 128 -N 100"
> + mntops="-o user_xattr"
> +
> + mkfs $mkops $STORE/big$i.img 2>&1
> + mkdir -p $STORE/$i/d0
> + mount -o loop $mntops $STORE/big$i.img $STORE/$i/d0
> +
> + mkfs $mkops $STORE/small$i.img 2>&1
> + mkdir -p $STORE/$i/d1
> + mount -o loop $mntops $STORE/small$i.img $STORE/$i/d1
> +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
> +exit 0
> +for i in `seq 0 2`; do
> + umount $STORE/$i/d0 &> /dev/null
> + umount $STORE/$i/d1 &> /dev/null
> +done
Cleanup aren't called because you exit alrady.
Thanks
Yuan
More information about the sheepdog
mailing list