add tests for handshake