{"action":"created","issue":{"url":"https://api.github.com/repos/sheepdog/sheepdog/issues/241","repository_url":"https://api.github.com/repos/sheepdog/sheepdog","labels_url":"https://api.github.com/repos/sheepdog/sheepdog/issues/241/labels{/name}","comments_url":"https://api.github.com/repos/sheepdog/sheepdog/issues/241/comments","events_url":"https://api.github.com/repos/sheepdog/sheepdog/issues/241/events","html_url":"https://github.com/sheepdog/sheepdog/pull/241","id":154636673,"number":241,"title":"tests: Add operation test","user":{"login":"tmenjo","id":1230201,"avatar_url":"https://avatars.githubusercontent.com/u/1230201?v=3","gravatar_id":"","url":"https://api.github.com/users/tmenjo","html_url":"https://github.com/tmenjo","followers_url":"https://api.github.com/users/tmenjo/followers","following_url":"https://api.github.com/users/tmenjo/following{/other_user}","gists_url":"https://api.github.com/users/tmenjo/gists{/gist_id}","starred_url":"https://api.github.com/users/tmenjo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tmenjo/subscriptions","organizations_url":"https://api.github.com/users/tmenjo/orgs","repos_url":"https://api.github.com/users/tmenjo/repos","events_url":"https://api.github.com/users/tmenjo/events{/privacy}","received_events_url":"https://api.github.com/users/tmenjo/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-05-13T05:29:17Z","updated_at":"2016-05-16T03:02:53Z","closed_at":"2016-05-13T05:31:56Z","pull_request":{"url":"https://api.github.com/repos/sheepdog/sheepdog/pulls/241","html_url":"https://github.com/sheepdog/sheepdog/pull/241","diff_url":"https://github.com/sheepdog/sheepdog/pull/241.diff","patch_url":"https://github.com/sheepdog/sheepdog/pull/241.patch"},"body":"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.\r\n\r\nThis introduces \"operation test\" in tests/operation to test RPCs. It is written in Python, and contains two main modules:\r\n\r\n 1. sheep.py: providing Sheepdog RPCs\r\n\r\n    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.\r\n\r\n 2. fixture.py: providing testing fixtures\r\n\r\n    We can start sheep processes with temporary disks and run some dog commands with this.\r\n\r\nNow we can make RPC tests using these modules and PyUnit framework, easier-to-write than unit test and finer-grained than functional test.\r\n\r\nI think this is useful to test patches related to RPCs, such as pull request #168.\r\n"},"comment":{"url":"https://api.github.com/repos/sheepdog/sheepdog/issues/comments/219339247","html_url":"https://github.com/sheepdog/sheepdog/pull/241#issuecomment-219339247","issue_url":"https://api.github.com/repos/sheepdog/sheepdog/issues/241","id":219339247,"user":{"login":"tmenjo","id":1230201,"avatar_url":"https://avatars.githubusercontent.com/u/1230201?v=3","gravatar_id":"","url":"https://api.github.com/users/tmenjo","html_url":"https://github.com/tmenjo","followers_url":"https://api.github.com/users/tmenjo/followers","following_url":"https://api.github.com/users/tmenjo/following{/other_user}","gists_url":"https://api.github.com/users/tmenjo/gists{/gist_id}","starred_url":"https://api.github.com/users/tmenjo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tmenjo/subscriptions","organizations_url":"https://api.github.com/users/tmenjo/orgs","repos_url":"https://api.github.com/users/tmenjo/repos","events_url":"https://api.github.com/users/tmenjo/events{/privacy}","received_events_url":"https://api.github.com/users/tmenjo/received_events","type":"User","site_admin":false},"created_at":"2016-05-16T03:02:53Z","updated_at":"2016-05-16T03:02:53Z","body":"@mitake @pttpzp Thanks! :)\r\n\r\nTo supplement, this PR has a very simple test for #168 `get_vdis_from()` as `ThreeNodesTwoCopiesTest.testGetVDIsFrom`. To enhance and run this, I believe we can merge #168 with confidence."}}