def test_HorizonContext_image_formats(self):
     self.maxDiff = 900
     self.test_config.set('image-formats', 'iso qcow2 raw')
     self.assertEqual(horizon_contexts.HorizonContext()(),
                      {'compress_offline': True, 'debug': False,
                       'customization_module': '',
                       'default_role': 'Member', 'webroot': '/horizon',
                       'ubuntu_theme': True,
                       'default_theme': None,
                       'custom_theme': False,
                       'secret': 'secret',
                       'support_profile': None,
                       "neutron_network_dvr": False,
                       "neutron_network_l3ha": False,
                       "neutron_network_lb": False,
                       "neutron_network_firewall": False,
                       "neutron_network_vpn": False,
                       "cinder_backup": False,
                       "password_retrieve": False,
                       "default_domain": None,
                       "multi_domain": True,
                       "allow_password_autocompletion": False,
                       "default_create_volume": True,
                       "image_formats": 'iso qcow2 raw',
                       "api_result_limit": 1000,
                       }
                      )
 def test_HorizonContext_panels(self):
     self.test_config.set('neutron-network-dvr', True)
     self.test_config.set('neutron-network-l3ha', True)
     self.test_config.set('neutron-network-lb', True)
     self.test_config.set('neutron-network-firewall', True)
     self.test_config.set('neutron-network-vpn', True)
     self.test_config.set('cinder-backup', True)
     self.assertEqual(horizon_contexts.HorizonContext()(),
                      {'compress_offline': True, 'debug': False,
                       'customization_module': '',
                       'default_role': 'Member', 'webroot': '/horizon',
                       'ubuntu_theme': True,
                       'default_theme': None,
                       'custom_theme': False,
                       'secret': 'secret',
                       'support_profile': None,
                       "neutron_network_dvr": True,
                       "neutron_network_l3ha": True,
                       "neutron_network_lb": True,
                       "neutron_network_firewall": True,
                       "neutron_network_vpn": True,
                       "cinder_backup": True,
                       "password_retrieve": False,
                       "default_domain": None,
                       "multi_domain": True,
                       "allow_password_autocompletion": False,
                       "default_create_volume": True,
                       "image_formats": '',
                       }
                      )
 def test_HorizonContext_panels(self):
     self.test_config.set('neutron-network-dvr', True)
     self.test_config.set('neutron-network-l3ha', True)
     self.test_config.set('neutron-network-lb', True)
     self.test_config.set('neutron-network-firewall', True)
     self.test_config.set('neutron-network-vpn', True)
     self.test_config.set('cinder-backup', True)
     self.assertEquals(
         horizon_contexts.HorizonContext()(), {
             'compress_offline': True,
             'debug': False,
             'default_role': 'Member',
             'webroot': '/horizon',
             'ubuntu_theme': True,
             'default_theme': None,
             'virtualenv': None,
             'secret': 'secret',
             'support_profile': None,
             "neutron_network_dvr": True,
             "neutron_network_l3ha": True,
             "neutron_network_lb": True,
             "neutron_network_firewall": True,
             "neutron_network_vpn": True,
             "cinder_backup": True
         })
Ejemplo n.º 4
0
 def test_HorizonContext_defaults(self):
     self.assertEquals(horizon_contexts.HorizonContext()(),
                       {'compress_offline': True, 'debug': False,
                        'default_role': 'Member', 'webroot': '/horizon',
                        'ubuntu_theme': True,
                        'secret': 'secret',
                        'support_profile': None,
                        "neutron_network_lb": False,
                        "neutron_network_firewall": False,
                        "neutron_network_vpn": False})
Ejemplo n.º 5
0
 def test_HorizonContext_defaults(self):
     self.assertEquals(horizon_contexts.HorizonContext()(),
                       {'compress_offline': True, 'debug': False,
                        'customization_module': '',
                        'default_role': 'Member', 'webroot': '/horizon',
                        'ubuntu_theme': True,
                        'default_theme': None,
                        'virtualenv': None,
                        'secret': 'secret',
                        'support_profile': None,
                        "neutron_network_dvr": False,
                        "neutron_network_l3ha": False,
                        "neutron_network_lb": False,
                        "neutron_network_firewall": False,
                        "neutron_network_vpn": False,
                        "cinder_backup": False,
                        "password_retrieve": False,
                        }
                       )
 def test_HorizonContext_role(self):
     self.test_config.set('default-role', 'foo')
     self.assertEquals(
         horizon_contexts.HorizonContext()(), {
             'compress_offline': True,
             'debug': False,
             'default_role': 'foo',
             'webroot': '/horizon',
             'ubuntu_theme': True,
             'default_theme': None,
             'virtualenv': None,
             'secret': 'secret',
             'support_profile': None,
             "neutron_network_dvr": False,
             "neutron_network_l3ha": False,
             "neutron_network_lb": False,
             "neutron_network_firewall": False,
             "neutron_network_vpn": False,
             "cinder_backup": False
         })
PORTS_CONF = "%s/ports.conf" % (APACHE_CONF_DIR)
APACHE_24_SSL = "%s/sites-available/default-ssl.conf" % (APACHE_CONF_DIR)
APACHE_24_DEFAULT = "%s/sites-available/000-default.conf" % (APACHE_CONF_DIR)
APACHE_SSL = "%s/sites-available/default-ssl" % (APACHE_CONF_DIR)
APACHE_DEFAULT = "%s/sites-available/default" % (APACHE_CONF_DIR)
INSTALL_DIR = "/usr/share/openstack-dashboard"
ROUTER_SETTING = ('/usr/share/openstack-dashboard/openstack_dashboard/enabled/'
                  '_40_router.py')
KEYSTONEV3_POLICY = ('/usr/share/openstack-dashboard/openstack_dashboard/conf/'
                     'keystonev3_policy.json')
TEMPLATES = 'templates'

CONFIG_FILES = OrderedDict([
    (LOCAL_SETTINGS, {
        'hook_contexts': [
            horizon_contexts.HorizonContext(),
            horizon_contexts.IdentityServiceContext(),
            context.SyslogContext(),
            horizon_contexts.LocalSettingsContext()
        ],
        'services': ['apache2', 'memcached']
    }),
    (APACHE_CONF, {
        'hook_contexts':
        [horizon_contexts.HorizonContext(),
         context.SyslogContext()],
        'services': ['apache2', 'memcached'],
    }),
    (APACHE_24_CONF, {
        'hook_contexts':
        [horizon_contexts.HorizonContext(),
 def test_HorizonContext_default_theme_true(self):
     self.test_config.set('ubuntu-theme', 'true')
     self.assertTrue(horizon_contexts.HorizonContext()()['ubuntu_theme'])
Ejemplo n.º 9
0
APACHE_24_CONF = "%s/conf-available/openstack-dashboard.conf" \
    % (APACHE_CONF_DIR)
PORTS_CONF = "%s/ports.conf" % (APACHE_CONF_DIR)
APACHE_24_SSL = "%s/sites-available/default-ssl.conf" % (APACHE_CONF_DIR)
APACHE_24_DEFAULT = "%s/sites-available/000-default.conf" % (APACHE_CONF_DIR)
APACHE_SSL = "%s/sites-available/default-ssl" % (APACHE_CONF_DIR)
APACHE_DEFAULT = "%s/sites-available/default" % (APACHE_CONF_DIR)
INSTALL_DIR = "/usr/share/openstack-dashboard"
ROUTER_SETTING = \
    "/usr/share/openstack-dashboard/openstack_dashboard/enabled/_40_router.py"

TEMPLATES = 'templates'

CONFIG_FILES = OrderedDict([
    (LOCAL_SETTINGS, {
        'hook_contexts': [horizon_contexts.HorizonContext(),
                          horizon_contexts.IdentityServiceContext(),
                          context.SyslogContext(),
                          horizon_contexts.LocalSettingsContext()],
        'services': ['apache2']
    }),
    (APACHE_CONF, {
        'hook_contexts': [horizon_contexts.HorizonContext(),
                          context.SyslogContext()],
        'services': ['apache2'],
    }),
    (APACHE_24_CONF, {
        'hook_contexts': [horizon_contexts.HorizonContext(),
                          context.SyslogContext()],
        'services': ['apache2'],
    }),