[sheepdog] [PATCH] Add test case to test data integrity after changing my address of sheep process

Liu Yuan namei.unix at gmail.com
Thu Mar 6 08:36:06 CET 2014


On Thu, Mar 06, 2014 at 12:10:29PM +0800, Ruoyu wrote:
> If modifying the "my address" of sheep process parameter without intention, the cluster treates it as a new node so that we know the operation is wrong. However, when trying to revert, we find out the prior created vdi is lost.
> 
> new: tests/functional/088 and 088.out: test case and expected output
> modified: tests/functional/common.filter: add function of filtering ip address
> modified: tests/functional/group: test case name and define
> 
> Signed-off-by: Ruoyu <liangry at ucweb.com>
> ---
>  tests/functional/088           | 50 ++++++++++++++++++++++++++++++++++++++++++
>  tests/functional/088.out       | 41 ++++++++++++++++++++++++++++++++++
>  tests/functional/common.filter |  5 +++++
>  tests/functional/group         |  1 +
>  4 files changed, 97 insertions(+)
>  create mode 100755 tests/functional/088
>  create mode 100644 tests/functional/088.out
> 
> diff --git a/tests/functional/088 b/tests/functional/088
> new file mode 100755
> index 0000000..f7dda79
> --- /dev/null
> +++ b/tests/functional/088
> @@ -0,0 +1,50 @@
> +#!/bin/bash
> +
> +# Test data integrity after changing my address (sheep -y <myaddr>)
> +
> +. ./common
> +
> +# Is there an easier and more robust way to do this?
> +MY_ADDR=`netstat -n -t | awk '{print $4}' | grep -o "[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*" | grep -v "127.0.0.1" | sort -u | head -1`

MY_ADDR=`hostname -I | awk '{print $1}'`

is better and actually your bash didn't get the correct IP address and I met
a hang running this 088.

Thanks
Yuan




More information about the sheepdog mailing list