From 80c548437a7a199c3897246a71df2a2c5348b37a Mon Sep 17 00:00:00 2001 From: Joseph Sutton Date: Tue, 11 Apr 2023 20:57:31 +1200 Subject: [PATCH] s4:torture: Don't try to close the connection after running disconnect tests dcerpc_mdssvc_close() would always fail with STATUS_CONNECTION_DISCONNECTED, causing the testsuite as a whole to fail. Signed-off-by: Joseph Sutton Reviewed-by: Andreas Schneider --- source4/torture/rpc/mdssvc.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/source4/torture/rpc/mdssvc.c b/source4/torture/rpc/mdssvc.c index 132d4e50977..2d2a8306412 100644 --- a/source4/torture/rpc/mdssvc.c +++ b/source4/torture/rpc/mdssvc.c @@ -162,13 +162,17 @@ static bool torture_rpc_mdssvc_close(struct torture_context *tctx, { struct torture_mdsscv_state *state = talloc_get_type_abort( data, struct torture_mdsscv_state); - struct dcerpc_binding_handle *b = state->p->binding_handle; NTSTATUS status; bool ok = true; torture_comment(tctx, "test_teardown_mdssvc_disconnect\n"); - status = dcerpc_mdssvc_close(b, + if (state->p == NULL) { + /* We have already been disconnected. */ + goto done; + } + + status = dcerpc_mdssvc_close(state->p->binding_handle, state, &state->ph, 0, @@ -497,6 +501,10 @@ static bool test_mdssvc_invalid_ph_unknown1(struct torture_context *tctx, tctx, status, NT_STATUS_RPC_PROTOCOL_ERROR, ok, done, "dcerpc_mdssvc_unknown1 failed\n"); + /* Free and set to NULL the no-longer-usable pipe. */ + b = NULL; + TALLOC_FREE(state->p); + done: return ok; } @@ -565,6 +573,10 @@ static bool test_mdssvc_invalid_ph_cmd(struct torture_context *tctx, tctx, status, NT_STATUS_RPC_PROTOCOL_ERROR, ok, done, "dcerpc_mdssvc_unknown1 failed\n"); + /* Free and set to NULL the no-longer-usable pipe. */ + b = NULL; + TALLOC_FREE(state->p); + done: return ok; } @@ -602,6 +614,10 @@ static bool test_mdssvc_invalid_ph_close(struct torture_context *tctx, tctx, status, NT_STATUS_RPC_PROTOCOL_ERROR, ok, done, "dcerpc_mdssvc_unknown1 failed\n"); + /* Free and set to NULL the no-longer-usable pipe. */ + b = NULL; + TALLOC_FREE(state->p); + done: return ok; }