raft: add tests based on section 5.3 in raft paper

for #1408 
i care about the cleanness of the codebase very much.