~hopem/charms/trusty/neutron-openvswitch/lp1500386

« back to all changes in this revision

Viewing changes to unit_tests/test_neutron_ovs_utils.py

  • Committer: james.page at ubuntu
  • Date: 2015-06-10 14:01:59 UTC
  • mfrom: (62.1.32 neutron-openvswitch)
  • Revision ID: james.page@ubuntu.com-20150610140159-83k3sr2pq07gs4a3
Adds support for:

* Use a Python virtualenv when deploying from source
* Default to shallow clone for git (depth=1)
* Pass http_proxy to pip installs if specified

Show diffs side-by-side

added added

removed removed

Lines of Context:
265
265
    @patch.object(nutils, 'render')
266
266
    @patch('os.path.join')
267
267
    @patch('os.path.exists')
 
268
    @patch('os.symlink')
268
269
    @patch('shutil.copytree')
269
270
    @patch('shutil.rmtree')
270
 
    def test_git_post_install(self, rmtree, copytree, exists, join, render,
271
 
                              service_restart, git_src_dir):
 
271
    def test_git_post_install(self, rmtree, copytree, symlink, exists, join,
 
272
                              render, service_restart, git_src_dir):
272
273
        projects_yaml = openstack_origin_git
273
274
        join.return_value = 'joined-string'
274
275
        nutils.git_post_install(projects_yaml)
278
279
            call('joined-string', '/etc/neutron/rootwrap.d'),
279
280
        ]
280
281
        copytree.assert_has_calls(expected)
 
282
        expected = [
 
283
            call('joined-string', '/usr/local/bin/neutron-rootwrap'),
 
284
        ]
 
285
        symlink.assert_has_calls(expected, any_order=True)
281
286
        neutron_ovs_agent_context = {
282
287
            'service_description': 'Neutron OpenvSwitch Plugin Agent',
283
288
            'charm_name': 'neutron-openvswitch',
284
289
            'process_name': 'neutron-openvswitch-agent',
 
290
            'executable_name': 'joined-string',
285
291
            'cleanup_process_name': 'neutron-ovs-cleanup',
286
292
            'plugin_config': '/etc/neutron/plugins/ml2/ml2_conf.ini',
287
293
            'log_file': '/var/log/neutron/openvswitch-agent.log',
290
296
            'service_description': 'Neutron OpenvSwitch Cleanup',
291
297
            'charm_name': 'neutron-openvswitch',
292
298
            'process_name': 'neutron-ovs-cleanup',
 
299
            'executable_name': 'joined-string',
293
300
            'log_file': '/var/log/neutron/ovs-cleanup.log',
294
301
        }
295
302
        expected = [