diff options
author | Anas Nashif <nashif@intel.com> | 2007-05-16 23:55:28 +0000 |
---|---|---|
committer | Anas Nashif <nashif@intel.com> | 2007-05-16 23:55:28 +0000 |
commit | 1cc54578baf92beada66be79aecdd0f5341f5cdd (patch) | |
tree | b8e8aec74b508c097ab2d9de59e37185614de184 | |
parent | 16803fdddfa698aa7586245d8a48ef25f480635a (diff) | |
download | wsmancli-1cc54578baf92beada66be79aecdd0f5341f5cdd.tar.gz wsmancli-1cc54578baf92beada66be79aecdd0f5341f5cdd.tar.xz wsmancli-1cc54578baf92beada66be79aecdd0f5341f5cdd.zip |
wsman_client -> wsmc
-rw-r--r-- | examples/create_resource.c | 14 | ||||
-rw-r--r-- | examples/enum_epr.c | 14 | ||||
-rw-r--r-- | examples/win32_service.c | 36 | ||||
-rw-r--r-- | examples/wsmid_identify.c | 12 | ||||
-rw-r--r-- | examples/wsmid_identify_no_options.c | 8 | ||||
-rw-r--r-- | src/wsman.c | 94 | ||||
-rw-r--r-- | tests/cunit/common.c | 8 | ||||
-rw-r--r-- | tests/cunit/enumeration.c | 22 | ||||
-rw-r--r-- | tests/cunit/identify.c | 10 | ||||
-rwxr-xr-x | tests/cunit/invoke.c | 18 | ||||
-rw-r--r-- | tests/cunit/pull.c | 22 | ||||
-rw-r--r-- | tests/cunit/transfer_get.c | 12 | ||||
-rwxr-xr-x | tests/cunit/transfer_put.c | 16 | ||||
-rw-r--r-- | tests/interop/interop.c | 32 |
14 files changed, 159 insertions, 159 deletions
diff --git a/examples/create_resource.c b/examples/create_resource.c index 337ac0f..78f8a60 100644 --- a/examples/create_resource.c +++ b/examples/create_resource.c @@ -128,16 +128,16 @@ int main(int argc, char** argv) } - cl = wsman_client_create( uri->host, + cl = wsmc_create( uri->host, uri->port, uri->path, uri->scheme, uri->user, uri->pwd); - wsman_client_transport_init(cl, NULL); - options = wsman_client_options_init(); + wsmc_transport_init(cl, NULL); + options = wsmc_options_init(); - if (dump) wsman_client_set_action_option(options,FLAG_DUMP_REQUEST ); + if (dump) wsmc_set_action_option(options,FLAG_DUMP_REQUEST ); options->max_envelope_size = 51200; options->timeout = 60000; @@ -155,7 +155,7 @@ int main(int argc, char** argv) d->Handles.count = count; d->Handles.data = array; - doc = wsman_client_action_create_serialized(cl, RESOURCE_URI, options, d, + doc = wsmc_action_create_serialized(cl, RESOURCE_URI, options, d, EXL_ExamplePolicy_TypeInfo); if (doc) ws_xml_dump_node_tree(stdout, ws_xml_get_doc_root(doc)); @@ -164,8 +164,8 @@ int main(int argc, char** argv) u_uri_free(uri); } - wsman_client_options_destroy(options); - wsman_client_release(cl); + wsmc_options_destroy(options); + wsmc_release(cl); return 0; } diff --git a/examples/enum_epr.c b/examples/enum_epr.c index c5dd74e..c0b5b71 100644 --- a/examples/enum_epr.c +++ b/examples/enum_epr.c @@ -169,20 +169,20 @@ int main(int argc, char** argv) } - cl = wsman_client_create( uri->host, + cl = wsmc_create( uri->host, uri->port, uri->path, uri->scheme, uri->user, uri->pwd); - wsman_client_transport_init(cl, NULL); - options = wsman_client_options_init(); + wsmc_transport_init(cl, NULL); + options = wsmc_options_init(); - wsman_client_set_action_option(options, FLAG_ENUMERATION_ENUM_EPR); + wsmc_set_action_option(options, FLAG_ENUMERATION_ENUM_EPR); list_t *l = list_create(LISTCOUNT_T_MAX); - wsman_client_action_enumerate_and_pull(cl, argv[1] , options, collect_epr, l ); + wsmc_action_enumerate_and_pull(cl, argv[1] , options, collect_epr, l ); printf("returned items: %d\n", list_count(l)); @@ -206,8 +206,8 @@ int main(int argc, char** argv) u_uri_free(uri); } - wsman_client_options_destroy(options); - wsman_client_release(cl); + wsmc_options_destroy(options); + wsmc_release(cl); return 0; } diff --git a/examples/win32_service.c b/examples/win32_service.c index 8e10c18..4d32f40 100644 --- a/examples/win32_service.c +++ b/examples/win32_service.c @@ -168,7 +168,7 @@ static int list_services(WsManClient *cl, WsXmlDocH doc, void *data) node = ws_xml_get_child(node, 0, XML_NS_ENUMERATION, WSENUM_PULL_RESP); node = ws_xml_get_child(node, 0, XML_NS_ENUMERATION, WSENUM_ITEMS); if (ws_xml_get_child(node, 0, RESOURCE_URI , CLASSNAME )) { - CIM_Servie *service = ws_deserialize(wsman_client_get_context(cl), + CIM_Servie *service = ws_deserialize(wsmc_get_context(cl), node, CIM_Servie_TypeInfo, CLASSNAME, RESOURCE_URI, NULL, @@ -233,41 +233,41 @@ int main(int argc, char** argv) } - cl = wsman_client_create( uri->host, + cl = wsmc_create( uri->host, uri->port, uri->path, uri->scheme, uri->user, uri->pwd); - wsman_client_transport_init(cl, NULL); - options = wsman_client_options_init(); + wsmc_transport_init(cl, NULL); + options = wsmc_options_init(); if (listall) { - if (dump) wsman_client_set_action_option(options,FLAG_DUMP_REQUEST ); - wsman_client_action_enumerate_and_pull(cl, RESOURCE_URI, options, list_services, NULL ); + if (dump) wsmc_set_action_option(options,FLAG_DUMP_REQUEST ); + wsmc_action_enumerate_and_pull(cl, RESOURCE_URI, options, list_services, NULL ); } else if (start && argv[1]) { - if (dump) wsman_client_set_action_option(options,FLAG_DUMP_REQUEST ); - wsman_client_add_selector(options, "Name", argv[1]); - doc = wsman_client_action_invoke(cl, RESOURCE_URI, options, + if (dump) wsmc_set_action_option(options,FLAG_DUMP_REQUEST ); + wsmc_add_selector(options, "Name", argv[1]); + doc = wsmc_action_invoke(cl, RESOURCE_URI, options, "StartService", NULL); ws_xml_dump_node_tree(stdout, ws_xml_get_doc_root(doc)); ws_xml_destroy_doc(doc); } else if (stop && argv[1]) { - if (dump) wsman_client_set_action_option(options,FLAG_DUMP_REQUEST ); - wsman_client_add_selector(options, "Name", argv[1]); - doc = wsman_client_action_invoke(cl, RESOURCE_URI, options, + if (dump) wsmc_set_action_option(options,FLAG_DUMP_REQUEST ); + wsmc_add_selector(options, "Name", argv[1]); + doc = wsmc_action_invoke(cl, RESOURCE_URI, options, "StopService", NULL); ws_xml_dump_node_tree(stdout, ws_xml_get_doc_root(doc)); ws_xml_destroy_doc(doc); } else if ( argv[1] ) { - if (dump) wsman_client_set_action_option(options,FLAG_DUMP_REQUEST ); - wsman_client_add_selector(options, "Name", argv[1]); - doc = wsman_client_action_get(cl, RESOURCE_URI, + if (dump) wsmc_set_action_option(options,FLAG_DUMP_REQUEST ); + wsmc_add_selector(options, "Name", argv[1]); + doc = wsmc_action_get(cl, RESOURCE_URI, options); if (doc) { WsXmlNodeH node = ws_xml_get_soap_body(doc); if (ws_xml_get_child(node, 0, RESOURCE_URI , CLASSNAME )) { - CIM_Servie *service = ws_deserialize(wsman_client_get_context(cl), + CIM_Servie *service = ws_deserialize(wsmc_get_context(cl), node, CIM_Servie_TypeInfo, CLASSNAME, RESOURCE_URI, NULL, @@ -284,8 +284,8 @@ int main(int argc, char** argv) u_uri_free(uri); } - wsman_client_options_destroy(options); - wsman_client_release(cl); + wsmc_options_destroy(options); + wsmc_release(cl); return 0; } diff --git a/examples/wsmid_identify.c b/examples/wsmid_identify.c index 0808205..f48635c 100644 --- a/examples/wsmid_identify.c +++ b/examples/wsmid_identify.c @@ -117,20 +117,20 @@ fprintf( stderr, "wsman_create_client( host %s, port %d, path %s, scheme %s, use uri->pwd); */ - cl = wsman_client_create( uri->host, + cl = wsmc_create( uri->host, uri->port, uri->path, uri->scheme, uri->user, uri->pwd); - options = wsman_client_options_init(); + options = wsmc_options_init(); - doc = wsman_client_action_identify(cl, options); + doc = wsmc_action_identify(cl, options); WsXmlNodeH soapBody = ws_xml_get_soap_body(doc); if (ws_xml_get_child(soapBody, 0, XML_NS_WSMAN_ID, "IdentifyResponse")) { - wsmid_identify *id = ws_deserialize(wsman_client_get_context(cl), + wsmid_identify *id = ws_deserialize(wsmc_get_context(cl), soapBody, wsmid_identify_TypeInfo, "IdentifyResponse", XML_NS_WSMAN_ID, NULL, @@ -157,8 +157,8 @@ fprintf( stderr, "wsman_create_client( host %s, port %d, path %s, scheme %s, use ws_xml_destroy_doc(doc); } - wsman_client_options_destroy(options); - wsman_client_release(cl); + wsmc_options_destroy(options); + wsmc_release(cl); return 0; diff --git a/examples/wsmid_identify_no_options.c b/examples/wsmid_identify_no_options.c index 91d830d..cd961f4 100644 --- a/examples/wsmid_identify_no_options.c +++ b/examples/wsmid_identify_no_options.c @@ -87,21 +87,21 @@ int main(int argc, char** argv) } - wsman_client_transport_init(NULL); + wsmc_transport_init(NULL); cl = wsman_create_client( uri->host, uri->port, uri->path, uri->scheme, uri->user, uri->pwd); - wsman_client_options_init(&options); + wsmc_options_init(&options); //wsman_set_action_option(&options,FLAG_DUMP_REQUEST ); doc = wsman_identify(cl, options); soapBody = ws_xml_get_soap_body(doc); if (ws_xml_get_child(soapBody, 0, XML_NS_WSMAN_ID, "IdentifyResponse")) { - wsmid_identify *id = ws_deserialize(wsman_client_get_context(cl), + wsmid_identify *id = ws_deserialize(wsmc_get_context(cl), soapBody, wsmid_identify_TypeInfo,"IdentifyResponse", XML_NS_WSMAN_ID, XML_NS_WSMAN_ID, @@ -128,7 +128,7 @@ int main(int argc, char** argv) ws_xml_destroy_doc(doc); } - wsman_client_options_destroy(&options); + wsmc_options_destroy(&options); wsman_release_client(cl); diff --git a/src/wsman.c b/src/wsman.c index 102b608..e38a4f0 100644 --- a/src/wsman.c +++ b/src/wsman.c @@ -60,7 +60,7 @@ static void wsman_output(WsManClient * cl, WsXmlDocH doc) const char *filename = wsman_options_get_output_file(); WS_LASTERR_Code err; - err = wsman_client_get_last_error(cl); + err = wsmc_get_last_error(cl); if (err != WS_LASTERR_OK) { return; } @@ -103,7 +103,7 @@ request_usr_pwd( wsman_auth_type_t auth, fprintf(stdout,"Authentication failed, please retry\n"); /* fprintf(stdout, "%s authentication is used\n", - wsman_client_transport_get_auth_name( auth)); + wsmc_transport_get_auth_name( auth)); */ printf("User name: "); fflush(stdout); @@ -158,19 +158,19 @@ int main(int argc, char **argv) } initialize_logging(); - // wsman_client_transport_init(NULL); - options = wsman_client_options_init(); + // wsmc_transport_init(NULL); + options = wsmc_options_init(); debug("Certificate: %s", wsman_options_get_cafile()); - cl = wsman_client_create(wsman_options_get_server(), + cl = wsmc_create(wsman_options_get_server(), wsman_options_get_server_port(), wsman_options_get_path(), wsman_options_get_cafile()? "https" : "http", wsman_options_get_username(), wsman_options_get_password()); - wsman_client_transport_set_auth_request_func(cl , &request_usr_pwd ); + wsmc_transport_set_auth_request_func(cl , &request_usr_pwd ); if (cl == NULL) { @@ -200,7 +200,7 @@ int main(int argc, char **argv) resource_uri_with_selectors = wsman_options_get_resource_uri(); if (resource_uri_with_selectors && strcmp(resource_uri_with_selectors,CIM_ALL_AVAILABLE_CLASSES) != 0) { - wsman_client_set_options_from_uri(resource_uri_with_selectors, + wsmc_set_options_from_uri(resource_uri_with_selectors, options); wsman_remove_query_string(resource_uri_with_selectors, &resource_uri); @@ -211,7 +211,7 @@ int main(int argc, char **argv) op = wsman_options_get_action(); if (wsman_options_get_dump_request()) { - wsman_client_set_action_option(options, FLAG_DUMP_REQUEST); + wsmc_set_action_option(options, FLAG_DUMP_REQUEST); } if (wsman_options_get_max_envelope_size()) { options->max_envelope_size = @@ -232,13 +232,13 @@ int main(int argc, char **argv) options->properties = wsman_options_get_properties(); options->cim_ns = wsman_options_get_cim_namespace(); if (wsman_options_get_cim_ext()) { - wsman_client_set_action_option(options, FLAG_CIM_EXTENSIONS); + wsmc_set_action_option(options, FLAG_CIM_EXTENSIONS); } switch (op) { case WSMAN_ACTION_TEST: - rqstDoc = wsman_client_read_file(cl, + rqstDoc = wsmc_read_file(cl, wsman_options_get_input_file (), "UTF-8", 0); wsman_send_request(cl, rqstDoc); @@ -249,7 +249,7 @@ int main(int argc, char **argv) } break; case WSMAN_ACTION_IDENTIFY: - doc = wsman_client_action_identify(cl, options); + doc = wsmc_action_identify(cl, options); wsman_output(cl, doc); if (doc) { ws_xml_destroy_doc(doc); @@ -257,7 +257,7 @@ int main(int argc, char **argv) break; case WSMAN_ACTION_CUSTOM: - doc = wsman_client_action_invoke(cl, resource_uri, options, + doc = wsmc_action_invoke(cl, resource_uri, options, wsman_options_get_invoke_method(), NULL); wsman_output(cl, doc); @@ -266,7 +266,7 @@ int main(int argc, char **argv) } break; case WSMAN_ACTION_TRANSFER_DELETE: - doc = wsman_client_action_delete(cl, resource_uri, options); + doc = wsmc_action_delete(cl, resource_uri, options); wsman_output(cl, doc); if (doc) { ws_xml_destroy_doc(doc); @@ -274,11 +274,11 @@ int main(int argc, char **argv) break; case WSMAN_ACTION_TRANSFER_CREATE: if (wsman_options_get_input_file()) { - resource = wsman_client_read_file(cl, + resource = wsmc_read_file(cl, wsman_options_get_input_file (), "UTF-8", 0); doc = - wsman_client_action_create(cl, resource_uri, options, + wsmc_action_create(cl, resource_uri, options, resource); ws_xml_destroy_doc(resource); wsman_output(cl, doc); @@ -292,16 +292,16 @@ int main(int argc, char **argv) case WSMAN_ACTION_TRANSFER_PUT: if (wsman_options_get_input_file()) { printf("input file provided\n"); - resource = wsman_client_read_file(cl, + resource = wsmc_read_file(cl, wsman_options_get_input_file (), "UTF-8", 0); doc = - wsman_client_action_put(cl, resource_uri, options, + wsmc_action_put(cl, resource_uri, options, resource); ws_xml_destroy_doc(resource); } else { doc = - wsman_client_action_get_and_put(cl, resource_uri, + wsmc_action_get_and_put(cl, resource_uri, options); } wsman_output(cl, doc); @@ -310,7 +310,7 @@ int main(int argc, char **argv) } break; case WSMAN_ACTION_TRANSFER_GET: - doc = wsman_client_action_get(cl, resource_uri, options); + doc = wsmc_action_get(cl, resource_uri, options); wsman_output(cl, doc); if (doc) { ws_xml_destroy_doc(doc); @@ -318,7 +318,7 @@ int main(int argc, char **argv) break; case WSMAN_ACTION_PULL: doc = - wsman_client_action_pull(cl, resource_uri, options, + wsmc_action_pull(cl, resource_uri, options, wsman_options_get_enum_context()); wsman_output(cl, doc); if (doc) { @@ -327,7 +327,7 @@ int main(int argc, char **argv) break; case WSMAN_ACTION_RELEASE: doc = - wsman_client_action_release(cl, resource_uri, options, + wsmc_action_release(cl, resource_uri, options, wsman_options_get_enum_context()); wsman_output(cl, doc); if (doc) { @@ -342,56 +342,56 @@ int main(int argc, char **argv) if (enumeration_mode) { if (strcmp(enumeration_mode, "epr") == 0) - wsman_client_set_action_option(options, + wsmc_set_action_option(options, FLAG_ENUMERATION_ENUM_EPR); else if (strcmp(enumeration_mode, "objepr") == 0) - wsman_client_set_action_option(options, + wsmc_set_action_option(options, FLAG_ENUMERATION_ENUM_OBJ_AND_EPR); } if (binding_enumeration_mode) { if (strcmp(binding_enumeration_mode, "include") == 0) - wsman_client_set_action_option(options, + wsmc_set_action_option(options, FLAG_IncludeSubClassProperties); else if (strcmp (binding_enumeration_mode, "exclude") == 0) - wsman_client_set_action_option(options, + wsmc_set_action_option(options, FLAG_ExcludeSubClassProperties); else if (strcmp(binding_enumeration_mode, "none") == 0) - wsman_client_set_action_option(options, + wsmc_set_action_option(options, FLAG_POLYMORPHISM_NONE); } if (wsman_options_get_cim_ref()) { - wsman_client_set_action_option(options, + wsmc_set_action_option(options, FLAG_CIM_REFERENCES); options->dialect = WSM_ASSOCIATION_FILTER_DIALECT; } if (wsman_options_get_cim_assoc()) { - wsman_client_set_action_option(options, + wsmc_set_action_option(options, FLAG_CIM_ASSOCIATORS); options->dialect = WSM_ASSOCIATION_FILTER_DIALECT; } if (wsman_options_get_optimize_enum()) { - wsman_client_set_action_option(options, + wsmc_set_action_option(options, FLAG_ENUMERATION_OPTIMIZATION); } options->max_elements = wsman_options_get_max_elements(); if (wsman_options_get_estimate_enum()) { - wsman_client_set_action_option(options, + wsmc_set_action_option(options, FLAG_ENUMERATION_COUNT_ESTIMATION); } - enum_response = wsman_client_action_enumerate(cl, resource_uri, options); + enum_response = wsmc_action_enumerate(cl, resource_uri, options); wsman_output(cl, enum_response); if (enum_response) { - if (!(wsman_client_get_response_code(cl) == 200 || - wsman_client_get_response_code(cl) == 400 || - wsman_client_get_response_code(cl) == 500)) { + if (!(wsmc_get_response_code(cl) == 200 || + wsmc_get_response_code(cl) == 400 || + wsmc_get_response_code(cl) == 500)) { break; } - enumContext = wsman_client_get_enum_context(enum_response); + enumContext = wsmc_get_enum_context(enum_response); ws_xml_destroy_doc(enum_response); } else { u_free(enumContext); @@ -402,16 +402,16 @@ int main(int argc, char **argv) break; while (enumContext != NULL && enumContext[0] != 0) { - doc = wsman_client_action_pull(cl, resource_uri, options, + doc = wsmc_action_pull(cl, resource_uri, options, enumContext); wsman_output(cl, doc); - if (wsman_client_get_response_code(cl) != 200 - && wsman_client_get_response_code(cl) != 400 - && wsman_client_get_response_code(cl) != 500) { + if (wsmc_get_response_code(cl) != 200 + && wsmc_get_response_code(cl) != 400 + && wsmc_get_response_code(cl) != 500) { break; } - enumContext = wsman_client_get_enum_context(doc); + enumContext = wsmc_get_enum_context(doc); if (doc) { ws_xml_destroy_doc(doc); } @@ -424,18 +424,18 @@ int main(int argc, char **argv) } - if (wsman_client_get_response_code(cl) != 200) { + if (wsmc_get_response_code(cl) != 200) { fprintf(stderr, "Connection failed. response code = %ld\n", - wsman_client_get_response_code(cl)); - if (wsman_client_get_fault_string(cl)) { + wsmc_get_response_code(cl)); + if (wsmc_get_fault_string(cl)) { fprintf(stderr, "%s\n", - wsman_client_get_fault_string(cl)); + wsmc_get_fault_string(cl)); } } - wsman_client_options_destroy(options); - wsman_client_release(cl); + wsmc_options_destroy(options); + wsmc_release(cl); - wsman_client_transport_fini(); + wsmc_transport_fini(); if (ini) { iniparser_freedict(ini); } diff --git a/tests/cunit/common.c b/tests/cunit/common.c index d41483c..3735026 100644 --- a/tests/cunit/common.c +++ b/tests/cunit/common.c @@ -26,21 +26,21 @@ int init_test(void) { {"localhost", 8889, "/wsman", "http", "wsman", "secret"} }; - cl = wsman_client_create( + cl = wsmc_create( sd[0].server, sd[0].port, sd[0].path, sd[0].scheme, sd[0].username, sd[0].password); - wsman_client_transport_init(cl, NULL); + wsmc_transport_init(cl, NULL); return 0; } int clean_test(void) { - wsman_client_release(cl); - wsman_client_transport_fini(cl); + wsmc_release(cl); + wsmc_transport_fini(cl); return 0; } diff --git a/tests/cunit/enumeration.c b/tests/cunit/enumeration.c index b0a04c5..bb9f6c4 100644 --- a/tests/cunit/enumeration.c +++ b/tests/cunit/enumeration.c @@ -264,36 +264,36 @@ static void enumeration_test() { char *selectors = NULL; - wsman_client_reinit_conn(cl); - options = wsman_client_options_init(); + wsmc_reinit_conn(cl); + options = wsmc_options_init(); options->flags = tests[i].flags; if (tests[i].selectors) { selectors = u_strdup_printf(tests[i].selectors, host, host, host); - wsman_client_add_selectors_from_str(options, selectors); + wsmc_add_selectors_from_str(options, selectors); } options->max_elements = tests[i].max_elements; - WsXmlDocH enum_response = wsman_client_action_enumerate(cl, + WsXmlDocH enum_response = wsmc_action_enumerate(cl, (char *)tests[i].resource_uri, options); - CU_ASSERT_TRUE(wsman_client_get_response_code(cl) == tests[i].final_status); - if (wsman_client_get_response_code(cl) != tests[i].final_status) { + CU_ASSERT_TRUE(wsmc_get_response_code(cl) == tests[i].final_status); + if (wsmc_get_response_code(cl) != tests[i].final_status) { if (verbose) { printf("\nExpected = %ld\nReturned = %ld ", - tests[i].final_status, wsman_client_get_response_code(cl)); + tests[i].final_status, wsmc_get_response_code(cl)); } goto RETURN; } CU_ASSERT_PTR_NOT_NULL(enum_response); if (enum_response) { - enumContext = wsman_client_get_enum_context(enum_response); + enumContext = wsmc_get_enum_context(enum_response); } else { goto RETURN; } - check_response_header(enum_response, wsman_client_get_response_code(cl), + check_response_header(enum_response, wsmc_get_response_code(cl), ENUM_ACTION_ENUMERATERESPONSE); //if (i==11) ws_xml_dump_node_tree(stdout, ws_xml_get_doc_root(enum_response)); @@ -305,7 +305,7 @@ static void enumeration_test() { RETURN: u_free(selectors); if (enumContext) { - wsman_client_action_release(cl, + wsmc_action_release(cl, (char *)tests[i].resource_uri, options, enumContext); @@ -313,7 +313,7 @@ RETURN: if (enum_response) { ws_xml_destroy_doc(enum_response); } - wsman_client_options_destroy(options); + wsmc_options_destroy(options); i++; // decrease executed test number } diff --git a/tests/cunit/identify.c b/tests/cunit/identify.c index 9e3b1d3..ac53ad9 100644 --- a/tests/cunit/identify.c +++ b/tests/cunit/identify.c @@ -98,11 +98,11 @@ identify_test() { static int i = 0; char *xp = NULL; - wsman_client_reinit_conn(cl); - options = wsman_client_options_init(); + wsmc_reinit_conn(cl); + options = wsmc_options_init(); - response = wsman_client_action_identify(cl, options); - CU_ASSERT_TRUE(wsman_client_get_response_code(cl) == tests[i].final_status); + response = wsmc_action_identify(cl, options); + CU_ASSERT_TRUE(wsmc_get_response_code(cl) == tests[i].final_status); CU_ASSERT_PTR_NOT_NULL(response); if (response == NULL) { @@ -122,7 +122,7 @@ RETURN: ws_xml_destroy_doc(response); } u_free(xp); - wsman_client_options_destroy(options); + wsmc_options_destroy(options); i++; } diff --git a/tests/cunit/invoke.c b/tests/cunit/invoke.c index 60650f5..e7e8cde 100755 --- a/tests/cunit/invoke.c +++ b/tests/cunit/invoke.c @@ -191,34 +191,34 @@ static void invoke_test() { char *selectors = NULL; - options = wsman_client_options_init(); + options = wsmc_options_init(); if (invoke_tests[i].selectors) { selectors = u_strdup_printf(invoke_tests[i].selectors, host, host, host); } - wsman_client_reinit_conn(cl); + wsmc_reinit_conn(cl); if (selectors != NULL) { - wsman_client_add_selectors_from_str (options, selectors); + wsmc_add_selectors_from_str (options, selectors); } if (invoke_tests[i].properties != NULL) { - wsman_client_add_prop_from_str (options, + wsmc_add_prop_from_str (options, invoke_tests[i].properties); } options->flags = invoke_tests[i].flags; - doc = wsman_client_action_invoke(cl, (char *)invoke_tests[i].resource_uri, options, + doc = wsmc_action_invoke(cl, (char *)invoke_tests[i].resource_uri, options, (char *)invoke_tests[i].method, NULL); //ws_xml_dump_node_tree(stdout, ws_xml_get_doc_root(doc)); - CU_ASSERT_TRUE(wsman_client_get_response_code(cl) == + CU_ASSERT_TRUE(wsmc_get_response_code(cl) == invoke_tests[i].final_status); - if (wsman_client_get_response_code(cl) != + if (wsmc_get_response_code(cl) != invoke_tests[i].final_status) { if (verbose) { printf("\nExpected = %ld\nReturned = %ld ", invoke_tests[i].final_status, - wsman_client_get_response_code(cl)); + wsmc_get_response_code(cl)); } goto RETURN; } @@ -274,7 +274,7 @@ RETURN: ws_xml_destroy_doc(doc); } u_free(selectors); - wsman_client_options_destroy(options); + wsmc_options_destroy(options); i++; // increase executed test number } diff --git a/tests/cunit/pull.c b/tests/cunit/pull.c index 6fdd13d..aaa95d3 100644 --- a/tests/cunit/pull.c +++ b/tests/cunit/pull.c @@ -159,37 +159,37 @@ static void pull_test() { char *xp = NULL; int num; - wsman_client_reinit_conn(cl); - options = wsman_client_options_init(); + wsmc_reinit_conn(cl); + options = wsmc_options_init(); options->flags = pull_tests[i].flags; if (pull_tests[i].selectors != NULL) - wsman_client_add_selectors_from_str(options, pull_tests[i].selectors); + wsmc_add_selectors_from_str(options, pull_tests[i].selectors); options->max_elements = pull_tests[i].max_elements; - WsXmlDocH enum_response = wsman_client_action_enumerate(cl, + WsXmlDocH enum_response = wsmc_action_enumerate(cl, (char *)pull_tests[i].resource_uri, options); - CU_ASSERT_TRUE(wsman_client_get_response_code(cl) == + CU_ASSERT_TRUE(wsmc_get_response_code(cl) == pull_tests[i].final_status); - if (wsman_client_get_response_code(cl) != pull_tests[i].final_status) { + if (wsmc_get_response_code(cl) != pull_tests[i].final_status) { if (verbose) { printf("\nExpected = %ld\nReturned = %ld ", pull_tests[i].final_status, - wsman_client_get_response_code(cl)); + wsmc_get_response_code(cl)); } goto RETURN; } CU_ASSERT_PTR_NOT_NULL(enum_response); if (enum_response) { - enumContext = wsman_client_get_enum_context(enum_response); + enumContext = wsmc_get_enum_context(enum_response); } else { enumContext = NULL; } while (enumContext != NULL) { - WsXmlDocH docp = wsman_client_action_pull(cl, (char *)pull_tests[i].resource_uri, + WsXmlDocH docp = wsmc_action_pull(cl, (char *)pull_tests[i].resource_uri, options, enumContext); CU_ASSERT_PTR_NOT_NULL(docp); if (!docp) { @@ -223,7 +223,7 @@ static void pull_test() { } goto RETURN; } - enumContext = wsman_client_get_enum_context(docp); + enumContext = wsmc_get_enum_context(docp); ws_xml_destroy_doc(docp); } @@ -234,7 +234,7 @@ RETURN: ws_xml_destroy_doc(enum_response); } u_free(xp); - wsman_client_options_destroy(options); + wsmc_options_destroy(options); i++; // decrease executed test number } diff --git a/tests/cunit/transfer_get.c b/tests/cunit/transfer_get.c index 539452c..1867e29 100644 --- a/tests/cunit/transfer_get.c +++ b/tests/cunit/transfer_get.c @@ -171,16 +171,16 @@ static void transfer_get_test() { u_strdup_printf(get_tests[i].selectors, host, host, host); } - wsman_client_reinit_conn(cl); - options = wsman_client_options_init(); + wsmc_reinit_conn(cl); + options = wsmc_options_init(); if (get_tests[i].selectors != NULL) { - wsman_client_add_selectors_from_str (options, get_tests[i].selectors); + wsmc_add_selectors_from_str (options, get_tests[i].selectors); } - doc = wsman_client_action_get(cl, (char *)get_tests[i].resource_uri, options); - CU_ASSERT_TRUE(wsman_client_get_response_code(cl) == get_tests[i].final_status); + doc = wsmc_action_get(cl, (char *)get_tests[i].resource_uri, options); + CU_ASSERT_TRUE(wsmc_get_response_code(cl) == get_tests[i].final_status); CU_ASSERT_PTR_NOT_NULL(doc); if (!doc) { @@ -229,7 +229,7 @@ RETURN: } u_free((char *)get_tests[i].selectors); get_tests[i].selectors = old_selectors; - wsman_client_options_destroy(options); + wsmc_options_destroy(options); i++; // increase executed test number } diff --git a/tests/cunit/transfer_put.c b/tests/cunit/transfer_put.c index b7c1714..21b62c7 100755 --- a/tests/cunit/transfer_put.c +++ b/tests/cunit/transfer_put.c @@ -181,28 +181,28 @@ static void transfer_put_test() { u_strdup_printf(put_tests[i].selectors, host, host, host); } - options = wsman_client_options_init(); + options = wsmc_options_init(); if (put_tests[i].selectors != NULL) { - wsman_client_add_selectors_from_str (options, selectors); + wsmc_add_selectors_from_str (options, selectors); } if (put_tests[i].properties != NULL) { - wsman_client_add_prop_from_str (options, + wsmc_add_prop_from_str (options, put_tests[i].properties); } options->flags = put_tests[i].flags; - doc = wsman_client_action_get_and_put(cl, (char *)put_tests[i].resource_uri, options); + doc = wsmc_action_get_and_put(cl, (char *)put_tests[i].resource_uri, options); //ws_xml_dump_node_tree(stdout, ws_xml_get_doc_root(doc)); - CU_ASSERT_TRUE(wsman_client_get_response_code(cl) == + CU_ASSERT_TRUE(wsmc_get_response_code(cl) == put_tests[i].final_status); - if (wsman_client_get_response_code(cl) != + if (wsmc_get_response_code(cl) != put_tests[i].final_status) { if (verbose) { printf("\nExpected = %ld, Returned = %ld ", put_tests[i].final_status, - wsman_client_get_response_code(cl)); + wsmc_get_response_code(cl)); // ws_xml_dump_node_tree(stdout, ws_xml_get_doc_root(doc)); } goto RETURN; @@ -259,7 +259,7 @@ RETURN: ws_xml_destroy_doc(doc); } u_free(selectors); - wsman_client_options_destroy(options); + wsmc_options_destroy(options); i++; // increase executed test number } diff --git a/tests/interop/interop.c b/tests/interop/interop.c index b6bba52..d75e928 100644 --- a/tests/interop/interop.c +++ b/tests/interop/interop.c @@ -81,10 +81,10 @@ static int pull_items(WsManClient *cl, WsXmlDocH doc, void *data) static int run_interop_test (WsManClient *cl, WsXmlNodeH scenario, InteropTest id) { WsXmlDocH response; - client_opt_t *options = wsman_client_options_init(); - wsman_client_set_action_option(options,FLAG_DUMP_REQUEST ); + client_opt_t *options = wsmc_options_init(); + wsmc_set_action_option(options,FLAG_DUMP_REQUEST ); if (id == 0) { // 6.1 Identify - response = wsman_client_action_identify(cl, options); + response = wsmc_action_identify(cl, options); xml_parser_doc_dump(stdout, response); }else if (id == 2) { // 6.2 Get @@ -92,7 +92,7 @@ static int run_interop_test (WsManClient *cl, WsXmlNodeH scenario, InteropTest i WsXmlNodeH r = ws_xml_get_child(input, 0, NULL, "ResourceURI"); wsman_add_selectors_list_from_node(input, options); char *resource_uri = ws_xml_get_node_text(r); - response = wsman_client_action_get(cl, resource_uri, options); + response = wsmc_action_get(cl, resource_uri, options); xml_parser_doc_dump(stdout, response); }else if (id == 3) { // 6.3 Get failure - invalid resoure URI @@ -100,7 +100,7 @@ static int run_interop_test (WsManClient *cl, WsXmlNodeH scenario, InteropTest i WsXmlNodeH r = ws_xml_get_child(input, 0, NULL, "ResourceURI"); wsman_add_selectors_list_from_node(input, options); char *resource_uri = ws_xml_get_node_text(r); - response = wsman_client_action_get(cl, resource_uri, options); + response = wsmc_action_get(cl, resource_uri, options); xml_parser_doc_dump(stdout, response); }else if (id == 4) { // 6.4 Get failure (MaxEnvelop exceeded) @@ -108,7 +108,7 @@ static int run_interop_test (WsManClient *cl, WsXmlNodeH scenario, InteropTest i WsXmlNodeH r = ws_xml_get_child(input, 0, NULL, "ResourceURI"); wsman_add_selectors_list_from_node(input, options); char *resource_uri = ws_xml_get_node_text(r); - response = wsman_client_action_get(cl, resource_uri, options); + response = wsmc_action_get(cl, resource_uri, options); xml_parser_doc_dump(stdout, response); }else if (id == 5) { // 6.5 Get failure - invalid selectors @@ -116,7 +116,7 @@ static int run_interop_test (WsManClient *cl, WsXmlNodeH scenario, InteropTest i WsXmlNodeH r = ws_xml_get_child(input, 0, NULL, "ResourceURI"); wsman_add_selectors_list_from_node(input, options); char *resource_uri = ws_xml_get_node_text(r); - response = wsman_client_action_get(cl, resource_uri, options); + response = wsmc_action_get(cl, resource_uri, options); xml_parser_doc_dump(stdout, response); }else if (id == 8) { // 7.1 Enumerate" @@ -126,7 +126,7 @@ static int run_interop_test (WsManClient *cl, WsXmlNodeH scenario, InteropTest i wsenum_enumerate_and_pull(cl, resource_uri , options, pull_items, NULL ); }else if (id == 9) { // 7.2 Optimized Enumerate - wsman_client_set_action_option(options, FLAG_ENUMERATION_OPTIMIZATION); + wsmc_set_action_option(options, FLAG_ENUMERATION_OPTIMIZATION); WsXmlNodeH input = ws_xml_get_child(scenario, 0, NULL, "Input"); WsXmlNodeH r = ws_xml_get_child(input, 0, NULL, "ResourceURI"); char *resource_uri = ws_xml_get_node_text(r); @@ -150,14 +150,14 @@ static int run_interop_test (WsManClient *cl, WsXmlNodeH scenario, InteropTest i }else if (id == 11) { // 7.4 Enumerate ObjectAndEPR - wsman_client_set_action_option(options, FLAG_ENUMERATION_ENUM_EPR); + wsmc_set_action_option(options, FLAG_ENUMERATION_ENUM_EPR); WsXmlNodeH input = ws_xml_get_child(scenario, 0, NULL, "Input"); WsXmlNodeH r = ws_xml_get_child(input, 0, NULL, "ResourceURI"); char *resource_uri = ws_xml_get_node_text(r); wsenum_enumerate_and_pull(cl, resource_uri , options, pull_items, NULL ); }else if (id == 16) { // 7.9 Enumerate Polymorphism - wsman_client_set_action_option(options, FLAG_POLYMORPHISM_NONE); + wsmc_set_action_option(options, FLAG_POLYMORPHISM_NONE); WsXmlNodeH input = ws_xml_get_child(scenario, 0, NULL, "Input"); WsXmlNodeH r = ws_xml_get_child(input, 0, NULL, "ResourceURI"); char *resource_uri = ws_xml_get_node_text(r); @@ -170,7 +170,7 @@ static int run_interop_test (WsManClient *cl, WsXmlNodeH scenario, InteropTest i char *resource_uri = ws_xml_get_node_text(r); char *method = ws_xml_get_node_text(m); wsman_add_selectors_list_from_node(input, options); - response = wsman_client_action_invoke(cl, resource_uri, options, method, NULL); + response = wsmc_action_invoke(cl, resource_uri, options, method, NULL); xml_parser_doc_dump(stdout, response); }else if (id == 18) { // 9.1 Put @@ -183,7 +183,7 @@ static int run_interop_test (WsManClient *cl, WsXmlNodeH scenario, InteropTest i wsman_add_selectors_list_from_node(input, options); set_props(options, ws_xml_get_node_text(k), ws_xml_get_node_text(v) ); - response = wsman_client_action_get_and_put(cl, resource_uri, options); + response = wsmc_action_get_and_put(cl, resource_uri, options); xml_parser_doc_dump(stdout, response); } @@ -240,20 +240,20 @@ int main(int argc, char** argv) } wsman_debug_set_level(debug_level); - cl = wsman_client_create( uri->host, + cl = wsmc_create( uri->host, uri->port, uri->path, uri->scheme, uri->user, uri->pwd); - wsman_client_transport_init(cl, NULL); - options = wsman_client_options_init(); + wsmc_transport_init(cl, NULL); + options = wsmc_options_init(); if (file == NULL) { fprintf(stderr, "Interop file required\n"); return 1; } - doc = wsman_client_read_file(cl, file, "UTF-8", 0); + doc = wsmc_read_file(cl, file, "UTF-8", 0); //xml_parser_doc_dump(stdout, doc); |