p2p: add test for NewPeer