Esempio n. 1
0
 def test_determine_packages(self, token_cache_pkgs):
     self.config.side_effect = None
     token_cache_pkgs.return_value = []
     ex = utils.PACKAGES
     self.assertEqual(set(ex), set(utils.determine_packages()))
     token_cache_pkgs.return_value = ['memcached']
     ex.append('memcached')
     self.assertEqual(set(ex), set(utils.determine_packages()))
Esempio n. 2
0
 def test_determine_packages_git(self, git_install_requested):
     git_install_requested.return_value = True
     result = utils.determine_packages()
     ex = utils.PACKAGES + utils.BASE_GIT_PACKAGES
     for p in utils.GIT_PACKAGE_BLACKLIST:
         ex.remove(p)
     self.assertEquals(set(ex), set(result))
 def test_determine_packages_git(self, git_install_requested):
     git_install_requested.return_value = True
     result = utils.determine_packages()
     ex = utils.PACKAGES + utils.BASE_GIT_PACKAGES
     for p in utils.GIT_PACKAGE_BLACKLIST:
         ex.remove(p)
     self.assertEquals(set(ex), set(result))
Esempio n. 4
0
 def test_openstack_upgrade_not_leader(self, git_requested, migrate):
     git_requested.return_value = True
     self.config.side_effect = None
     self.config.return_value = 'cloud:precise-havana'
     self.is_elected_leader.return_value = False
     self.get_os_codename_install_source.return_value = 'havana'
     configs = MagicMock()
     utils.do_openstack_upgrade(configs)
     self.assertTrue(configs.write_all.called)
     self.apt_install.assert_called_with(utils.determine_packages(),
                                         fatal=True)
     self.apt_upgrade.assert_called_with(options=DPKG_OPTS,
                                         fatal=True, dist=True)
     configs.set_release.assert_called_with(openstack_release='havana')
     self.assertFalse(migrate.called)
 def test_openstack_upgrade_not_leader(self, git_requested, migrate):
     git_requested.return_value = True
     self.config.side_effect = None
     self.config.return_value = 'cloud:precise-havana'
     self.is_elected_leader.return_value = False
     self.get_os_codename_install_source.return_value = 'havana'
     configs = MagicMock()
     utils.do_openstack_upgrade(configs)
     self.assertTrue(configs.write_all.called)
     self.apt_install.assert_called_with(utils.determine_packages(),
                                         fatal=True)
     self.apt_upgrade.assert_called_with(options=DPKG_OPTS,
                                         fatal=True, dist=True)
     configs.set_release.assert_called_with(openstack_release='havana')
     self.assertFalse(migrate.called)
Esempio n. 6
0
 def test_determine_packages(self, git_install_requested):
     git_install_requested.return_value = False
     result = utils.determine_packages()
     ex = utils.PACKAGES
     self.assertEquals(set(ex), set(result))
 def test_determine_packages(self, git_install_requested):
     git_install_requested.return_value = False
     result = utils.determine_packages()
     ex = utils.PACKAGES
     self.assertEquals(set(ex), set(result))