summaryrefslogtreecommitdiffstats
path: root/src/lib/ccapi/unit-test
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/ccapi/unit-test')
-rw-r--r--src/lib/ccapi/unit-test/NTMakefile56
-rw-r--r--src/lib/ccapi/unit-test/t_ccache.c24
-rw-r--r--src/lib/ccapi/unit-test/t_context.c34
-rw-r--r--src/lib/ccapi/unit-test/t_server.c4
4 files changed, 68 insertions, 50 deletions
diff --git a/src/lib/ccapi/unit-test/NTMakefile b/src/lib/ccapi/unit-test/NTMakefile
index eb2fd53e2..9bb486b6d 100644
--- a/src/lib/ccapi/unit-test/NTMakefile
+++ b/src/lib/ccapi/unit-test/NTMakefile
@@ -1,30 +1,48 @@
-# Makefile for the CCAPI Generic Server
+!include <win32.mak>
-!INCLUDE <WIN32.MAK>
+CFLAGS = -I../include $(cdebug) $(cflags) $(cvarsmt)
-CFLAGS = -I../include
+WINLIBS = ws2_32.lib rpcrt4.lib $(guilibsdll)
-CCAPI_LIB = ../lib/ccapi.lib
-WINLIBS = user32.lib advapi32.lib
-CCSOBJS = context.obj ccache.obj lists.obj rpc_auth.obj serv_ops.obj
+T_CCACHE = t_ccache.exe
-all: t_lists.exe t_msg.exe t_ccache.exe t_context.exe ccapi_server.exe
+T_CONTEXT = t_context.exe
-t_lists.exe: t_lists.obj $(CCSOBJS) $(CCAPI_LIB)
- link -out:$@ t_lists.obj $(CCSOBJS) $(CCAPI_LIB) $(WINLIBS)
+T_LISTS = t_lists.exe
-t_msg.exe: t_msg.obj $(CCSOBJS) $(CCAPI_LIB)
- link -out:$@ t_msg.obj $(CCSOBJS) $(CCAPI_LIB) $(WINLIBS)
+T_MSG = t_msg.exe
-t_ccache.exe: t_ccache.obj $(CCSOBJS) $(CCAPI_LIB)
- link -out:$@ t_ccache.obj $(CCSOBJS) $(CCAPI_LIB) $(WINLIBS)
+T_SERVER = t_server.exe
-t_context.exe: t_context.obj $(CCSOBJS) $(CCAPI_LIB)
- link -out:$@ t_context.obj $(CCSOBJS) $(CCAPI_LIB) $(WINLIBS)
+all: $(T_CCACHE) $(T_CONTEXT) $(T_LISTS) $(T_MSG) $(T_SERVER)
-ccapi_server.exe: main.obj $(CCSOBJS) $(CCAPI_LIB)
- link -out:$@ main.obj $(CCSOBJS) $(CCAPI_LIB) $(WINLIBS)
+ntccrpc_c.c ntccrpc_s.c ntccrpc.h: ntccrpc.idl ntccrpc.acf
+ midl ntccrpc.idl /acf ntccrpc.acf
+
+CC_CLIENT_LIB = ..\client\cc_client.lib
+
+CC_COMMON_LIB = ..\common\cc_common.lib
+
+CC_SERVER_LIB = ..\server\cc_server.lib
+
+CC_API_LIB = ..\windows\krbcc32.lib
+
+$(T_CCACHE): t_ccache.obj $(CC_SERVER_LIB) $(CC_COMMON_LIB)
+ $(link) /NOLOGO $(conlibsmt) $(ldebug) $(conlflags) /OUT:$@ $** $(WINLIBS)
+
+$(T_CONTEXT): t_context.obj $(CC_SERVER_LIB) $(CC_COMMON_LIB)
+ $(link) /NOLOGO $(conlibsmt) $(ldebug) $(conlflags) /OUT:$@ $** $(WINLIBS)
+
+$(T_LISTS): t_lists.obj $(CC_SERVER_LIB) $(CC_COMMON_LIB)
+ $(link) /NOLOGO $(conlibsmt) $(ldebug) $(conlflags) /OUT:$@ $** $(WINLIBS)
+
+$(T_MSG): t_msg.obj $(CC_SERVER_LIB) $(CC_COMMON_LIB)
+ $(link) /NOLOGO $(conlibsmt) $(ldebug) $(conlflags) /OUT:$@ $** $(WINLIBS)
+
+$(T_SERVER): t_server.obj $(CC_SERVER_LIB) $(CC_COMMON_LIB)
+ $(link) /NOLOGO $(conlibsmt) $(ldebug) $(conlflags) /OUT:$@ $** $(WINLIBS)
+
+clean:
+ del *.exe *.dll *.lib *.exp *.obj ntccrpc_c.c ntccrpc_s.c ntccrpc.h
-clean:
- del *.obj *.exe
diff --git a/src/lib/ccapi/unit-test/t_ccache.c b/src/lib/ccapi/unit-test/t_ccache.c
index 6ef33ea23..175764e79 100644
--- a/src/lib/ccapi/unit-test/t_ccache.c
+++ b/src/lib/ccapi/unit-test/t_ccache.c
@@ -59,8 +59,8 @@ int main() {
int i;
cc_int32 code;
- code = cci_ccache_new("The first", p1, cc_credentials_v4_v5, &c1);
- code = cci_ccache_new("The 2nd", p2, cc_credentials_v4_v5, &c2);
+ code = ccs_ccache_new("The first", p1, cc_credentials_v4_v5, &c1);
+ code = ccs_ccache_new("The 2nd", p2, cc_credentials_v4_v5, &c2);
cred1 = (cc_server_credentials_t*)malloc(sizeof(cc_server_credentials_t));
memset(cred1,0,sizeof(cc_server_credentials_t));
@@ -83,30 +83,30 @@ int main() {
strncpy(cred2->creds.credentials.credentials_v4->principal, p1, strlen(p1));
cred3->creds.credentials.credentials_v5->client = p1;
- code = cci_ccache_store_creds(c1, &cred1->creds);
+ code = ccs_ccache_store_creds(c1, &cred1->creds);
printf("(c1, cred1) -> %d\n",code);
- code = cci_ccache_store_creds(c1, &cred2->creds);
+ code = ccs_ccache_store_creds(c1, &cred2->creds);
printf("(c1, cred2) -> %d\n",code);
- code = cci_ccache_store_creds(c2, &cred3->creds);
+ code = ccs_ccache_store_creds(c2, &cred3->creds);
printf("(c2, cred3) -> %d\n",code);
- code = cci_ccache_store_creds(c1, &cred3->creds);
+ code = ccs_ccache_store_creds(c1, &cred3->creds);
printf("(c1, cred3) -> %d\n",code);
i = 0;
- code = cci_ccache_move(c1, c2);
- code = cci_ccache_destroy(c1);
- code = cci_ccache_new_iterator(c2, &iterator);
- while (cci_credentials_iterate_has_next(iterator)) {
+ code = ccs_ccache_move(c1, c2);
+ code = ccs_ccache_destroy(c1);
+ code = ccs_ccache_new_iterator(c2, &iterator);
+ while (ccs_credentials_iterate_has_next(iterator)) {
i++;
- code = cci_credentials_iterate_next(iterator, &node);
+ code = ccs_credentials_iterate_next(iterator, &node);
stored_cred = (cc_server_credentials_t *)node->data;
printf("%d %d %s\n", stored_cred->is_default, stored_cred->creds.version, stored_cred->creds.credentials.credentials_v4->principal);
if (i == 1) {
- code = cci_ccache_rem_creds(c2,&cred2->creds);
+ code = ccs_ccache_rem_creds(c2,&cred2->creds);
printf("(c2 rem cred2) -> %d\n",code);
}
}
diff --git a/src/lib/ccapi/unit-test/t_context.c b/src/lib/ccapi/unit-test/t_context.c
index 9e35d9abf..d76ff78d9 100644
--- a/src/lib/ccapi/unit-test/t_context.c
+++ b/src/lib/ccapi/unit-test/t_context.c
@@ -68,10 +68,10 @@ int main() {
int i;
cc_int32 code;
- code = cci_context_new(5, auth_info, session_info, &ctx);
- code = cci_context_create_default_ccache(ctx, cc_credentials_v4, "Spike", &ccache);
- code = cci_context_get_default_ccache_name(ctx, &name);
- code = cci_context_open_ccache(ctx, name, &ccache);
+ code = ccs_context_new(5, auth_info, session_info, &ctx);
+ code = ccs_context_create_default_ccache(ctx, cc_credentials_v4, "Spike", &ccache);
+ code = ccs_context_get_default_ccache_name(ctx, &name);
+ code = ccs_context_open_ccache(ctx, name, &ccache);
for (i = 0; i < 5; i++) {
creds = (cc_credentials_union*)malloc(sizeof(cc_credentials_union));
@@ -79,32 +79,32 @@ int main() {
creds->credentials.credentials_v4 = (cc_credentials_v4_t*)malloc(sizeof(cc_credentials_v4_t));
strcpy(creds->credentials.credentials_v4->principal, "Spike");
- code = cci_ccache_store_creds(ccache, creds);
+ code = ccs_ccache_store_creds(ccache, creds);
}
- code = cci_context_create_ccache(ctx, "ccache 2", cc_credentials_v4, "Jeff", &ccache);
- code = cci_context_open_ccache(ctx, "ccache 2", &ccache);
+ code = ccs_context_create_ccache(ctx, "ccache 2", cc_credentials_v4_v5, "Jeff", &ccache);
+ code = ccs_context_open_ccache(ctx, "ccache 2", &ccache);
for (i = 0; i < 5; i++) {
creds = (cc_credentials_union*)malloc(sizeof(cc_credentials_union));
- creds->version = cc_credentials_v4;
- creds->credentials.credentials_v4 = (cc_credentials_v4_t*)malloc(sizeof(cc_credentials_v4_t));
- strcpy(creds->credentials.credentials_v4->principal, "Jeff");
+ creds->version = cc_credentials_v5;
+ creds->credentials.credentials_v5 = (cc_credentials_v5_t*)malloc(sizeof(cc_credentials_v5_t));
+ strcpy(creds->credentials.credentials_v5->principal, "Jeff");
- cci_ccache_store_creds(ccache, creds);
+ ccs_ccache_store_creds(ccache, creds);
}
- code = cci_context_ccache_iterator(ctx, &ccache_iterator);
- while (cci_ccache_iterate_has_next(ccache_iterator)) {
- code = cci_ccache_iterate_next(ccache_iterator, &ccache_node);
+ code = ccs_context_ccache_iterator(ctx, &ccache_iterator);
+ while (ccs_ccache_iterate_has_next(ccache_iterator)) {
+ code = ccs_ccache_iterate_next(ccache_iterator, &ccache_node);
ccache = (cc_server_ccache_t *)ccache_node->data;
printf("%x for %s %s default = %d v %d\n",
ccache, ccache->principal_v4, ccache->principal_v5,
ccache->is_default, ccache->versions);
- code = cci_ccache_new_iterator(ccache, &creds_iterator);
- while (cci_credentials_iterate_has_next(creds_iterator)) {
- code = cci_credentials_iterate_next(creds_iterator, &creds_node);
+ code = ccs_ccache_new_iterator(ccache, &creds_iterator);
+ while (ccs_credentials_iterate_has_next(creds_iterator)) {
+ code = ccs_credentials_iterate_next(creds_iterator, &creds_node);
server_creds = (cc_server_credentials_t *)creds_node->data;
printf("\t%s %d\n",
server_creds->creds.credentials.credentials_v4->principal,
diff --git a/src/lib/ccapi/unit-test/t_server.c b/src/lib/ccapi/unit-test/t_server.c
index d4d998466..d6093941e 100644
--- a/src/lib/ccapi/unit-test/t_server.c
+++ b/src/lib/ccapi/unit-test/t_server.c
@@ -143,7 +143,7 @@ main(void)
cc_session_info_t * session_info;
cc_int32 code;
- if ( cci_serv_initialize() != ccNoError )
+ if ( ccs_serv_initialize() != ccNoError )
return 1;
while ( 1 ) {
@@ -163,7 +163,7 @@ main(void)
code = obtain_session_info(&session_info);
/* process message */
- code = cci_serv_process_msg(msg, auth_info, session_info, &resp);
+ code = ccs_serv_process_msg(msg, auth_info, session_info, &resp);
/* flatten response */
code = cci_msg_flatten(resp, NULL);