summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAnas Nashif <nashif@intel.com>2007-05-16 23:55:28 +0000
committerAnas Nashif <nashif@intel.com>2007-05-16 23:55:28 +0000
commit1cc54578baf92beada66be79aecdd0f5341f5cdd (patch)
treeb8e8aec74b508c097ab2d9de59e37185614de184 /tests
parent16803fdddfa698aa7586245d8a48ef25f480635a (diff)
downloadwsmancli-1cc54578baf92beada66be79aecdd0f5341f5cdd.tar.gz
wsmancli-1cc54578baf92beada66be79aecdd0f5341f5cdd.tar.xz
wsmancli-1cc54578baf92beada66be79aecdd0f5341f5cdd.zip
wsman_client -> wsmc
Diffstat (limited to 'tests')
-rw-r--r--tests/cunit/common.c8
-rw-r--r--tests/cunit/enumeration.c22
-rw-r--r--tests/cunit/identify.c10
-rwxr-xr-xtests/cunit/invoke.c18
-rw-r--r--tests/cunit/pull.c22
-rw-r--r--tests/cunit/transfer_get.c12
-rwxr-xr-xtests/cunit/transfer_put.c16
-rw-r--r--tests/interop/interop.c32
8 files changed, 70 insertions, 70 deletions
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);