raft: move test helper function into tests
Merge pull request #1485 from jonboulle/raft_clean

raft: move test helper function into tests