Merge lp:~stevenk/launchpad/poppy-sftp-test-isolation into lp:launchpad

Proposed by Steve Kowalik
Status: Merged
Approved by: Steve Kowalik
Approved revision: no longer in the source branch.
Merged at revision: 10954
Proposed branch: lp:~stevenk/launchpad/poppy-sftp-test-isolation
Merge into: lp:launchpad
Diff against target: 12 lines (+2/-0)
1 file modified
lib/lp/poppy/tests/test_poppy.py (+2/-0)
To merge this branch: bzr merge lp:~stevenk/launchpad/poppy-sftp-test-isolation
Reviewer Review Type Date Requested Status
Jelmer Vernooij (community) code Approve
Review via email: mp+26717@code.launchpad.net

Description of the change

This branch removes the SSH_AUTH_SOCK environment variable when running the poppy sftp tests, which stops paramiko doing silly things, like asking the locally running ssh-agent to hand over all its keys.

To post a comment you must log in.
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Thanks, +1.

It would be nice to see some of this test infrastructure factored out. Ideally paramiko could probably provide some helper functions for this, rather than seeing it duplicated in both Bazaar, Launchpad and possible other paramiko users.

review: Approve (code)
Revision history for this message
Robert Collins (lifeless) wrote :

Yup; or just use bzr's TestCase as a base, where you can.

Having it as a 'fixture' per my recent blog post
http://rbtcollins.wordpress.com/2010/05/10/maintainable-pyunit-test-suites/
would be nicer though.

-Rob

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/poppy/tests/test_poppy.py'
2--- lib/lp/poppy/tests/test_poppy.py 2010-05-27 07:11:05 +0000
3+++ lib/lp/poppy/tests/test_poppy.py 2010-06-03 15:40:55 +0000
4@@ -111,6 +111,8 @@
5 os.path.join(os.path.dirname(__file__), 'poppy-sftp'),
6 os.path.join(self._home_dir, '.ssh', 'id_rsa'))
7 self._current_home = os.environ['HOME']
8+ # We'd rather not have an agent interfere
9+ os.environ.pop('SSH_AUTH_SOCK', None)
10 os.environ['HOME'] = self._home_dir
11 # XXX: Just blat over the BZR_SSH env var. Restoring env vars is a
12 # little tricky, see lp.testing.TestCaseWithFactory.useTempBzrHome.