diff options
author | Sumit Bose <sbose@redhat.com> | 2009-10-20 10:49:40 +0200 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2009-10-22 13:56:23 -0400 |
commit | 29f1ec57d0329cefd5797a10736528d0b2b326b5 (patch) | |
tree | 576f930ee754ea6838048fd4b1dcdd48eca7aed4 /server/tests | |
parent | da31cd39053732204d536c0b31c353fb623875c2 (diff) | |
download | sssd-29f1ec57d0329cefd5797a10736528d0b2b326b5.tar.gz sssd-29f1ec57d0329cefd5797a10736528d0b2b326b5.tar.bz2 sssd-29f1ec57d0329cefd5797a10736528d0b2b326b5.zip |
update krb5 option handling to new option scheme
Diffstat (limited to 'server/tests')
-rw-r--r-- | server/tests/krb5_utils-tests.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/server/tests/krb5_utils-tests.c b/server/tests/krb5_utils-tests.c index 976b3d61..b79cb7c3 100644 --- a/server/tests/krb5_utils-tests.c +++ b/server/tests/krb5_utils-tests.c @@ -38,11 +38,16 @@ #define CCACHE_DIR "/var/tmp" #define PID "4321" +extern struct dp_option default_krb5_opts[]; + TALLOC_CTX *tmp_ctx = NULL; struct krb5child_req *kr; void setup_talloc_context(void) { + int ret; + int i; + struct pam_data *pd; struct krb5_ctx *krb5_ctx; fail_unless(tmp_ctx == NULL, "Talloc context already initialized."); @@ -63,8 +68,17 @@ void setup_talloc_context(void) pd->upn = PRINCIPLE_NAME; pd->cli_pid = atoi(PID); - krb5_ctx->realm = REALM; - krb5_ctx->ccache_dir = CCACHE_DIR; + krb5_ctx->opts = talloc_zero_array(tmp_ctx, struct dp_option, KRB5_OPTS); + fail_unless(krb5_ctx->opts != NULL, "Cannot created options."); + for (i = 0; i < KRB5_OPTS; i++) { + krb5_ctx->opts[i].opt_name = default_krb5_opts[i].opt_name; + krb5_ctx->opts[i].type = default_krb5_opts[i].type; + krb5_ctx->opts[i].def_val = default_krb5_opts[i].def_val; + } + ret = dp_opt_set_string(krb5_ctx->opts, KRB5_REALM, REALM); + fail_unless(ret == EOK, "Failed to set Realm"); + ret = dp_opt_set_string(krb5_ctx->opts, KRB5_CCACHEDIR, CCACHE_DIR); + fail_unless(ret == EOK, "Failed to set Ccache dir"); kr->homedir = HOME_DIRECTORY; |