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
=== modified file 'tarmac.sh'
--- tarmac.sh 2014-02-05 20:34:52 +0000
+++ tarmac.sh 2014-02-05 23:21:33 +0000
@@ -39,3 +39,8 @@
39 ./$x/setup.py develop39 ./$x/setup.py develop
40 ./$x/setup.py test40 ./$x/setup.py test
41done41done
42
43echo "== Testing ./juju-deployer/test_deploy.py ...."
44USER=foo ./juju-deployer/test_deploy.py
45echo "== Testing ./tests/test_run.py ...."
46./tests/test_run.py
4247
=== modified file 'tests/test_run.py'
--- tests/test_run.py 2014-02-05 15:26:12 +0000
+++ tests/test_run.py 2014-02-05 23:21:33 +0000
@@ -8,6 +8,7 @@
8import shutil8import shutil
9import os9import os
10import logging10import logging
11import stat
11import swiftclient12import swiftclient
12from novaclient.exceptions import NotFound13from novaclient.exceptions import NotFound
1314
@@ -68,7 +69,9 @@
68 self.assertTrue(os.path.exists(os.path.join(amulet_dir, '.bzr')))69 self.assertTrue(os.path.exists(os.path.join(amulet_dir, '.bzr')))
69 self.assertEqual(os.environ['PYTHONPATH'], '%s' % amulet_dir)70 self.assertEqual(os.environ['PYTHONPATH'], '%s' % amulet_dir)
7071
71 def test_needs_bootstrap(self):72 @mock.patch('run._get_control_bucket',
73 return_value='juju-d911b43e427c204cfcfd8c7276c4b2aa')
74 def test_needs_bootstrap(self, mock_get_control_bucket):
72 provider_state = '{ state-instances: ["abcdefg"] }'75 provider_state = '{ state-instances: ["abcdefg"] }'
73 with mock.patch('run._get_from_swift', return_value=provider_state):76 with mock.patch('run._get_from_swift', return_value=provider_state):
74 # Bootstrap needed - the bucket exists but the instance does not.77 # Bootstrap needed - the bucket exists but the instance does not.
@@ -98,10 +101,8 @@
98 fp.flush()101 fp.flush()
99 self.assertTrue(run.check_sudoers(fp.name))102 self.assertTrue(run.check_sudoers(fp.name))
100103
101 # Unreadable.104 os.fchmod(fp.fileno(), stat.S_IWUSR)
102 e = IOError(13, 'Permission denied')105 self.assertTrue(run.check_sudoers(fp.name))
103 with mock.patch('__builtin__.open', side_effect=e):
104 self.assertTrue(run.check_sudoers())
105106
106 def test_check_juju_version(self):107 def test_check_juju_version(self):
107 with mock.patch('subprocess.check_output', return_value='1.16.4'):108 with mock.patch('subprocess.check_output', return_value='1.16.4'):

Subscribers

People subscribed via source and target branches