[sheepdog] [sheepdog/sheepdog] dc909f: tests: Add operation test

Hitoshi Mitake mitake.hitoshi at gmail.com
Fri May 13 07:31:57 CEST 2016


  Branch: refs/heads/master
  Home:   https://github.com/sheepdog/sheepdog
  Commit: dc909f50377952cefc3cf6b1295e4533a5b5ac70
      https://github.com/sheepdog/sheepdog/commit/dc909f50377952cefc3cf6b1295e4533a5b5ac70
  Author: Takashi Menjo <menjo.takashi at lab.ntt.co.jp>
  Date:   2016-05-13 (Fri, 13 May 2016)

  Changed paths:
    A tests/operation/README.md
    A tests/operation/fixture.py
    A tests/operation/proto.py
    A tests/operation/sheep.py
    A tests/operation/test_3nodes_2copies.py
    A tests/operation/test_fixture.py

  Log Message:
  -----------
  tests: Add operation test

Sheepdog RPCs i.e. `SD_OP_*` cannot be tested easily with existing
testing ways. Writing such tests as unit tests in C is boring.
Functional tests are not so fine-grained as to make such tests.

This introduces "operation test" in tests/operation to test RPCs.
It is written in Python, and contains two main modules:

 1. sheep.py: providing Sheepdog RPCs

    A basic RPC way like as executing `*_exec_req` is implemented.
    Wrapper methods are also implemented for some RPCs to handle
    their return values like as C struct.

 2. fixture.py: providing testing fixtures

    We can start sheep processes with temporary disks and run some
    dog commands with this.

Now we can make RPC tests using these modules and PyUnit framework,
easier-to-write than unit test and finer-grained than functional
test.

I think this is useful to test patches related to RPCs, such as pull
request #168.

Signed-off-by: YAMADA Hideki <yamada.hideki at lab.ntt.co.jp>
Signed-off-by: Takashi Menjo <menjo.takashi at lab.ntt.co.jp>


  Commit: a996dfb62b409ab7e7677528bb54209b29c1e439
      https://github.com/sheepdog/sheepdog/commit/a996dfb62b409ab7e7677528bb54209b29c1e439
  Author: Hitoshi Mitake <mitake.hitoshi at gmail.com>
  Date:   2016-05-13 (Fri, 13 May 2016)

  Changed paths:
    A tests/operation/README.md
    A tests/operation/fixture.py
    A tests/operation/proto.py
    A tests/operation/sheep.py
    A tests/operation/test_3nodes_2copies.py
    A tests/operation/test_fixture.py

  Log Message:
  -----------
  Merge pull request #241 from tmenjo/operation-test

tests: Add operation test


Compare: https://github.com/sheepdog/sheepdog/compare/8c888c0d5f35...a996dfb62b40


More information about the sheepdog mailing list