From 368e1860654e737aa2fa9516cdd3668fa644009a Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Thu, 8 Nov 2018 15:42:46 +0100 Subject: s4:torture/smb2/session: invalidate credential cache Invalidate credential cache before connecting to the server, otherwise we will reuse the credentials from the credential cache populated by the preceeding tests. Also invalidate it at the end, otherwise subsequent tests might run into problems if the credentials expire while authenticating. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13661 Signed-off-by: Ralph Boehme Reviewed-by: Andreas Schneider --- source4/torture/smb2/session.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source4') diff --git a/source4/torture/smb2/session.c b/source4/torture/smb2/session.c index 7dc9ba19ee6..65cc53ba337 100644 --- a/source4/torture/smb2/session.c +++ b/source4/torture/smb2/session.c @@ -1073,6 +1073,8 @@ static bool test_session_expire1i(struct torture_context *tctx, torture_assert_int_equal(tctx, use_kerberos, CRED_MUST_USE_KERBEROS, "please use -k yes"); + cli_credentials_invalidate_ccache(credentials, CRED_SPECIFIED); + lpcfg_set_option(tctx->lp_ctx, "gensec_gssapi:requested_life_time=4"); lpcfg_smbcli_options(tctx->lp_ctx, &options); @@ -1167,6 +1169,8 @@ static bool test_session_expire1i(struct torture_context *tctx, ret = true; done: + cli_credentials_invalidate_ccache(credentials, CRED_SPECIFIED); + if (h1 != NULL) { smb2_util_close(tree, *h1); } @@ -1236,6 +1240,8 @@ static bool test_session_expire2i(struct torture_context *tctx, torture_assert_int_equal(tctx, use_kerberos, CRED_MUST_USE_KERBEROS, "please use -k yes"); + cli_credentials_invalidate_ccache(credentials, CRED_SPECIFIED); + lpcfg_set_option(tctx->lp_ctx, "gensec_gssapi:requested_life_time=4"); lpcfg_smbcli_options(tctx->lp_ctx, &options); @@ -1547,6 +1553,8 @@ static bool test_session_expire2i(struct torture_context *tctx, ret = true; done: + cli_credentials_invalidate_ccache(credentials, CRED_SPECIFIED); + if (h1 != NULL) { smb2_util_close(tree, *h1); } -- cgit v1.2.1