diff options
author | Simo Sorce <simo@redhat.com> | 2013-08-21 22:48:22 -0400 |
---|---|---|
committer | Simo Sorce <simo@redhat.com> | 2013-08-21 22:57:23 -0400 |
commit | 52fdc608eaf2b1cdf8c9ebe27e7488a2d2427ae7 (patch) | |
tree | c0dc183107bd83a353427c798dd5b8b0f1dd1da5 /tests | |
parent | 30ed376d96bce711aaede66144260bebd0af9b96 (diff) | |
download | gss-ntlmssp-52fdc608eaf2b1cdf8c9ebe27e7488a2d2427ae7.tar.gz gss-ntlmssp-52fdc608eaf2b1cdf8c9ebe27e7488a2d2427ae7.tar.xz gss-ntlmssp-52fdc608eaf2b1cdf8c9ebe27e7488a2d2427ae7.zip |
Add more tests.
Cover gss_inquire_context and gss_display_name implementations.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/ntlmssptest.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/ntlmssptest.c b/tests/ntlmssptest.c index e4a8bae..1d00f24 100644 --- a/tests/ntlmssptest.c +++ b/tests/ntlmssptest.c @@ -1057,6 +1057,36 @@ int test_gssapi_1(void) gss_release_buffer(&retmin, &cli_token); gss_release_buffer(&retmin, &srv_token); + gssntlm_release_name(&retmin, &gss_username); + gssntlm_release_name(&retmin, &gss_srvname); + + retmaj = gssntlm_inquire_context(&retmin, srv_ctx, + &gss_username, &gss_srvname, + NULL, NULL, NULL, NULL, NULL); + if (retmaj != GSS_S_COMPLETE) { + fprintf(stderr, "gssntlm_inquire_context failed! (%d/%d, %s)", + retmaj, retmin, strerror(retmin)); + ret = EINVAL; + goto done; + } + + retmaj = gssntlm_display_name(&retmin, gss_username, &nbuf, NULL); + if (retmaj != GSS_S_COMPLETE) { + fprintf(stderr, "gssntlm_display_name failed! (%d/%d, %s)", + retmaj, retmin, strerror(retmin)); + ret = EINVAL; + goto done; + } + + if (strcmp(nbuf.value, "TESTDOM\\testuser") != 0) { + fprintf(stderr, "Expected username of [%s] but got [%s] instead!\n", + "TESTDOM\\testuser", (char *)nbuf.value); + ret = EINVAL; + goto done; + } + + gss_release_buffer(&retmin, &nbuf); + ret = 0; done: |