def test_install_hook_git(self):
     self.git_install_requested.return_value = True
     self.determine_packages.return_value = ['foo', 'bar']
     repo = 'cloud:trusty-juno'
     openstack_origin_git = {
         'repositories': [
             {
                 'name': 'requirements',
                 'repository':
                 'git://git.openstack.org/openstack/requirements',  # noqa
                 'branch': 'stable/juno'
             },
             {
                 'name': 'nova',
                 'repository': 'git://git.openstack.org/openstack/nova',
                 'branch': 'stable/juno'
             }
         ],
         'directory':
         '/mnt/openstack-git',
     }
     projects_yaml = yaml.dump(openstack_origin_git)
     self.test_config.set('openstack-origin', repo)
     self.test_config.set('openstack-origin-git', projects_yaml)
     hooks.install()
     self.configure_installation_source.assert_called_with(repo)
     self.assertTrue(self.apt_update.called)
     self.apt_install.assert_called_with(['foo', 'bar'], fatal=True)
     self.git_install.assert_called_with(projects_yaml)
     self.assertTrue(self.execd_preinstall.called)
Пример #2
0
 def test_install_hook(self):
     repo = 'cloud:precise-grizzly'
     self.test_config.set('openstack-origin', repo)
     self.determine_packages.return_value = ['foo', 'bar']
     hooks.install()
     self.configure_installation_source.assert_called_with(repo)
     self.assertTrue(self.apt_update.called)
     self.apt_install.assert_called_with(['foo', 'bar'], fatal=True)
     self.assertTrue(self.execd_preinstall.called)
 def test_install_hook(self):
     repo = 'cloud:precise-grizzly'
     self.test_config.set('openstack-origin', repo)
     self.determine_packages.return_value = ['foo', 'bar']
     hooks.install()
     self.configure_installation_source.assert_called_with(repo)
     self.assertTrue(self.apt_update.called)
     self.apt_install.assert_called_with(['foo', 'bar'], fatal=True)
     self.assertTrue(self.execd_preinstall.called)
 def test_install_hook(self, _os_release, _kv):
     repo = 'cloud:precise-grizzly'
     self.test_config.set('openstack-origin', repo)
     self.determine_packages.return_value = ['foo', 'bar']
     _os_release.return_value = 'rocky'
     hooks.install()
     self.configure_installation_source.assert_called_with(repo)
     self.assertTrue(self.apt_update.called)
     self.apt_install.assert_called_with(['foo', 'bar'], fatal=True)
     self.assertTrue(self.execd_preinstall.called)
     _os_release.return_value = 'stein'
     kv = MagicMock()
     _kv.return_value = kv
     hooks.install()
     kv.set.assert_called_once_with(hooks.USE_FQDN_KEY, True)
     kv.flush.assert_called_once_with()
 def test_install_hook_git(self):
     self.git_install_requested.return_value = True
     self.determine_packages.return_value = ['foo', 'bar']
     repo = 'cloud:trusty-juno'
     openstack_origin_git = {
         'repositories': [
             {'name': 'requirements',
              'repository': 'git://git.openstack.org/openstack/requirements',  # noqa
              'branch': 'stable/juno'},
             {'name': 'nova',
              'repository': 'git://git.openstack.org/openstack/nova',
              'branch': 'stable/juno'}
         ],
         'directory': '/mnt/openstack-git',
     }
     projects_yaml = yaml.dump(openstack_origin_git)
     self.test_config.set('openstack-origin', repo)
     self.test_config.set('openstack-origin-git', projects_yaml)
     hooks.install()
     self.configure_installation_source.assert_called_with(repo)
     self.assertTrue(self.apt_update.called)
     self.apt_install.assert_called_with(['foo', 'bar'], fatal=True)
     self.git_install.assert_called_with(projects_yaml)
     self.assertTrue(self.execd_preinstall.called)