tests/unit: add missing copyright and license

Signed-off-by: Kai Zhang <kyle@zelin.io>
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
tests/unit: introduce mock

Mock is useful when we do unit test.

This patch introduce some useful macro to simply testing.

The two most useful macro are MOCK_METHOD and MOCK_VOID_METHOD.

MOCK_VOID_METHOD is used to mock method how has no return value.
For example:
void foo(int a, long b)
{
	return;
}

We define the mock method as:
MOCK_VOID_METHOD(foo, int a, long b)

MOCK_METHOD is used to mock method how has return value.
User have to specified the return value's type and the default return value.
For example:
bool foo(int a, long b)
{
	return true;
}

We define the mock method as:
MOCK_METHCO(foo, bool, true, int a, long b)

Use macro to define mock method has many benifits:
- we can record each call of the method and its arguments
- we can control the return value, based on input arguments

However, current implementation is quite initial.
We just record how many times the method is called.

Another useful macro is method_nr_call(method) which returns how many times the
method is called.

Signed-off-by: Kai Zhang <kyle@zelin.io>
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
tests/unit: use MOCK_METHOD when define mock method

Signed-off-by: Kai Zhang <kyle@zelin.io>
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
tests/unit: add test_cluster_driver

Signed-off-by: Kai Zhang <kyle@zelin.io>
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
sheep: add detail help message to sheep options

This will allow up to date usage about specific options shipped with binary

Usage:
yliu@ubuntu-precise:~/sheepdog$ sheep/sheep -w
sheep/sheep: option requires an argument -- 'w'
Available arguments:
	size=: size of the cache in megabyes
	dir=: path to the location of the cache(default: $STORE/cache)
	directio: use directio mode for cache IO, if not specified use buffered IO

Example:
	$ sheep -w size=200000,dir=/my_ssd,directio ...
This tries to use /my_ssd as the cache storage with 200G allocted to the cache in directio mode

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

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
sheep: add default value if any to sheep -h

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
cache: don't push read-only object

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