def test_install_hook_git(self, 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': 'glance',
              'repository': 'git://git.openstack.org/openstack/glance',
              '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)
     relations.install_hook()
     self.assertTrue(self.execd_preinstall.called)
     self.configure_installation_source.assert_called_with(repo)
     self.apt_update.assert_called_with(fatal=True)
     self.apt_install.assert_called_with(
         ['apache2', 'haproxy', 'libffi-dev', 'libmysqlclient-dev',
          'libssl-dev', 'libxml2-dev', 'libxslt1-dev', 'libyaml-dev',
          'python-dev', 'python-mysqldb', 'python-pip', 'python-psycopg2',
          'python-setuptools', 'python-six', 'uuid', 'zlib1g-dev'],
         fatal=True)
     self.git_install.assert_called_with(projects_yaml)
 def test_install_hook_precise_distro(self, git_requested):
     git_requested.return_value = False
     self.test_config.set('openstack-origin', 'distro')
     self.lsb_release.return_value = {'DISTRIB_RELEASE': 12.04,
                                      'DISTRIB_CODENAME': 'precise'}
     self.service_stop.return_value = True
     relations.install_hook()
     self.configure_installation_source.assert_called_with(
         "cloud:precise-folsom"
     )
Esempio n. 3
0
 def test_install_hook_precise_distro(self, token_cache_pkgs, util_config):
     token_cache_pkgs.return_value = []
     self.test_config.set('openstack-origin', 'distro')
     self.lsb_release.return_value = {
         'DISTRIB_RELEASE': 12.04,
         'DISTRIB_CODENAME': 'precise'
     }
     self.service_stop.return_value = True
     relations.install_hook()
     self.configure_installation_source.assert_called_with(
         "cloud:precise-folsom")
 def test_install_hook(self, git_requested):
     git_requested.return_value = False
     repo = 'cloud:precise-grizzly'
     self.test_config.set('openstack-origin', repo)
     self.service_stop.return_value = True
     relations.install_hook()
     self.configure_installation_source.assert_called_with(repo)
     self.apt_update.assert_called_with(fatal=True)
     self.apt_install.assert_called_with(
         ['apache2', 'glance', 'haproxy', 'python-keystone',
          'python-mysqldb', 'python-psycopg2', 'python-six',
          'python-swiftclient', 'uuid'], fatal=True)
     self.assertTrue(self.execd_preinstall.called)
     self.git_install.assert_called_with(None)
Esempio n. 5
0
 def test_install_hook(self, token_cache_pkgs, util_config):
     token_cache_pkgs.return_value = ['memcached']
     repo = 'cloud:precise-grizzly'
     self.test_config.set('openstack-origin', repo)
     self.service_stop.return_value = True
     relations.install_hook()
     self.configure_installation_source.assert_called_with(repo)
     self.apt_update.assert_called_with(fatal=True)
     self.apt_install.assert_called_with([
         'apache2', 'glance', 'haproxy', 'memcached', 'python-keystone',
         'python-mysqldb', 'python-psycopg2', 'python-six',
         'python-swiftclient', 'uuid'
     ],
                                         fatal=True)
     self.assertTrue(self.execd_preinstall.called)
 def test_install_hook_git(self, git_requested, token_cache_pkgs,
                           util_config):
     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': 'glance',
                 'repository': 'git://git.openstack.org/openstack/glance',
                 '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)
     relations.install_hook()
     self.assertTrue(self.execd_preinstall.called)
     self.configure_installation_source.assert_called_with(repo)
     self.apt_update.assert_called_with(fatal=True)
     self.apt_install.assert_called_with([
         'apache2', 'haproxy', 'libffi-dev', 'libmysqlclient-dev',
         'libssl-dev', 'libxml2-dev', 'libxslt1-dev', 'libyaml-dev',
         'openstack-pkg-tools', 'python-dev', 'python-mysqldb',
         'python-pip', 'python-psycopg2', 'python-setuptools', 'python-six',
         'uuid', 'zlib1g-dev'
     ],
                                         fatal=True)
     self.git_install.assert_called_with(projects_yaml)