summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2013-09-17 13:15:38 +0200
committerAndrew Bartlett <abartlet@samba.org>2013-10-17 08:48:46 +1300
commita3074521d408acc4de8a6f810a99f0d6b0c0e324 (patch)
treece99e6323e1606f56cc45998efc1370cc3eff547 /source4/torture
parent9d6b6dcd963412b33fd5960bd792ae183cc63458 (diff)
downloadsamba-a3074521d408acc4de8a6f810a99f0d6b0c0e324.tar.gz
samba-a3074521d408acc4de8a6f810a99f0d6b0c0e324.tar.bz2
samba-a3074521d408acc4de8a6f810a99f0d6b0c0e324.zip
s4:torture/samba3rpc: let rpc.authcontext be more robust against low level changes (part2)
We now use smbXcli_conn_is_connected() and dcerpc_binding_handle_is_connected() to verify only the dcerpc layer got an error. The expected error is EIO mapped to NT_STATUS_IO_DEVICE_ERROR. NT_STATUS_INVALID_HANDLE should only be visible at the SMB layer, but we keep this as allowed return value for now, until the dcerpc layer is fixed. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/rpc/samba3rpc.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/source4/torture/rpc/samba3rpc.c b/source4/torture/rpc/samba3rpc.c
index 6c96b9d7cf..dbed3efdb2 100644
--- a/source4/torture/rpc/samba3rpc.c
+++ b/source4/torture/rpc/samba3rpc.c
@@ -186,18 +186,26 @@ bool torture_bind_authcontext(struct torture_context *torture)
status = dcerpc_lsa_OpenPolicy2_r(lsa_handle, mem_ctx, &openpolicy);
- smb1cli_session_set_id(tmp->smbXcli, tmp_vuid);
- cli->tree->session = tmp;
- talloc_free(lsa_pipe);
- lsa_pipe = NULL;
+ torture_assert(torture, smbXcli_conn_is_connected(cli->transport->conn),
+ "smb still connected");
+ torture_assert(torture, !dcerpc_binding_handle_is_connected(lsa_handle),
+ "dcerpc disonnected");
- if (!NT_STATUS_EQUAL(status, NT_STATUS_INVALID_HANDLE)) {
+ if (NT_STATUS_EQUAL(status, NT_STATUS_INVALID_HANDLE)) {
torture_comment(torture, "dcerpc_lsa_OpenPolicy2 with wrong vuid gave %s, "
- "expected NT_STATUS_INVALID_HANDLE\n",
+ "expected NT_STATUS_IO_DEVICE_ERROR\n",
nt_errstr(status));
- goto done;
+ status = NT_STATUS_IO_DEVICE_ERROR;
}
+ torture_assert_ntstatus_equal(torture, status, NT_STATUS_IO_DEVICE_ERROR,
+ "lsa io device error");
+
+ smb1cli_session_set_id(tmp->smbXcli, tmp_vuid);
+ cli->tree->session = tmp;
+ talloc_free(lsa_pipe);
+ lsa_pipe = NULL;
+
ret = true;
done:
talloc_free(mem_ctx);