Merge lp:~benji/lpsetup/more-tarmac-friendly into lp:lpsetup

Proposed by Benji York
Status: Merged
Approved by: Benji York
Approved revision: 50
Merged at revision: 50
Proposed branch: lp:~benji/lpsetup/more-tarmac-friendly
Merge into: lp:lpsetup
Diff against target: 66 lines (+22/-3)
2 files modified
README.rst (+15/-0)
lpsetup/tests/integration/non-lxc.py (+7/-3)
To merge this branch: bzr merge lp:~benji/lpsetup/more-tarmac-friendly
Reviewer Review Type Date Requested Status
Brad Crittenden (community) code Approve
Review via email: mp+114263@code.launchpad.net

Commit message

make the integration test run without prompting for anything (if you follow the instructions in the README)

Description of the change

This branch makes the integration test more tarmac friendly by reducing
the number of prompts generated and providing a way to totally remove
them by adding SSH configuration.

I decided to use the -o option to juju ssh and juju scp even though it
is unnecessary if the SSH config changes given in the README are used
because this way even a user who hasn't read the README or who doesn't
want to make the changes still gets some benefit.

Bonus: I also added a bit about how to install and use the PEP-8 checker.

To post a comment you must log in.
Revision history for this message
Brad Crittenden (bac) wrote :

Looks good.

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'README.rst'
2--- README.rst 2012-07-09 20:55:44 +0000
3+++ README.rst 2012-07-10 20:10:23 +0000
4@@ -56,6 +56,13 @@
5 you must create an appropriately configured juju environment with that
6 name before running the tests.
7
8+You may also want to add this to your SSH .config file to suppress the
9+many yes/no prompts:
10+
11+ Host *.amazonaws.com
12+ StrictHostKeyChecking no
13+ UserKnownHostsFile /dev/null
14+
15
16 Linting
17 ~~~~~~~
18@@ -70,6 +77,14 @@
19
20 pocketlint lpsetup/**/*.py
21
22+Install pep8::
23+
24+ sudo apt-get install pep8
25+
26+Run pep8::
27+
28+ pep8 lpsetup/**/*.py
29+
30
31 lp-lxc-ip
32 =========
33
34=== modified file 'lpsetup/tests/integration/non-lxc.py'
35--- lpsetup/tests/integration/non-lxc.py 2012-07-10 16:16:39 +0000
36+++ lpsetup/tests/integration/non-lxc.py 2012-07-10 20:10:23 +0000
37@@ -26,7 +26,9 @@
38 if type(args) == str:
39 args = args.split()
40
41- check_call('juju ssh 1 -e lpsetup-testing'.split() + list(args))
42+ check_call('juju ssh 1 -o StrictHostKeyChecking=no'
43+ ' -o UserKnownHostsFile=/dev/null -e lpsetup-testing'.split()
44+ + list(args))
45
46
47 def check_environment():
48@@ -66,7 +68,9 @@
49 on_remote('sudo apt-add-repository --yes ppa:yellow/ppa')
50 on_remote('sudo apt-get update')
51 on_remote('sudo apt-get install python-shelltoolbox')
52- check_call('juju scp -e lpsetup-testing -r . 1:lpsetup'.split())
53+ check_call('juju scp -o StrictHostKeyChecking=no'
54+ ' -o UserKnownHostsFile=/dev/null -e lpsetup-testing'
55+ ' -r . 1:lpsetup'.split())
56
57
58 def do_test():
59@@ -80,7 +84,7 @@
60
61 def tear_down():
62 banner('Cleaning up.')
63- code = os.system('juju destroy-environment -e lpsetup-testing')
64+ code = os.system('echo y | juju destroy-environment -e lpsetup-testing')
65 if code != 0:
66 raise RuntimeError('Destroying the test juju environment failed.')
67

Subscribers

People subscribed via source and target branches

to all changes: