tests/064: fix wrong output

The result of 'collie node list' in 064.out is not reweighted.  This
fixes it.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>
tests: remove 063 and 064 from md group

These tests assume that -md option is not specified.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>
tests: count the number of objects instead of using node/md info

This introduces helpers _node_info() and _md_info() to count all the
objects in the store dictory.  By using this function instead of
'collie node info' and 'collie node md info', we can get the unique
output in spite of the underlying filesystem.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>
tests: add support for running check outside tests directory

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>
tests: don't use /tmp for each test

Any files under /tmp can be removed by the succeeding tests.  Creating
a temporary file under $STORE allows us to check the testing results
later.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>
tests: add support for running testcase file directly

Currently, out test framework assumes that all the testcases are
executed via check script.  To run a testcase script directly
(e.g. sudo ./001), this patch moves a variable MD to common.config,
assigns the default value to STORE, and makes 'iam' a global variable.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>
tests/064: exclude non-deterministic line from result

The content of store 2 is not deterministic since we kill sheep 2
while reweighting is ongoing.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>
tests: move tests to tests/functional

Signed-off-by: Kai Zhang <kyle@zelin.io>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>
functional/047: fix md test

If we use a different WD for this test, the objects can be stored to
other disks than d2.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>
functional: add wrapper _cluster_format

This introduces a helper _cluster_format to wait for all the sheeps to
be running.  This removes sleep after 'collie cluster format' and
reduces the possibility of causing a false alarm.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>
tests/functional: fixed wrong error message

v2:
- fixed indention error

Signed-off-by: Kai Zhang <kyle@zelin.io>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>
functional: add 065 to test cache push

This can reproduce the bug fixed by
"sheep: check local request if it is in recovery"

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
functional: add 066 to stress test object cache

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
tests/functional: add support for specifying valgrind options

This enables us to run valgrind with user defined options.

For example, to do the valgrind test on the small memory (less than 2
GB) machine, try the following command:

 # VALGRIND_OPTIONS="--freelist-vol=10000000 --freelist-big-blocks=0" ./check -valgrind

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>
tests/functional: add 067 for testing concurrent start up

Signed-off-by: Kai Zhang <kyle@zelin.io>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>
tests/functional: add 068 for testing rejoin cluster

Signed-off-by: Kai Zhang <kyle@zelin.io>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>
tests/functional: add test to check wrong node joining with newer epoch

This test can be passed after I refined the sheepdog start-up
procedure, but it's still meaningful to have this test for detecting
degradation.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>
tests/functional: test join to the clean cluster

This test can be passed with the next patch.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>
tests/functional: add test for reading/writing partially zeroed data

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>
tests/func: test restart with missing object in stale directory

Current stable-0.6 can't pass this script but master can.

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>