#NEWLINE# @ require_backend ( 'openstack' ) #NEWLINE# def session_for_test( self , config_override ) : #NEWLINE# #INDENT# '\n        Creates a new Keystone session and invalidates it.\n\n        :param dict config_override: Override certain configuration values\n            before creating the test session.\n        :returns: A Keystone Session instance.\n        ' #NEWLINE# config = get_blockdevice_config ( ) #NEWLINE# config . update ( config_override ) #NEWLINE# auth_url = config [ 'auth_url' ] #NEWLINE# if ( not ( urlsplit ( auth_url ) . scheme == 'https' ) ) : #NEWLINE# #INDENT# self . skipTest ( 'Tests require a TLS auth_url endpoint beginning with https://. Found auth_url: {}' . format ( auth_url ) ) #NEWLINE# #UNINDENT# session = get_keystone_session ( ** config ) #NEWLINE# expected_options = set ( config_override ) #NEWLINE# supported_options = set ( ( option . dest for option in session . auth . get_options ( ) ) ) #NEWLINE# unsupported_options = expected_options . difference ( supported_options ) #NEWLINE# if unsupported_options : #NEWLINE# #INDENT# 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 ) ) ) #NEWLINE# #UNINDENT# session . invalidate ( ) #NEWLINE# return session