server: add unit tests

Make test coverage >= 90%

#1019 
@jonboulle I am not so happy with it, too.
But I think it is fine for this test because it involves one etcd Server only, and we just need it to go forward.