int check_cc_ccache_release() {
+ cc_int32 err = 0;
+ cc_context_t context = NULL;
+ cc_ccache_t ccache = NULL;
+
BEGIN_TEST("cc_ccache_release");
#ifndef cc_ccache_release
failure_count++;
#else
- cc_int32 err = 0;
- cc_context_t context = NULL;
- cc_ccache_t ccache = NULL;
-
err = cc_initialize(&context, ccapi_version_3, NULL, NULL);
if (!err) {
cc_int32 check_once_cc_ccache_release(cc_context_t context, cc_ccache_t ccache, cc_int32 expected_err, const char *description) {
cc_int32 err = ccNoError;
- BEGIN_CHECK_ONCE(description);
-
- #ifdef cc_ccache_release
-
cc_int32 possible_return_values[2] = {
ccNoError,
ccErrInvalidCCache,
};
- #define possible_ret_val_count sizeof(possible_return_values)/sizeof(possible_return_values[0])
-
+
cc_string_t name = NULL;
err = cc_ccache_get_name(ccache, &name);
err = cc_ccache_release(ccache);
ccache = NULL;
+ BEGIN_CHECK_ONCE(description);
+
+ #ifdef cc_ccache_release
+
+ #define possible_ret_val_count sizeof(possible_return_values)/sizeof(possible_return_values[0])
+
// check returned error
check_err(err, expected_err, possible_return_values);
int check_cc_ccache_destroy() {
+ cc_int32 err = 0;
+ cc_context_t context = NULL;
+ cc_ccache_t ccache = NULL;
+
BEGIN_TEST("cc_ccache_destroy");
#ifndef cc_ccache_destroy
failure_count++;
#else
- cc_int32 err = 0;
- cc_context_t context = NULL;
- cc_ccache_t ccache = NULL;
-
err = cc_initialize(&context, ccapi_version_3, NULL, NULL);
if (!err) {
cc_int32 check_once_cc_ccache_destroy(cc_context_t context, cc_ccache_t ccache, cc_int32 expected_err, const char *description) {
cc_int32 err = ccNoError;
- BEGIN_CHECK_ONCE(description);
-
- #ifdef cc_ccache_destroy
-
cc_int32 possible_return_values[2] = {
ccNoError,
ccErrInvalidCCache,
};
- #define possible_ret_val_count sizeof(possible_return_values)/sizeof(possible_return_values[0])
-
+
cc_string_t name = NULL;
+ BEGIN_CHECK_ONCE(description);
+
+ #ifdef cc_ccache_destroy
+
+ #define possible_ret_val_count sizeof(possible_return_values)/sizeof(possible_return_values[0])
+
err = cc_ccache_get_name(ccache, &name);
err = cc_ccache_destroy(ccache);
ccache = NULL;
int check_cc_ccache_set_default() {
+ cc_int32 err = 0;
+ cc_context_t context = NULL;
+ cc_ccache_t ccache = NULL;
+
BEGIN_TEST("cc_ccache_set_default");
#ifndef cc_ccache_set_default
failure_count++;
#else
- cc_int32 err = 0;
- cc_context_t context = NULL;
- cc_ccache_t ccache = NULL;
-
err = cc_initialize(&context, ccapi_version_3, NULL, NULL);
// try when it's the only ccache (already default)
cc_int32 check_once_cc_ccache_set_default(cc_context_t context, cc_ccache_t ccache, cc_int32 expected_err, const char *description) {
cc_int32 err = ccNoError;
- BEGIN_CHECK_ONCE(description);
-
- #ifdef cc_ccache_set_default
-
cc_int32 possible_return_values[3] = {
ccNoError,
ccErrInvalidCCache,
ccErrCCacheNotFound,
};
- #define possible_ret_val_count sizeof(possible_return_values)/sizeof(possible_return_values[0])
-
+
cc_ccache_t default_ccache = NULL;
cc_string_t name = NULL;
cc_string_t default_name = NULL;
+ BEGIN_CHECK_ONCE(description);
+
+ #ifdef cc_ccache_set_default
+
+ #define possible_ret_val_count sizeof(possible_return_values)/sizeof(possible_return_values[0])
+
err = cc_ccache_set_default(ccache);
// check returned error
check_err(err, expected_err, possible_return_values);
int check_cc_ccache_get_credentials_version() {
+ cc_int32 err = 0;
+ cc_context_t context = NULL;
+ cc_ccache_t ccache = NULL;
+
BEGIN_TEST("cc_ccache_get_credentials_version");
#ifndef cc_ccache_get_credentials_version
failure_count++;
#else
- cc_int32 err = 0;
- cc_context_t context = NULL;
- cc_ccache_t ccache = NULL;
-
err = cc_initialize(&context, ccapi_version_3, NULL, NULL);
// try one created with v5 creds
cc_int32 check_once_cc_ccache_get_credentials_version(cc_ccache_t ccache, cc_uint32 expected_cred_vers, cc_int32 expected_err, const char *description) {
cc_int32 err = ccNoError;
- BEGIN_CHECK_ONCE(description);
-
- #ifdef cc_ccache_get_credentials_version
-
cc_int32 possible_return_values[4] = {
ccNoError,
ccErrInvalidCCache,
ccErrBadParam,
ccErrCCacheNotFound,
};
- #define possible_ret_val_count sizeof(possible_return_values)/sizeof(possible_return_values[0])
-
+
cc_uint32 stored_cred_vers = 0;
+ BEGIN_CHECK_ONCE(description);
+
+ #ifdef cc_ccache_get_credentials_version
+
+ #define possible_ret_val_count sizeof(possible_return_values)/sizeof(possible_return_values[0])
+
err = cc_ccache_get_credentials_version(ccache, &stored_cred_vers);
// check returned error
int check_cc_ccache_get_name() {
+ cc_int32 err = 0;
+ cc_context_t context = NULL;
+ cc_ccache_t ccache = NULL;
+
BEGIN_TEST("cc_ccache_get_name");
#ifndef cc_ccache_get_name
failure_count++;
#else
- cc_int32 err = 0;
- cc_context_t context = NULL;
- cc_ccache_t ccache = NULL;
-
err = cc_initialize(&context, ccapi_version_3, NULL, NULL);
if (!err) {
cc_int32 check_once_cc_ccache_get_name(cc_ccache_t ccache, const char *expected_name, cc_int32 expected_err, const char *description) {
cc_int32 err = ccNoError;
- BEGIN_CHECK_ONCE(description);
-
- #ifdef cc_ccache_get_name
-
cc_int32 possible_return_values[4] = {
ccNoError,
ccErrInvalidCCache,
ccErrBadParam,
ccErrCCacheNotFound,
};
- #define possible_ret_val_count sizeof(possible_return_values)/sizeof(possible_return_values[0])
-
+
cc_string_t stored_name = NULL;
+ BEGIN_CHECK_ONCE(description);
+
+ #ifdef cc_ccache_get_name
+
+ #define possible_ret_val_count sizeof(possible_return_values)/sizeof(possible_return_values[0])
+
if (expected_name == NULL) { // we want to try with a NULL param
err = cc_ccache_get_name(ccache, NULL);
}
// ---------------------------------------------------------------------------
+cc_int32 check_once_cc_ccache_get_principal(cc_ccache_t ccache, cc_uint32 cred_vers, const char *expected_principal, cc_int32 expected_err, const char *description) {
+ cc_int32 err = ccNoError;
+ cc_string_t stored_principal = NULL;
+
+ cc_int32 possible_return_values[6] = {
+ ccNoError,
+ ccErrNoMem,
+ ccErrBadCredentialsVersion,
+ ccErrBadParam,
+ ccErrInvalidCCache,
+ ccErrCCacheNotFound,
+ };
+
+ BEGIN_CHECK_ONCE(description);
+
+ #ifdef cc_ccache_get_principal
+
+ #define possible_ret_val_count sizeof(possible_return_values)/sizeof(possible_return_values[0])
+
+ if (expected_principal == NULL) { // we want to try with a NULL param
+ err = cc_ccache_get_principal(ccache, cred_vers, NULL);
+ }
+ else {
+ err = cc_ccache_get_principal(ccache, cred_vers, &stored_principal);
+ }
+
+ // check returned error
+ check_err(err, expected_err, possible_return_values);
+
+ if (!err) {
+ check_if(strcmp(stored_principal->data, expected_principal), "expected princ == \"%s\" stored princ == \"%s\"", expected_principal, stored_principal->data);
+ }
+
+ if (stored_principal) { cc_string_release(stored_principal); }
+
+ #endif /* cc_ccache_get_principal */
+
+ END_CHECK_ONCE;
+
+ return err;
+}
+
+// ---------------------------------------------------------------------------
int check_cc_ccache_get_principal() {
+ cc_int32 err = 0;
+ cc_context_t context = NULL;
+ cc_ccache_t ccache = NULL;
+
BEGIN_TEST("cc_ccache_get_principal");
#ifndef cc_ccache_get_principal
failure_count++;
#else
- cc_int32 err = 0;
- cc_context_t context = NULL;
- cc_ccache_t ccache = NULL;
-
err = cc_initialize(&context, ccapi_version_3, NULL, NULL);
if (!err) {
END_TEST_AND_RETURN
}
-cc_int32 check_once_cc_ccache_get_principal(cc_ccache_t ccache, cc_uint32 cred_vers, const char *expected_principal, cc_int32 expected_err, const char *description) {
- cc_int32 err = ccNoError;
-
- BEGIN_CHECK_ONCE(description);
-
- #ifdef cc_ccache_get_principal
-
- cc_int32 possible_return_values[6] = {
- ccNoError,
- ccErrNoMem,
- ccErrBadCredentialsVersion,
- ccErrBadParam,
- ccErrInvalidCCache,
- ccErrCCacheNotFound,
- };
- #define possible_ret_val_count sizeof(possible_return_values)/sizeof(possible_return_values[0])
-
- cc_string_t stored_principal = NULL;
-
- if (expected_principal == NULL) { // we want to try with a NULL param
- err = cc_ccache_get_principal(ccache, cred_vers, NULL);
- }
- else {
- err = cc_ccache_get_principal(ccache, cred_vers, &stored_principal);
- }
-
- // check returned error
- check_err(err, expected_err, possible_return_values);
-
- if (!err) {
- check_if(strcmp(stored_principal->data, expected_principal), "expected princ == \"%s\" stored princ == \"%s\"", expected_principal, stored_principal->data);
- }
-
- if (stored_principal) { cc_string_release(stored_principal); }
-
- #endif /* cc_ccache_get_principal */
-
- END_CHECK_ONCE;
-
- return err;
-}
-
-
// ---------------------------------------------------------------------------
-
int check_cc_ccache_set_principal() {
+ cc_int32 err = 0;
+ cc_context_t context = NULL;
+ cc_ccache_t ccache = NULL;
+
BEGIN_TEST("cc_ccache_set_principal");
#ifndef cc_ccache_set_principal
failure_count++;
#else
- cc_int32 err = 0;
- cc_context_t context = NULL;
- cc_ccache_t ccache = NULL;
-
err = cc_initialize(&context, ccapi_version_3, NULL, NULL);
if (!err) {
cc_int32 check_once_cc_ccache_set_principal(cc_ccache_t ccache, cc_uint32 cred_vers, const char *in_principal, cc_int32 expected_err, const char *description) {
cc_int32 err = ccNoError;
-
- BEGIN_CHECK_ONCE(description);
-
- #ifdef cc_ccache_set_principal
-
+ cc_string_t stored_principal = NULL;
+
cc_int32 possible_return_values[6] = {
ccNoError,
ccErrNoMem,
ccErrBadParam,
ccErrCCacheNotFound,
};
- #define possible_ret_val_count sizeof(possible_return_values)/sizeof(possible_return_values[0])
+
+ BEGIN_CHECK_ONCE(description);
- cc_string_t stored_principal = NULL;
+ #ifdef cc_ccache_set_principal
+
+ #define possible_ret_val_count sizeof(possible_return_values)/sizeof(possible_return_values[0])
err = cc_ccache_set_principal(ccache, cred_vers, in_principal);
int check_cc_ccache_store_credentials() {
- BEGIN_TEST("cc_ccache_store_credentials");
-
- #ifndef cc_ccache_store_credentials
- log_error("cc_ccache_store_credentials is not implemented yet");
- failure_count++;
- #else
-
cc_int32 err = 0;
cc_context_t context = NULL;
cc_ccache_t ccache = NULL;
cc_credentials_union creds_union;
cc_string_t name = NULL;
+ BEGIN_TEST("cc_ccache_store_credentials");
+
+ #ifndef cc_ccache_store_credentials
+ log_error("cc_ccache_store_credentials is not implemented yet");
+ failure_count++;
+ #else
+
err = cc_initialize(&context, ccapi_version_3, NULL, NULL);
if (!err) {
cc_int32 check_once_cc_ccache_store_credentials(cc_ccache_t ccache, const cc_credentials_union *credentials, cc_int32 expected_err, const char *description) {
cc_int32 err = ccNoError;
-
- BEGIN_CHECK_ONCE(description);
-
- #ifdef cc_ccache_store_credentials
-
+ cc_credentials_iterator_t creds_iterator = NULL;
+ cc_credentials_t creds = NULL;
+
cc_int32 possible_return_values[5] = {
ccNoError,
ccErrInvalidCCache,
ccErrBadCredentialsVersion,
ccErrCCacheNotFound,
};
- #define possible_ret_val_count sizeof(possible_return_values)/sizeof(possible_return_values[0])
+
+ BEGIN_CHECK_ONCE(description);
- cc_credentials_iterator_t creds_iterator = NULL;
- cc_credentials_t creds = NULL;
+ #ifdef cc_ccache_store_credentials
+
+ #define possible_ret_val_count sizeof(possible_return_values)/sizeof(possible_return_values[0])
err = cc_ccache_store_credentials(ccache, credentials);
int check_cc_ccache_remove_credentials() {
- BEGIN_TEST("cc_ccache_remove_credentials");
-
- #ifndef cc_ccache_remove_credentials
- log_error("cc_ccache_remove_credentials is not implemented yet");
- failure_count++;
- #else
-
cc_int32 err = 0;
cc_context_t context = NULL;
cc_ccache_t ccache = NULL;
cc_string_t name = NULL;
unsigned int i;
- err = cc_initialize(&context, ccapi_version_3, NULL, NULL);
+ BEGIN_TEST("cc_ccache_remove_credentials");
- if (!err) {
- err = destroy_all_ccaches(context);
- }
+ #ifndef cc_ccache_remove_credentials
+ log_error("cc_ccache_remove_credentials is not implemented yet");
+ failure_count++;
+ #else
+
+ err = cc_initialize(&context, ccapi_version_3, NULL, NULL);
+
+ if (!err) {
+ err = destroy_all_ccaches(context);
+ }
if (!err) {
err = cc_context_create_new_ccache(context, cc_credentials_v5, "foo@BAR.ORG", &ccache);
cc_int32 check_once_cc_ccache_remove_credentials(cc_ccache_t ccache, cc_credentials_t in_creds, cc_int32 expected_err, const char *description) {
cc_int32 err = ccNoError;
-
- BEGIN_CHECK_ONCE(description);
-
- #ifdef cc_ccache_remove_credentials
-
+ cc_credentials_iterator_t creds_iterator = NULL;
+ cc_credentials_t creds = NULL;
+
cc_int32 possible_return_values[5] = {
ccNoError,
ccErrInvalidCCache,
ccErrCredentialsNotFound,
ccErrCCacheNotFound,
};
- #define possible_ret_val_count sizeof(possible_return_values)/sizeof(possible_return_values[0])
+
+ BEGIN_CHECK_ONCE(description);
- cc_credentials_iterator_t creds_iterator = NULL;
- cc_credentials_t creds = NULL;
+ #ifdef cc_ccache_remove_credentials
+
+ #define possible_ret_val_count sizeof(possible_return_values)/sizeof(possible_return_values[0])
err = cc_ccache_remove_credentials(ccache, in_creds);
int check_cc_ccache_new_credentials_iterator() {
- BEGIN_TEST("cc_ccache_new_credentials_iterator");
-
- #ifndef cc_ccache_new_credentials_iterator
- log_error("cc_ccache_new_credentials_iterator is not implemented yet");
- failure_count++;
- #else
-
cc_int32 err = 0;
cc_context_t context = NULL;
cc_ccache_t ccache = NULL;
cc_credentials_iterator_t creds_iterator = NULL;
cc_string_t name = NULL;
+ BEGIN_TEST("cc_ccache_new_credentials_iterator");
+
+ #ifndef cc_ccache_new_credentials_iterator
+ log_error("cc_ccache_new_credentials_iterator is not implemented yet");
+ failure_count++;
+ #else
+
err = cc_initialize(&context, ccapi_version_3, NULL, NULL);
if (!err) {
cc_int32 check_once_cc_ccache_new_credentials_iterator(cc_ccache_t ccache, cc_credentials_iterator_t *iterator, cc_int32 expected_err, const char *description) {
cc_int32 err = ccNoError;
- BEGIN_CHECK_ONCE(description);
-
- #ifdef cc_ccache_new_credentials_iterator
-
cc_int32 possible_return_values[4] = {
ccNoError,
ccErrBadParam,
ccErrNoMem,
ccErrCCacheNotFound,
};
+
+ BEGIN_CHECK_ONCE(description);
+
+ #ifdef cc_ccache_new_credentials_iterator
+
#define possible_ret_val_count sizeof(possible_return_values)/sizeof(possible_return_values[0])
err = cc_ccache_new_credentials_iterator(ccache, iterator);
// ---------------------------------------------------------------------------
+cc_int32 check_once_cc_ccache_get_change_time(cc_ccache_t ccache, cc_time_t *last_time, cc_int32 expected_err, const char *description) {
+ cc_int32 err = ccNoError;
+ cc_time_t this_time = 0;
+
+ cc_int32 possible_return_values[4] = {
+ ccNoError,
+ ccErrInvalidCCache,
+ ccErrBadParam,
+ ccErrCCacheNotFound,
+ };
-int check_cc_ccache_get_change_time() {
- BEGIN_TEST("cc_ccache_get_change_time");
+ BEGIN_CHECK_ONCE(description);
- #ifndef cc_ccache_get_change_time
- log_error("cc_ccache_get_change_time is not implemented yet");
- failure_count++;
- #else
+ #ifdef cc_ccache_get_change_time
+
+ #define possible_ret_val_count sizeof(possible_return_values)/sizeof(possible_return_values[0])
+ if (last_time == NULL) {
+ err = cc_ccache_get_change_time(ccache, NULL); // passed NULL to compare against because intention is actually to pass bad param instead
+ } else {
+ err = cc_ccache_get_change_time(ccache, &this_time);
+ }
+
+ // check returned error
+ check_err(err, expected_err, possible_return_values);
+
+ if ((!err) && last_time) {
+ check_if(this_time <= *last_time, "change time didn't increase when expected");
+ *last_time = this_time;
+ }
+
+ #endif /* cc_ccache_get_change_time */
+
+ END_CHECK_ONCE;
+
+ return err;
+}
+
+// ---------------------------------------------------------------------------
+
+int check_cc_ccache_get_change_time() {
cc_int32 err = 0;
cc_context_t context = NULL;
cc_ccache_t dummy_ccache = NULL;
cc_credentials_t credentials = NULL;
cc_time_t last_time = 0;
+ BEGIN_TEST("cc_ccache_get_change_time");
+
+ #ifndef cc_ccache_get_change_time
+ log_error("cc_ccache_get_change_time is not implemented yet");
+ failure_count++;
+ #else
+
err = cc_initialize(&context, ccapi_version_3, NULL, NULL);
if (!err) {
END_TEST_AND_RETURN
}
-cc_int32 check_once_cc_ccache_get_change_time(cc_ccache_t ccache, cc_time_t *last_time, cc_int32 expected_err, const char *description) {
+
+// ---------------------------------------------------------------------------
+
+cc_int32 check_once_cc_ccache_get_last_default_time(cc_ccache_t ccache, cc_time_t *last_time, cc_int32 expected_err, const char *description) {
cc_int32 err = ccNoError;
-
- BEGIN_CHECK_ONCE(description);
-
- #ifdef cc_ccache_get_change_time
-
- cc_int32 possible_return_values[4] = {
+ cc_time_t this_time = 0;
+
+ cc_int32 possible_return_values[5] = {
ccNoError,
ccErrInvalidCCache,
ccErrBadParam,
+ ccErrNeverDefault,
ccErrCCacheNotFound,
};
- #define possible_ret_val_count sizeof(possible_return_values)/sizeof(possible_return_values[0])
+
+ BEGIN_CHECK_ONCE(description);
- cc_time_t this_time = 0;
+ #ifdef cc_ccache_get_last_default_time
+
+ #define possible_ret_val_count sizeof(possible_return_values)/sizeof(possible_return_values[0])
if (last_time == NULL) {
- err = cc_ccache_get_change_time(ccache, NULL); // passed NULL to compare against because intention is actually to pass bad param instead
+ err = cc_ccache_get_last_default_time(ccache, NULL); // passed NULL to compare against because intention is actually to pass bad param instead
} else {
- err = cc_ccache_get_change_time(ccache, &this_time);
+ err = cc_ccache_get_last_default_time(ccache, &this_time);
}
// check returned error
check_err(err, expected_err, possible_return_values);
- if ((!err) && last_time) {
- check_if(this_time <= *last_time, "change time didn't increase when expected");
+ if (!err && last_time) {
+ check_if(this_time > *last_time, "last default time isn't as expected");
*last_time = this_time;
}
- #endif /* cc_ccache_get_change_time */
+ #endif /* cc_ccache_get_last_default_time */
END_CHECK_ONCE;
return err;
}
-
// ---------------------------------------------------------------------------
-
int check_cc_ccache_get_last_default_time() {
- BEGIN_TEST("cc_ccache_get_last_default_time");
-
- #ifndef cc_ccache_get_last_default_time
- log_error("cc_ccache_get_last_default_time is not implemented yet");
- failure_count++;
- #else
-
cc_int32 err = 0;
cc_context_t context = NULL;
cc_ccache_t ccache_1 = NULL;
cc_time_t last_time_2 = 0;
cc_string_t name = NULL;
+ BEGIN_TEST("cc_ccache_get_last_default_time");
+
+ #ifndef cc_ccache_get_last_default_time
+ log_error("cc_ccache_get_last_default_time is not implemented yet");
+ failure_count++;
+ #else
+
err = cc_initialize(&context, ccapi_version_3, NULL, NULL);
if (!err) {
END_TEST_AND_RETURN
}
-cc_int32 check_once_cc_ccache_get_last_default_time(cc_ccache_t ccache, cc_time_t *last_time, cc_int32 expected_err, const char *description) {
- cc_int32 err = ccNoError;
-
- BEGIN_CHECK_ONCE(description);
-
- #ifdef cc_ccache_get_last_default_time
-
- cc_int32 possible_return_values[5] = {
- ccNoError,
- ccErrInvalidCCache,
- ccErrBadParam,
- ccErrNeverDefault,
- ccErrCCacheNotFound,
- };
- #define possible_ret_val_count sizeof(possible_return_values)/sizeof(possible_return_values[0])
-
- cc_time_t this_time = 0;
-
- if (last_time == NULL) {
- err = cc_ccache_get_last_default_time(ccache, NULL); // passed NULL to compare against because intention is actually to pass bad param instead
- } else {
- err = cc_ccache_get_last_default_time(ccache, &this_time);
- }
-
- // check returned error
- check_err(err, expected_err, possible_return_values);
-
- if (!err && last_time) {
- check_if(this_time > *last_time, "last default time isn't as expected");
- *last_time = this_time;
- }
-
- #endif /* cc_ccache_get_last_default_time */
-
- END_CHECK_ONCE;
-
- return err;
-}
-
-
// ---------------------------------------------------------------------------
-
int check_cc_ccache_move() {
- BEGIN_TEST("cc_ccache_move");
-
- #ifndef cc_ccache_move
- log_error("cc_ccache_move is not implemented yet");
- failure_count++;
- #else
-
cc_int32 err = 0;
cc_context_t context = NULL;
cc_ccache_t source = NULL;
cc_credentials_union creds_union;
unsigned int i = 0;
+ BEGIN_TEST("cc_ccache_move");
+
+ #ifndef cc_ccache_move
+ log_error("cc_ccache_move is not implemented yet");
+ failure_count++;
+ #else
+
err = cc_initialize(&context, ccapi_version_3, NULL, NULL);
if (!err) {
cc_int32 check_once_cc_ccache_move(cc_ccache_t source, cc_ccache_t destination, cc_int32 expected_err, const char *description) {
cc_int32 err = ccNoError;
+ cc_credentials_t dst_creds[10] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, };
+ cc_credentials_t creds = NULL;
+ cc_credentials_iterator_t cred_iterator = NULL;
+ unsigned int i = 0;
- BEGIN_CHECK_ONCE(description);
-
- #ifdef cc_ccache_move
+ cc_string_t src_principal = NULL;
+ cc_string_t dst_principal = NULL;
cc_int32 possible_return_values[3] = {
ccNoError,
ccErrInvalidCCache,
ccErrCCacheNotFound,
};
- #define possible_ret_val_count sizeof(possible_return_values)/sizeof(possible_return_values[0])
+
+ BEGIN_CHECK_ONCE(description);
- cc_credentials_t dst_creds[10] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, };
- cc_credentials_t creds = NULL;
- cc_credentials_iterator_t cred_iterator = NULL;
- unsigned int i = 0;
+ #ifdef cc_ccache_move
+
+ #define possible_ret_val_count sizeof(possible_return_values)/sizeof(possible_return_values[0])
- cc_string_t src_principal = NULL;
- cc_string_t dst_principal = NULL;
-
if (destination) {
// verify all of destination's credentials are no longer there (save a list and call remove_cred for each, expecting an err in response)
if (!err) {
// ---------------------------------------------------------------------------
int check_cc_ccache_compare() {
+ cc_int32 err = 0;
+ cc_context_t context = NULL;
+ cc_ccache_t ccache_a = NULL;
+ cc_ccache_t ccache_b = NULL;
+ cc_uint32 equal = 0;
+
BEGIN_TEST("cc_ccache_compare");
#ifndef cc_ccache_compare
failure_count++;
#else
- cc_int32 err = 0;
- cc_context_t context = NULL;
- cc_ccache_t ccache_a = NULL;
- cc_ccache_t ccache_b = NULL;
- cc_uint32 equal = 0;
-
err = cc_initialize(&context, ccapi_version_3, NULL, NULL);
if (!err) {
cc_int32 check_once_cc_ccache_compare(cc_ccache_t ccache, cc_ccache_t compare_to, cc_uint32 *equal, cc_int32 expected_err, const char *description) {
cc_int32 err = ccNoError;
-
- BEGIN_CHECK_ONCE(description);
-
- #ifdef cc_ccache_compare
+ cc_uint32 actually_equal = 0;
cc_int32 possible_return_values[4] = {
ccNoError,
ccErrBadParam,
ccErrServerUnavailable,
};
- #define possible_ret_val_count sizeof(possible_return_values)/sizeof(possible_return_values[0])
+
+ BEGIN_CHECK_ONCE(description);
+
+ #ifdef cc_ccache_compare
- cc_uint32 actually_equal = 0;
+ #define possible_ret_val_count sizeof(possible_return_values)/sizeof(possible_return_values[0])
if (equal) {
actually_equal = *equal;
// ---------------------------------------------------------------------------
int check_cc_ccache_get_kdc_time_offset() {
+ cc_int32 err = 0;
+ cc_context_t context = NULL;
+ cc_ccache_t ccache = NULL;
+ cc_time_t time_offset = 0;
+
BEGIN_TEST("cc_ccache_get_kdc_time_offset");
#ifndef cc_ccache_get_kdc_time_offset
failure_count++;
#else
- cc_int32 err = 0;
- cc_context_t context = NULL;
- cc_ccache_t ccache = NULL;
- cc_time_t time_offset = 0;
-
err = cc_initialize(&context, ccapi_version_3, NULL, NULL);
if (!err) {
cc_int32 check_once_cc_ccache_get_kdc_time_offset(cc_ccache_t ccache, cc_int32 credentials_version, cc_time_t *time_offset, cc_int32 expected_err, const char *description) {
cc_int32 err = ccNoError;
-
- BEGIN_CHECK_ONCE(description);
-
- #ifdef cc_ccache_get_kdc_time_offset
+ cc_time_t expected_offset;
cc_int32 possible_return_values[7] = {
ccNoError,
ccErrServerUnavailable,
ccErrBadCredentialsVersion,
};
- #define possible_ret_val_count sizeof(possible_return_values)/sizeof(possible_return_values[0])
+
+ BEGIN_CHECK_ONCE(description);
+
+ #ifdef cc_ccache_get_kdc_time_offset
- cc_time_t expected_offset;
+ #define possible_ret_val_count sizeof(possible_return_values)/sizeof(possible_return_values[0])
if (time_offset) {
expected_offset = *time_offset;
// ---------------------------------------------------------------------------
int check_cc_ccache_set_kdc_time_offset() {
+ cc_int32 err = 0;
+ cc_context_t context = NULL;
+ cc_ccache_t ccache = NULL;
+
BEGIN_TEST("cc_ccache_set_kdc_time_offset");
#ifndef cc_ccache_set_kdc_time_offset
failure_count++;
#else
- cc_int32 err = 0;
- cc_context_t context = NULL;
- cc_ccache_t ccache = NULL;
-
err = cc_initialize(&context, ccapi_version_3, NULL, NULL);
if (!err) {
cc_int32 check_once_cc_ccache_set_kdc_time_offset(cc_ccache_t ccache, cc_int32 credentials_version, cc_time_t time_offset, cc_int32 expected_err, const char *description) {
cc_int32 err = ccNoError;
-
- BEGIN_CHECK_ONCE(description);
-
- #ifdef cc_ccache_set_kdc_time_offset
-
+ cc_time_t stored_offset = 0;
+
cc_int32 possible_return_values[6] = {
ccNoError,
ccErrCCacheNotFound,
ccErrServerUnavailable,
ccErrBadCredentialsVersion,
};
+
+ BEGIN_CHECK_ONCE(description);
+
+ #ifdef cc_ccache_set_kdc_time_offset
+
#define possible_ret_val_count sizeof(possible_return_values)/sizeof(possible_return_values[0])
- cc_time_t stored_offset = 0;
-
err = cc_ccache_set_kdc_time_offset(ccache, credentials_version, time_offset);
// check returned error
// ---------------------------------------------------------------------------
int check_cc_ccache_clear_kdc_time_offset() {
+ cc_int32 err = 0;
+ cc_context_t context = NULL;
+ cc_ccache_t ccache = NULL;
+
BEGIN_TEST("cc_ccache_clear_kdc_time_offset");
#ifndef cc_ccache_clear_kdc_time_offset
failure_count++;
#else
- cc_int32 err = 0;
- cc_context_t context = NULL;
- cc_ccache_t ccache = NULL;
-
err = cc_initialize(&context, ccapi_version_3, NULL, NULL);
if (!err) {
cc_int32 check_once_cc_ccache_clear_kdc_time_offset(cc_ccache_t ccache, cc_int32 credentials_version, cc_int32 expected_err, const char *description) {
cc_int32 err = ccNoError;
-
- BEGIN_CHECK_ONCE(description);
-
- #ifdef cc_ccache_clear_kdc_time_offset
+ cc_time_t stored_offset = 0;
cc_int32 possible_return_values[6] = {
ccNoError,
ccErrServerUnavailable,
ccErrBadCredentialsVersion,
};
- #define possible_ret_val_count sizeof(possible_return_values)/sizeof(possible_return_values[0])
+ BEGIN_CHECK_ONCE(description);
- cc_time_t stored_offset = 0;
+ #ifdef cc_ccache_clear_kdc_time_offset
+ #define possible_ret_val_count sizeof(possible_return_values)/sizeof(possible_return_values[0])
+
err = cc_ccache_clear_kdc_time_offset(ccache, credentials_version);
// check returned error