Centralize the SSH testing and make it more automatic.

Review Request #2330 — Created May 1, 2011 and submitted

Review Board
Centralize the SSH testing and make it more automatic.

SSH repository testing previously required a lot of setup, in terms of
creating repositories, configuring the access to them in settings_local.py,
and configuring SSH keys.

Now we use bundled repositories, and skip the tests if the user's public key
isn't in their ~/.ssh/authorized_keys file. We need the authorized key to
run the tests.

It's assumed if that file exists and the key is in it, SSH is configured on
the system. Otherwise, the tests will fail.
All the unit tests passed, without needing my special repository VM or special
SSH key setup. I just needed to have SSH turned on and
echo ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys.
  2. reviewboard/scmtools/bzr.py (Diff revision 1)
    What is this change?
    1. BZRTool wasn't interpreting the HEAD revision object, so this just adds support. I first encountered it during the tests.
  3. reviewboard/scmtools/sshutils.py (Diff revision 1)
    When would this happen?
    1. The original usage was an inline declaration at a global level in the tests to see if the key was authorized. The key could be None, since it was passed from get_user_key(). I guess that's not needed now.
  4. reviewboard/scmtools/sshutils.py (Diff revision 1)
    This doesn't stomp on your _ import?
    I wonder if authorized_key = line.split()[1] wouldn't be clearer, as well.
Review request changed
  1. Ship It!