'Creates a new Keystone session and invalidates it.
:param dict config_override: Override certain configuration values
before creating the test session.
:returns: A Keystone Session instance.'

@require_backend('openstack')
def session_for_test(self, config_override):

    config = get_blockdevice_config()
    config.update(config_override)
    auth_url = config['auth_url']
    if (not (urlsplit(auth_url).scheme == u'https')):
        self.skipTest('Tests    require    a    TLS    auth_url    endpoint    beginning    with    https://.    Found    auth_url:    {}'.format(auth_url))
    session = get_keystone_session(**config)
    expected_options = set(config_override)
    supported_options = set((option.dest for option in session.auth.get_options()))
    unsupported_options = expected_options.difference(supported_options)
    if unsupported_options:
        self.skipTest('Test    requires    a    keystone    authentication    driver    with    support    for    options    {!r}.    These    options    were    missing    {!r}.'.format(',    '.join(expected_options), ',    '.join(unsupported_options)))
    session.invalidate()
    return session
