def test_install_hook_git(self, ensure_user, git_requested, os_release):
     git_requested.return_value = True
     repo = 'cloud:trusty-juno'
     openstack_origin_git = {
         'repositories': [
             {'name': 'requirements',
              'repository': 'git://git.openstack.org/openstack/requirements',  # noqa
              'branch': 'stable/juno'},
             {'name': 'keystone',
              'repository': 'git://git.openstack.org/openstack/keystone',
              '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.assertTrue(self.execd_preinstall.called)
     self.configure_installation_source.assert_called_with(repo)
     ensure_user.assert_called_with(user=self.ssh_user, group='keystone')
     self.assertTrue(self.apt_update.called)
     self.apt_install.assert_called_with(
         ['apache2', 'haproxy', 'libffi-dev', 'libmysqlclient-dev',
          'libssl-dev', 'libxml2-dev', 'libxslt1-dev', 'libyaml-dev',
          'openssl', 'pwgen', 'python-dev', 'python-keystoneclient',
          'python-mysqldb', 'python-pip', 'python-psycopg2',
          'python-setuptools', 'python-six', 'unison', 'uuid',
          'zlib1g-dev'], fatal=True)
     self.git_install.assert_called_with(projects_yaml)
 def test_install_hook_git(self, ensure_user, git_requested):
     git_requested.return_value = True
     repo = 'cloud:trusty-juno'
     openstack_origin_git = {
         'repositories': [
             {'name': 'requirements',
              'repository': 'git://git.openstack.org/openstack/requirements',  # noqa
              'branch': 'stable/juno'},
             {'name': 'keystone',
              'repository': 'git://git.openstack.org/openstack/keystone',
              '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.assertTrue(self.execd_preinstall.called)
     self.configure_installation_source.assert_called_with(repo)
     ensure_user.assert_called_with(user=self.ssh_user, group='keystone')
     self.assertTrue(self.apt_update.called)
     self.apt_install.assert_called_with(
         ['apache2', 'haproxy', 'libffi-dev', 'libmysqlclient-dev',
          'libssl-dev', 'libxml2-dev', 'libxslt1-dev', 'libyaml-dev',
          'openssl', 'pwgen', 'python-dev', 'python-keystoneclient',
          'python-mysqldb', 'python-pip', 'python-psycopg2',
          'python-setuptools', 'python-six', 'unison', 'uuid',
          'zlib1g-dev'], fatal=True)
     self.git_install.assert_called_with(projects_yaml)
 def test_install_hook(self, git_requested):
     git_requested.return_value = False
     repo = 'cloud:precise-grizzly'
     self.test_config.set('openstack-origin', repo)
     hooks.install()
     self.assertTrue(self.execd_preinstall.called)
     self.configure_installation_source.assert_called_with(repo)
     self.assertTrue(self.apt_update.called)
     self.apt_install.assert_called_with(
         ['apache2', 'haproxy', 'keystone', 'openssl', 'pwgen',
          'python-keystoneclient', 'python-mysqldb', 'python-psycopg2',
          'python-six', 'unison', 'uuid'], fatal=True)
     self.git_install.assert_called_with(None)
 def test_install_hook_apache2(self, os_release):
     os_release.return_value = 'havana'
     self.run_in_apache.return_value = True
     repo = 'cloud:xenial-newton'
     self.test_config.set('openstack-origin', repo)
     hooks.install()
     self.assertTrue(self.execd_preinstall.called)
     self.configure_installation_source.assert_called_with(repo)
     self.assertTrue(self.apt_update.called)
     self.apt_install.assert_called_with(
         ['apache2', 'haproxy', 'keystone', 'openssl', 'pwgen',
          'python-keystoneclient', 'python-mysqldb', 'python-psycopg2',
          'python3-six', 'uuid'], fatal=True)
     self.disable_unused_apache_sites.assert_called_with()
 def test_install_hook(self, ensure_user, git_requested):
     git_requested.return_value = False
     repo = 'cloud:precise-grizzly'
     self.test_config.set('openstack-origin', repo)
     hooks.install()
     self.assertTrue(self.execd_preinstall.called)
     self.configure_installation_source.assert_called_with(repo)
     ensure_user.assert_called_with(user=self.ssh_user, group='keystone')
     self.assertTrue(self.apt_update.called)
     self.apt_install.assert_called_with(
         ['apache2', 'haproxy', 'keystone', 'openssl', 'pwgen',
          'python-keystoneclient', 'python-mysqldb', 'python-psycopg2',
          'python-six', 'unison', 'uuid'], fatal=True)
     self.git_install.assert_called_with(None)
 def test_install_hook_apache2(self, os_release):
     os_release.return_value = 'havana'
     self.run_in_apache.return_value = True
     repo = 'cloud:xenial-newton'
     self.test_config.set('openstack-origin', repo)
     hooks.install()
     self.assertTrue(self.execd_preinstall.called)
     self.configure_installation_source.assert_called_with(repo)
     self.assertTrue(self.apt_update.called)
     self.apt_install.assert_called_with(
         ['apache2', 'haproxy', 'keystone', 'openssl', 'pwgen',
          'python-keystoneclient', 'python-mysqldb', 'python-psycopg2',
          'python3-six', 'uuid'], fatal=True)
     self.disable_unused_apache_sites.assert_called_with()
Beispiel #7
0
 def test_install_hook(self, os_release, mock_maybe_do_policyd_overrides):
     os_release.return_value = 'havana'
     self.run_in_apache.return_value = False
     repo = 'cloud:precise-grizzly'
     self.test_config.set('openstack-origin', repo)
     hooks.install()
     self.assertTrue(self.execd_preinstall.called)
     self.configure_installation_source.assert_called_with(repo)
     self.assertTrue(self.apt_update.called)
     self.apt_install.assert_called_with([
         'apache2', 'haproxy', 'keystone', 'openssl', 'pwgen',
         'python-keystoneclient', 'python-mysqldb', 'python-psycopg2',
         'python3-six', 'uuid'
     ],
                                         fatal=True)
     self.disable_unused_apache_sites.assert_not_called()
     mock_maybe_do_policyd_overrides.assert_called_once_with(
         ANY, "keystone", restart_handler=ANY)
 def test_install_hook_apache2(self, os_release,
                               mock_maybe_do_policyd_overrides,
                               mock_get_subordinate_release_packages):
     os_release.return_value = 'havana'
     self.run_in_apache.return_value = True
     repo = 'cloud:xenial-newton'
     self.test_config.set('openstack-origin', repo)
     mock_get_subordinate_release_packages.return_value = \
         os_utils.SubordinatePackages(set(), set())
     hooks.install()
     self.assertTrue(self.execd_preinstall.called)
     self.configure_installation_source.assert_called_with(repo)
     self.assertTrue(self.apt_update.called)
     self.apt_install.assert_called_with([
         'apache2', 'haproxy', 'keystone', 'openssl', 'pwgen',
         'python-keystoneclient', 'python-mysqldb', 'python-psycopg2',
         'python3-six', 'uuid'
     ],
                                         fatal=True)
     self.disable_unused_apache_sites.assert_called_with()
     mock_maybe_do_policyd_overrides.assert_called_once_with(
         ANY, "keystone", restart_handler=ANY)