summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAnas Nashif <nashif@intel.com>2007-05-16 23:15:19 +0000
committerAnas Nashif <nashif@intel.com>2007-05-16 23:15:19 +0000
commit6d02c9a6c69c7aeafdb0c55e5d70ffb5f0b06230 (patch)
tree1480431c3f233ae4bf2af5a4bce44c7ff9158f9f /tests
parent30a0e40701704a4388bea110acd0836df3716036 (diff)
downloadwsmancli-6d02c9a6c69c7aeafdb0c55e5d70ffb5f0b06230.tar.gz
wsmancli-6d02c9a6c69c7aeafdb0c55e5d70ffb5f0b06230.tar.xz
wsmancli-6d02c9a6c69c7aeafdb0c55e5d70ffb5f0b06230.zip
api changes
Diffstat (limited to 'tests')
-rw-r--r--tests/cunit/common.c4
-rw-r--r--tests/cunit/enumeration.c14
-rw-r--r--tests/cunit/identify.c10
-rwxr-xr-xtests/cunit/invoke.c10
-rw-r--r--tests/cunit/pull.c16
-rw-r--r--tests/cunit/transfer_get.c10
-rwxr-xr-xtests/cunit/transfer_put.c8
-rw-r--r--tests/interop/interop.c26
8 files changed, 49 insertions, 49 deletions
diff --git a/tests/cunit/common.c b/tests/cunit/common.c
index 93b210d..d41483c 100644
--- a/tests/cunit/common.c
+++ b/tests/cunit/common.c
@@ -26,7 +26,7 @@ int init_test(void) {
{"localhost", 8889, "/wsman", "http", "wsman", "secret"}
};
- cl = wsman_create_client(
+ cl = wsman_client_create(
sd[0].server,
sd[0].port,
sd[0].path,
@@ -39,7 +39,7 @@ int init_test(void) {
int clean_test(void) {
- wsman_release_client(cl);
+ wsman_client_release(cl);
wsman_client_transport_fini(cl);
return 0;
}
diff --git a/tests/cunit/enumeration.c b/tests/cunit/enumeration.c
index 8d7a6b3..d689dcd 100644
--- a/tests/cunit/enumeration.c
+++ b/tests/cunit/enumeration.c
@@ -253,7 +253,7 @@ static int ntests = sizeof (tests) / sizeof (tests[0]);
extern WsManClient *cl;
-actionOptions *options;
+client_opt_t *options;
@@ -264,8 +264,8 @@ static void enumeration_test() {
char *selectors = NULL;
- reinit_client_connection(cl);
- options = initialize_action_options();
+ wsman_client_reinit_conn(cl);
+ options = wsman_client_options_init();
options->flags = tests[i].flags;
@@ -276,7 +276,7 @@ static void enumeration_test() {
}
options->max_elements = tests[i].max_elements;
- WsXmlDocH enum_response = wsenum_enumerate(cl,
+ WsXmlDocH enum_response = wsman_client_action_enumerate(cl,
(char *)tests[i].resource_uri, options);
CU_ASSERT_TRUE(wsman_client_get_response_code(cl) == tests[i].final_status);
@@ -289,7 +289,7 @@ static void enumeration_test() {
}
CU_ASSERT_PTR_NOT_NULL(enum_response);
if (enum_response) {
- enumContext = wsenum_get_enum_context(enum_response);
+ enumContext = wsman_client_get_enum_context(enum_response);
} else {
goto RETURN;
}
@@ -305,7 +305,7 @@ static void enumeration_test() {
RETURN:
u_free(selectors);
if (enumContext) {
- wsenum_release(cl,
+ wsman_client_action_release(cl,
(char *)tests[i].resource_uri,
options,
enumContext);
@@ -313,7 +313,7 @@ RETURN:
if (enum_response) {
ws_xml_destroy_doc(enum_response);
}
- destroy_action_options(options);
+ wsman_client_options_destroy(options);
i++; // decrease executed test number
}
diff --git a/tests/cunit/identify.c b/tests/cunit/identify.c
index cb55a82..9e3b1d3 100644
--- a/tests/cunit/identify.c
+++ b/tests/cunit/identify.c
@@ -87,7 +87,7 @@ static int ntests = sizeof (tests) / sizeof (tests[0]);
extern WsManClient *cl;
-actionOptions *options;
+client_opt_t *options;
@@ -98,10 +98,10 @@ identify_test() {
static int i = 0;
char *xp = NULL;
- reinit_client_connection(cl);
- options = initialize_action_options();
+ wsman_client_reinit_conn(cl);
+ options = wsman_client_options_init();
- response = wsman_identify(cl, options);
+ response = wsman_client_action_identify(cl, options);
CU_ASSERT_TRUE(wsman_client_get_response_code(cl) == tests[i].final_status);
CU_ASSERT_PTR_NOT_NULL(response);
@@ -122,7 +122,7 @@ RETURN:
ws_xml_destroy_doc(response);
}
u_free(xp);
- destroy_action_options(options);
+ wsman_client_options_destroy(options);
i++;
}
diff --git a/tests/cunit/invoke.c b/tests/cunit/invoke.c
index da41104..78e13a6 100755
--- a/tests/cunit/invoke.c
+++ b/tests/cunit/invoke.c
@@ -181,7 +181,7 @@ static int ntests = sizeof (invoke_tests) / sizeof (invoke_tests[0]);
extern WsManClient *cl;
-actionOptions *options;
+client_opt_t *options;
static void invoke_test() {
WsXmlDocH doc;
@@ -191,13 +191,13 @@ static void invoke_test() {
char *selectors = NULL;
- options = initialize_action_options();
+ options = wsman_client_options_init();
if (invoke_tests[i].selectors) {
selectors =
u_strdup_printf(invoke_tests[i].selectors, host, host, host);
}
- reinit_client_connection(cl);
+ wsman_client_reinit_conn(cl);
if (selectors != NULL) {
wsman_add_selectors_from_query_string (options, selectors);
@@ -208,7 +208,7 @@ static void invoke_test() {
}
options->flags = invoke_tests[i].flags;
- doc = wsman_invoke(cl, (char *)invoke_tests[i].resource_uri, options,
+ doc = wsman_client_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) ==
@@ -274,7 +274,7 @@ RETURN:
ws_xml_destroy_doc(doc);
}
u_free(selectors);
- destroy_action_options(options);
+ wsman_client_options_destroy(options);
i++; // increase executed test number
}
diff --git a/tests/cunit/pull.c b/tests/cunit/pull.c
index 62e6a61..71dcb54 100644
--- a/tests/cunit/pull.c
+++ b/tests/cunit/pull.c
@@ -151,7 +151,7 @@ static int ntests = sizeof (pull_tests) / sizeof (pull_tests[0]);
extern WsManClient *cl;
-actionOptions *options;
+client_opt_t *options;
static void pull_test() {
char *enumContext = NULL;
@@ -159,8 +159,8 @@ static void pull_test() {
char *xp = NULL;
int num;
- reinit_client_connection(cl);
- options = initialize_action_options();
+ wsman_client_reinit_conn(cl);
+ options = wsman_client_options_init();
options->flags = pull_tests[i].flags;
@@ -168,7 +168,7 @@ static void pull_test() {
wsman_add_selectors_from_query_string(options, pull_tests[i].selectors);
options->max_elements = pull_tests[i].max_elements;
- WsXmlDocH enum_response = wsenum_enumerate(cl,
+ WsXmlDocH enum_response = wsman_client_action_enumerate(cl,
(char *)pull_tests[i].resource_uri, options);
CU_ASSERT_TRUE(wsman_client_get_response_code(cl) ==
pull_tests[i].final_status);
@@ -183,13 +183,13 @@ static void pull_test() {
CU_ASSERT_PTR_NOT_NULL(enum_response);
if (enum_response) {
- enumContext = wsenum_get_enum_context(enum_response);
+ enumContext = wsman_client_get_enum_context(enum_response);
} else {
enumContext = NULL;
}
while (enumContext != NULL) {
- WsXmlDocH docp = wsenum_pull(cl, (char *)pull_tests[i].resource_uri,
+ WsXmlDocH docp = wsman_client_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 = wsenum_get_enum_context(docp);
+ enumContext = wsman_client_get_enum_context(docp);
ws_xml_destroy_doc(docp);
}
@@ -234,7 +234,7 @@ RETURN:
ws_xml_destroy_doc(enum_response);
}
u_free(xp);
- destroy_action_options(options);
+ wsman_client_options_destroy(options);
i++; // decrease executed test number
}
diff --git a/tests/cunit/transfer_get.c b/tests/cunit/transfer_get.c
index c6538f3..5a17e3e 100644
--- a/tests/cunit/transfer_get.c
+++ b/tests/cunit/transfer_get.c
@@ -156,7 +156,7 @@ static int ntests = sizeof (get_tests) / sizeof (get_tests[0]);
extern WsManClient *cl;
-actionOptions *options;
+client_opt_t *options;
static void transfer_get_test() {
WsXmlDocH doc;
@@ -171,15 +171,15 @@ static void transfer_get_test() {
u_strdup_printf(get_tests[i].selectors, host, host, host);
}
- reinit_client_connection(cl);
- options = initialize_action_options();
+ wsman_client_reinit_conn(cl);
+ options = wsman_client_options_init();
if (get_tests[i].selectors != NULL) {
wsman_add_selectors_from_query_string (options, get_tests[i].selectors);
}
- doc = ws_transfer_get(cl, (char *)get_tests[i].resource_uri, options);
+ 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);
CU_ASSERT_PTR_NOT_NULL(doc);
@@ -229,7 +229,7 @@ RETURN:
}
u_free((char *)get_tests[i].selectors);
get_tests[i].selectors = old_selectors;
- destroy_action_options(options);
+ wsman_client_options_destroy(options);
i++; // increase executed test number
}
diff --git a/tests/cunit/transfer_put.c b/tests/cunit/transfer_put.c
index d90abb5..9b25a4c 100755
--- a/tests/cunit/transfer_put.c
+++ b/tests/cunit/transfer_put.c
@@ -166,7 +166,7 @@ static int ntests = sizeof (put_tests) / sizeof (put_tests[0]);
extern WsManClient *cl;
-actionOptions *options;
+client_opt_t *options;
static void transfer_put_test() {
WsXmlDocH doc;
@@ -181,7 +181,7 @@ static void transfer_put_test() {
u_strdup_printf(put_tests[i].selectors, host, host, host);
}
- options = initialize_action_options();
+ options = wsman_client_options_init();
if (put_tests[i].selectors != NULL) {
wsman_add_selectors_from_query_string (options, selectors);
@@ -193,7 +193,7 @@ static void transfer_put_test() {
options->flags = put_tests[i].flags;
- doc = ws_transfer_get_and_put(cl, (char *)put_tests[i].resource_uri, options);
+ doc = wsman_client_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) ==
put_tests[i].final_status);
@@ -259,7 +259,7 @@ RETURN:
ws_xml_destroy_doc(doc);
}
u_free(selectors);
- destroy_action_options(options);
+ wsman_client_options_destroy(options);
i++; // increase executed test number
}
diff --git a/tests/interop/interop.c b/tests/interop/interop.c
index 5fea63f..5bea1b1 100644
--- a/tests/interop/interop.c
+++ b/tests/interop/interop.c
@@ -27,7 +27,7 @@ typedef enum {
INTEROP_IDENTIFY = 0
} InteropTest;
-static set_props(actionOptions *op, char *k, char *v)
+static set_props(client_opt_t *op, char *k, char *v)
{
op->properties = hash_create(HASHCOUNT_T_MAX, 0, 0);
@@ -38,7 +38,7 @@ static set_props(actionOptions *op, char *k, char *v)
}
static void
-wsman_add_selectors_list_from_node( WsXmlNodeH input, actionOptions *options)
+wsman_add_selectors_list_from_node( WsXmlNodeH input, client_opt_t *options)
{
hash_t *h = hash_create(HASHCOUNT_T_MAX, 0, 0);
@@ -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;
- actionOptions *options = initialize_action_options();
+ client_opt_t *options = wsman_client_options_init();
wsman_set_action_option(options,FLAG_DUMP_REQUEST );
if (id == 0) { // 6.1 Identify
- response = wsman_identify(cl, options);
+ response = wsman_client_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 = ws_transfer_get(cl, resource_uri, options);
+ response = wsman_client_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 = ws_transfer_get(cl, resource_uri, options);
+ response = wsman_client_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 = ws_transfer_get(cl, resource_uri, options);
+ response = wsman_client_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 = ws_transfer_get(cl, resource_uri, options);
+ response = wsman_client_action_get(cl, resource_uri, options);
xml_parser_doc_dump(stdout, response);
}else if (id == 8) { // 7.1 Enumerate"
@@ -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_invoke(cl, resource_uri, options, method, NULL);
+ response = wsman_client_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 = ws_transfer_get_and_put(cl, resource_uri, options);
+ response = wsman_client_action_get_and_put(cl, resource_uri, options);
xml_parser_doc_dump(stdout, response);
}
@@ -199,7 +199,7 @@ int main(int argc, char** argv)
WsManClient *cl;
WsXmlDocH doc;
- actionOptions *options;
+ client_opt_t *options;
char retval = 0;
u_error_t *error = NULL;
@@ -240,14 +240,14 @@ int main(int argc, char** argv)
}
wsman_debug_set_level(debug_level);
- cl = wsman_create_client( uri->host,
+ cl = wsman_client_create( uri->host,
uri->port,
uri->path,
uri->scheme,
uri->user,
uri->pwd);
wsman_client_transport_init(cl, NULL);
- options = initialize_action_options();
+ options = wsman_client_options_init();
if (file == NULL) {
fprintf(stderr, "Interop file required\n");