'When the SSH connection is established, if the
``~/.ssh/authorized_keys`` file already has the public part of the key
pair then it is not appended again.'

def test_authorized_keys_already_in_place(self):

    configuring = deferToThread(self.configure_ssh, self.server.ip, self.server.port)
    configuring.addCallback((lambda ignored: deferToThread(self.configure_ssh, self.server.ip, self.server.port)))
    def configured(ignored):
        id_rsa_pub = self.ssh_config.child('id_rsa_flocker.pub')
        keys = self.server.home.descendant(['.ssh', 'authorized_keys'])
        self.assertEqual(goodlines(id_rsa_pub), goodlines(keys))
    configuring.addCallback(configured)
    return configuring
