Merge lp:~cjohnston/ubuntu-ci-services-itself/more-tarmac-testing into lp:ubuntu-ci-services-itself

Proposed by Chris Johnston
Status: Merged
Approved by: Chris Johnston
Approved revision: 216
Merged at revision: 215
Proposed branch: lp:~cjohnston/ubuntu-ci-services-itself/more-tarmac-testing
Merge into: lp:ubuntu-ci-services-itself
Diff against target: 48 lines (+11/-5)
2 files modified
tarmac.sh (+5/-0)
tests/test_run.py (+6/-5)
To merge this branch: bzr merge lp:~cjohnston/ubuntu-ci-services-itself/more-tarmac-testing
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Andy Doan (community) Approve
Chris Johnston (community) Needs Resubmitting
Review via email: mp+205057@code.launchpad.net

Commit message

Add juju-deployer/test_deploy.py and tests/test_run.py to tarmac testing

To post a comment you must log in.
Revision history for this message
Andy Doan (doanac) wrote :

46 + os.fchmod(fp.fileno(), stat.S_IWUSR)
47 + with mock.patch('__builtin__.open', side_effect=e):

I would think you'd need one or the other, but not both. ie - if you make the file non-readable, you shouldn't shouldn't need to mock. or if you mock, you shouldn't have to alter file permssions.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:215
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/91/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/91/rebuild

review: Approve (continuous-integration)
216. By Chris Johnston

Removes unneeded mock from sudoers test

Revision history for this message
Chris Johnston (cjohnston) :
review: Needs Resubmitting
Revision history for this message
Andy Doan (doanac) :
review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:216
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/92/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/92/rebuild

review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tarmac.sh'
2--- tarmac.sh 2014-02-05 20:34:52 +0000
3+++ tarmac.sh 2014-02-05 23:21:33 +0000
4@@ -39,3 +39,8 @@
5 ./$x/setup.py develop
6 ./$x/setup.py test
7 done
8+
9+echo "== Testing ./juju-deployer/test_deploy.py ...."
10+USER=foo ./juju-deployer/test_deploy.py
11+echo "== Testing ./tests/test_run.py ...."
12+./tests/test_run.py
13
14=== modified file 'tests/test_run.py'
15--- tests/test_run.py 2014-02-05 15:26:12 +0000
16+++ tests/test_run.py 2014-02-05 23:21:33 +0000
17@@ -8,6 +8,7 @@
18 import shutil
19 import os
20 import logging
21+import stat
22 import swiftclient
23 from novaclient.exceptions import NotFound
24
25@@ -68,7 +69,9 @@
26 self.assertTrue(os.path.exists(os.path.join(amulet_dir, '.bzr')))
27 self.assertEqual(os.environ['PYTHONPATH'], '%s' % amulet_dir)
28
29- def test_needs_bootstrap(self):
30+ @mock.patch('run._get_control_bucket',
31+ return_value='juju-d911b43e427c204cfcfd8c7276c4b2aa')
32+ def test_needs_bootstrap(self, mock_get_control_bucket):
33 provider_state = '{ state-instances: ["abcdefg"] }'
34 with mock.patch('run._get_from_swift', return_value=provider_state):
35 # Bootstrap needed - the bucket exists but the instance does not.
36@@ -98,10 +101,8 @@
37 fp.flush()
38 self.assertTrue(run.check_sudoers(fp.name))
39
40- # Unreadable.
41- e = IOError(13, 'Permission denied')
42- with mock.patch('__builtin__.open', side_effect=e):
43- self.assertTrue(run.check_sudoers())
44+ os.fchmod(fp.fileno(), stat.S_IWUSR)
45+ self.assertTrue(run.check_sudoers(fp.name))
46
47 def test_check_juju_version(self):
48 with mock.patch('subprocess.check_output', return_value='1.16.4'):

Subscribers

People subscribed via source and target branches