summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Revyakin <vadimr@intel.com>2006-11-28 16:37:07 +0000
committerVadim Revyakin <vadimr@intel.com>2006-11-28 16:37:07 +0000
commit3fa7b7cb09aef7284693668c7845871b164b3cdd (patch)
tree4342503d8992a12e1fb677e2abc4a96a47773557
parent398e3cef7cf644692a254c298d28409401fbc86c (diff)
downloadwsmancli-3fa7b7cb09aef7284693668c7845871b164b3cdd.tar.gz
wsmancli-3fa7b7cb09aef7284693668c7845871b164b3cdd.tar.xz
wsmancli-3fa7b7cb09aef7284693668c7845871b164b3cdd.zip
Response header check fixed
-rw-r--r--tests/cunit/common.c14
-rw-r--r--tests/cunit/common.h2
-rw-r--r--tests/cunit/enumeration.c4
3 files changed, 13 insertions, 7 deletions
diff --git a/tests/cunit/common.c b/tests/cunit/common.c
index d1a7a61..7c6e3b4 100644
--- a/tests/cunit/common.c
+++ b/tests/cunit/common.c
@@ -47,7 +47,7 @@ int clean_test(void) {
}
-void check_response_header(WsXmlDocH doc, char *action) {
+void check_response_header(WsXmlDocH doc, long resp_code, char *action) {
char *xp = NULL;
xp = ws_xml_get_xpath_value(doc, "/s:Envelope/s:Header/wsa:To");
@@ -57,14 +57,18 @@ void check_response_header(WsXmlDocH doc, char *action) {
"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous");
}
u_free(xp);
- /*
+
xp = ws_xml_get_xpath_value(doc, "/s:Envelope/s:Header/wsa:Action");
CU_ASSERT_PTR_NOT_NULL(xp);
- if (xp != NULL && action != NULL) {
- CU_ASSERT_STRING_EQUAL(xp, action);
+ if (xp != NULL) {
+ if (resp_code == 200 && action != NULL) {
+ CU_ASSERT_STRING_EQUAL(xp, action);
+ } else if (resp_code == 500) {
+ CU_ASSERT_STRING_EQUAL(xp,
+ "http://schemas.xmlsoap.org/ws/2004/08/addressing/fault");
+ }
}
u_free(xp);
- */
xp = ws_xml_get_xpath_value(doc, "/s:Envelope/s:Header/wsa:MessageID");
CU_ASSERT_PTR_NOT_NULL(xp);
u_free(xp);
diff --git a/tests/cunit/common.h b/tests/cunit/common.h
index 7491223..d6e50f8 100644
--- a/tests/cunit/common.h
+++ b/tests/cunit/common.h
@@ -60,7 +60,7 @@ int add_transfer_put_tests(CU_pSuite ps);
int add_invoke_tests(CU_pSuite ps);
int add_pull_tests(CU_pSuite ps);
-void check_response_header(WsXmlDocH doc, char *action);
+void check_response_header(WsXmlDocH doc, long resp_code, char *action);
#endif
diff --git a/tests/cunit/enumeration.c b/tests/cunit/enumeration.c
index b891653..6b9455e 100644
--- a/tests/cunit/enumeration.c
+++ b/tests/cunit/enumeration.c
@@ -265,8 +265,10 @@ static void enumeration_test() {
} else {
goto RETURN;
}
- check_response_header(enum_response,
+ check_response_header(enum_response, wsman_get_client_response_code(cl),
"http://schemas.xmlsoap.org/ws/2004/09/enumeration/EnumerateResponse");
+
+http://schemas.xmlsoap.org/ws/2004/08/addressing/fault
if (_debug) wsman_output(enum_response);
if (tests[i].filters == NULL) {