def start_server_session(): """ Connects to the WITSML server and retrieves the schema versions supported (via WMLS_GetVersion) and the server capabilities for all the schema versions supported (via WMLS_GetCap) The server information retrieved is saved in global variables Returns: False if it cannot retrieve the server schema versions supported True otherwise """ WITSMLServer.connect(utils.get_variable_value('server_URL'), utils.get_variable_value('server_username'), utils.get_variable_value('server_password'), utils.get_variable_value('server_proxy_URL')) # Check server connectivity and get version and capabilities testlog.wtl_log("Getting server information...") # Save the schema versions supported by the server testlog.wtl_log(" Getting schema versions...") if (WITSMLServer.get_version()): wtl.globals.set(wtl.globals.GBL_SERVER_SCHEMA_VERSIONS, WITSMLServer.result.get().split(',')) else: testlog.wtl_log( "!!!Fatal Error - Cannot get schema versions supported by the server" ) return False # Save the server capabilities schema_version = wtl.utils.get_variable_value('server_schema_version') if schema_version in wtl.globals.get( wtl.globals.GBL_SERVER_SCHEMA_VERSIONS): if (WITSMLServer.get_cap( OptionsIn={"dataVersion": schema_version})): wtl.globals.set( wtl.globals.GBL_SERVER_CAPABILITIES, wtl.capability.WITSMLStoreCapabilities( schema_version, WITSMLServer.capabilities_out.get())) else: testlog.wtl_log( "!!!WARNING - Cannot get capabilities from the server for schema version %s" % (schema_version)) else: testlog.wtl_log( "!!!WARNING - Schema version for testing IS NOT supported by the server" ) return True
def log_store_result(result): """ Log the result of a WITSML store API action """ testlog.wtl_log(result)
def log_store_action(action): """ Log a WITSML store API action """ testlog.wtl_log(" > %s..." % action, no_new_line=True)
def log_script_result(self, message): """ Log the result of a script """ testlog.wtl_log("!*** %s" % (message), force=True)
def log_script_info(self, info): """ Log script information """ testlog.wtl_log("!%s" % (info), force=True)
def log_script_action(self, action): """ Log a script action """ testlog.wtl_log("!SCRIPT '%s' %s\n" % (self.name, action), force=True)