Esempio 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()
Esempio n. 2
0
File: mock.py Progetto: gsilvis/haas
def configure():
    config_testsuite()
    config_merge({
        'extensions': {
            'haas.ext.auth.mock': '',
            'haas.ext.auth.null': None,
        },
    })
    config.load_extensions()
Esempio n. 3
0
def configure():
    config_testsuite()
    config_merge({
        'extensions': {
            'haas.ext.obm.ipmi': '',
        },
    })

    config.load_extensions()
Esempio n. 4
0
def configure():
    config_testsuite()
    config_merge({
        'extensions': {
            'haas.ext.auth.mock': '',
            'haas.ext.auth.null': None,
        },
    })
    config.load_extensions()
Esempio n. 5
0
def configure():
    config_testsuite()
    config_merge({
        'extensions': {
            'haas.ext.obm.ipmi': ''
        },
        'devel': {
            'dry_run': None
        }
    })
    config.load_extensions()
Esempio n. 6
0
def configure():
    config_testsuite()
    config_merge({
        'haas.ext.switches.dell': {
            'save': 'True'
        },
        'haas.ext.switches.nexus': {
            'save': 'True'
        }
    })
    config.load_extensions()
Esempio 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()
Esempio 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()
Esempio n. 9
0
File: auth.py Progetto: 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()
Esempio n. 10
0
File: auth.py Progetto: 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()
Esempio 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()
Esempio 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()
Esempio 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()
Esempio 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()
Esempio n. 15
0
def configure():
    config_testsuite()
    config.load_extensions()
Esempio n. 16
0
def configure():
    config_testsuite()
    config.load_extensions()
Esempio n. 17
0
def configure():
    config_testsuite()
    config.configure_logging()
    config.load_extensions()
Esempio n. 18
0
def configure():
    config_testsuite()
    config_merge(
            {'extensions': {'haas.ext.obm.ipmi': '', }, })

    config.load_extensions()
Esempio 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()
Esempio 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()