Exemple #1
0
 def test_install_hook_git(self):
     self.git_install_requested.return_value = True
     self.determine_packages.return_value = ['foo', 'bar']
     self.determine_ports.return_value = [80, 81, 82]
     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.git_install.assert_called_with(projects_yaml)
     self.apt_install.assert_called_with(['foo', 'bar'], fatal=True)
     self.assertTrue(self.execd_preinstall.called)
     self.assertTrue(self.disable_services.called)
     self.cmd_all_services.assert_called_with('stop')
 def test_install_hook_git(self):
     self.git_install_requested.return_value = True
     self.determine_packages.return_value = ['foo', 'bar']
     self.determine_ports.return_value = [80, 81, 82]
     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.git_install.assert_called_with(projects_yaml)
     self.apt_install.assert_called_with(['foo', 'bar'], fatal=True)
     self.assertTrue(self.execd_preinstall.called)
     self.assertTrue(self.disable_services.called)
     self.cmd_all_services.assert_called_with('stop')
 def test_install_hook(self):
     self.determine_packages.return_value = [
         'nova-scheduler', 'nova-api-ec2']
     self.determine_ports.return_value = [80, 81, 82]
     hooks.install()
     self.apt_install.assert_called_with(
         ['nova-scheduler', 'nova-api-ec2'], fatal=True)
     self.execd_preinstall.assert_called()
Exemple #4
0
 def test_install_hook(self):
     self.determine_packages.return_value = [
         'nova-scheduler', 'nova-api-ec2']
     self.determine_ports.return_value = [80, 81, 82]
     hooks.install()
     self.apt_install.assert_called_with(
         ['nova-scheduler', 'nova-api-ec2'], fatal=True)
     self.assertTrue(self.execd_preinstall.called)
     self.assertTrue(self.disable_services.called)
     self.cmd_all_services.assert_called_with('stop')