Exemplo n.º 1
0
    def setUp(self):
        from haas.ext.switches.mock import LOCAL_STATE
        self.LOCAL_STATE = LOCAL_STATE
        fail_on_log_warnings()

        # Configure HaaS:
        config_testsuite()
        config_merge({
            'extensions': {
                'haas.ext.switches.mock': '',
                'haas.ext.obm.ipmi': '',
                'haas.ext.obm.mock': '',
                'haas.ext.network_allocators.null': None,
                'haas.ext.network_allocators.vlan_pool': '',
            },
            'haas.ext.network_allocators.vlan_pool': {
                'vlans': '100-200',
            },
        })
        config.load_extensions()

        newDB()  # Initialize the db schema
        initial_db()  # Populate the db with objects

        # Sanity check the start state:
        assert self.LOCAL_STATE['stock_switch_0']['free_port_0'] == {}

        self.request_context = app.test_request_context()
        self.request_context.push()
Exemplo n.º 2
0
Arquivo: mock.py Projeto: gsilvis/haas
def configure():
    config_testsuite()
    config_merge({
        'extensions': {
            'haas.ext.auth.mock': '',
            'haas.ext.auth.null': None,
        },
    })
    config.load_extensions()
Exemplo n.º 3
0
def configure():
    config_testsuite()
    config_merge({
        'extensions': {
            'haas.ext.obm.ipmi': '',
        },
    })

    config.load_extensions()
Exemplo n.º 4
0
def configure():
    config_testsuite()
    config_merge({
        'extensions': {
            'haas.ext.auth.mock': '',
            'haas.ext.auth.null': None,
        },
    })
    config.load_extensions()
Exemplo n.º 5
0
def configure():
    config_testsuite()
    config_merge({
        'extensions': {
            'haas.ext.obm.ipmi': ''
        },
        'devel': {
            'dry_run': None
        }
    })
    config.load_extensions()
Exemplo n.º 6
0
def configure():
    config_testsuite()
    config_merge({
        'haas.ext.switches.dell': {
            'save': 'True'
        },
        'haas.ext.switches.nexus': {
            'save': 'True'
        }
    })
    config.load_extensions()
Exemplo n.º 7
0
def configure():
    config_testsuite()
    config_merge({
        'extensions': {
            'haas.ext.network_allocators.null': None,
            'haas.ext.network_allocators.vlan_pool': ''
        },
        'haas.ext.network_allocators.vlan_pool': {
            'vlans': '100-104, 300, 702',  # Arbitrary list
        },
    })
    load_extensions()
Exemplo n.º 8
0
def configure():
    config_testsuite()
    config_merge({
        'extensions': {
            'haas.ext.auth.mock': '',

            # This extension is enabled by default in the tests, so we need to
            # disable it explicitly:
            'haas.ext.auth.null': None,
            'haas.ext.switches.mock': '',
        },
    })
    config.load_extensions()
Exemplo n.º 9
0
Arquivo: auth.py Projeto: henn/hil
def configure():
    config_testsuite()
    config_merge({
        'extensions': {
            'haas.ext.auth.mock': '',

            # This extension is enabled by default in the tests, so we need to
            # disable it explicitly:
            'haas.ext.auth.null': None,
            'haas.ext.switches.mock': '',
            'haas.ext.obm.mock': ''
        },
    })
    config.load_extensions()
Exemplo n.º 10
0
Arquivo: auth.py Projeto: CCI-MOC/hil
def configure():
    config_testsuite()
    config_merge(
        {
            "extensions": {
                "haas.ext.auth.mock": "",
                # This extension is enabled by default in the tests, so we need to
                # disable it explicitly:
                "haas.ext.auth.null": None,
                "haas.ext.switches.mock": "",
                "haas.ext.obm.mock": "",
            }
        }
    )
    config.load_extensions()
Exemplo n.º 11
0
def configure():
    config_testsuite()
    config_merge({
        'auth': {
            # The tests in this module are checking the specific authorization
            # requirements of the API calls. as such, we don't want things to
            # fail due to complete lack of authentication, where they should
            # fail later when the specific authorization checks we're testing
            # for happen.
            'require_authentication': 'False',
        },
        'extensions': {
            'haas.ext.auth.database': '',
            'haas.ext.auth.null': None,
        },
    })
    config.load_extensions()
Exemplo n.º 12
0
def configure():
    config_testsuite()
    config_merge({
        'auth': {
            # The tests in this module are checking the specific authorization
            # requirements of the API calls. as such, we don't want things to
            # fail due to complete lack of authentication, where they should
            # fail later when the specific authorization checks we're testing
            # for happen.
            'require_authentication': 'False',
        },
        'extensions': {
            'haas.ext.auth.database': '',
            'haas.ext.auth.null': None,
        },
    })
    config.load_extensions()
Exemplo n.º 13
0
def configure():
    """Fixture which setups up haas.cfg, and loads extensions and such."""
    tc.config_testsuite()
    tc.config_merge({
        'extensions': {
            'haas.ext.auth.null': None,
            'haas.ext.auth.keystone': '',
        },
        'haas.ext.auth.keystone': {
            'auth_url': 'http://127.0.0.1:35357/v3',
            'auth_protocol': 'http',
            'username': '******',
            'password': '******',
            'project_name': 'admin',
            'admin_user': '******',
            'admin_password': '******',
        },
    })
    # the keystone client library actually bombs out if we don't configure
    # logging:
    config.configure_logging()
    config.load_extensions()
Exemplo n.º 14
0
def configure():
    """Fixture which setups up haas.cfg, and loads extensions and such."""
    tc.config_testsuite()
    tc.config_merge({
        'extensions': {
            'haas.ext.auth.null': None,
            'haas.ext.auth.keystone': '',
        },
        'haas.ext.auth.keystone': {
            'auth_url': 'http://127.0.0.1:35357/v3',
            'auth_protocol': 'http',
            'username': '******',
            'password': '******',
            'project_name': 'admin',
            'admin_user': '******',
            'admin_password': '******',
        },
    })
    # the keystone client library actually bombs out if we don't configure
    # logging:
    config.configure_logging()
    config.load_extensions()
Exemplo n.º 15
0
def configure():
    config_testsuite()
    config.load_extensions()
Exemplo n.º 16
0
def configure():
    config_testsuite()
    config.load_extensions()
Exemplo n.º 17
0
def configure():
    config_testsuite()
    config.configure_logging()
    config.load_extensions()
Exemplo n.º 18
0
def configure():
    config_testsuite()
    config_merge(
            {'extensions': {'haas.ext.obm.ipmi': '', }, })

    config.load_extensions()
Exemplo n.º 19
0
def configure():
    config_testsuite()
    if not cfg.get('database', 'uri').startswith('postgresql:'):
        pytest.skip('Database migrations are only supported for postgresql.')
    init_db()
Exemplo n.º 20
0
def configure():
    config_testsuite()
    if not cfg.get('database', 'uri').startswith('postgresql:'):
        pytest.skip('Database migrations are only supported for postgresql.')
    init_db()