559
563
self.test_config.set('manage-neutron-plugin-legacy-mode', False)
560
564
manage = nutils.manage_plugin()
561
565
self.assertFalse(manage)
567
def test_additional_install_locations_calico(self):
568
self.get_os_codename_install_source.return_value = 'icehouse'
569
nutils.additional_install_locations('Calico', '')
570
self.add_source.assert_called_with('ppa:project-calico/icehouse')
572
def test_unusual_calico_install_location(self):
573
self.test_config.set('calico-origin', 'ppa:testppa/project-calico')
574
nutils.additional_install_locations('Calico', '')
575
self.add_source.assert_called_with('ppa:testppa/project-calico')
577
def test_follows_openstack_origin(self):
578
self.get_os_codename_install_source.return_value = 'juno'
579
nutils.additional_install_locations('Calico', 'cloud:trusty-juno')
580
self.add_source.assert_called_with('ppa:project-calico/juno')
582
@patch('shutil.rmtree')
583
def test_force_etcd_restart(self, rmtree):
584
self.glob.glob.return_value = [
585
'/var/lib/etcd/one', '/var/lib/etcd/two'
587
nutils.force_etcd_restart()
588
self.service_stop.assert_called_once_with('etcd')
589
self.glob.glob.assert_called_once_with('/var/lib/etcd/*')
590
rmtree.assert_any_call('/var/lib/etcd/one')
591
rmtree.assert_any_call('/var/lib/etcd/two')
592
self.service_start.assert_called_once_with('etcd')