summaryrefslogtreecommitdiff
path: root/source3/torture
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-11-24 12:33:19 +0100
committerStefan Metzmacher <metze@samba.org>2011-11-24 20:36:31 +0100
commitbfbfcd1a51a4bb8ed28e96f517eea77bbf1f3068 (patch)
tree6b0899d8471e84964f65f272d1234af5be42c520 /source3/torture
parentb01d80a25eec366fc8f28d2f845a8378efc0c653 (diff)
downloadsamba-bfbfcd1a51a4bb8ed28e96f517eea77bbf1f3068.tar.gz
samba-bfbfcd1a51a4bb8ed28e96f517eea77bbf1f3068.tar.bz2
samba-bfbfcd1a51a4bb8ed28e96f517eea77bbf1f3068.zip
s3:torture: test smb2cli_logoff and smb2cli_tdis
metze Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Thu Nov 24 20:36:31 CET 2011 on sn-devel-104
Diffstat (limited to 'source3/torture')
-rw-r--r--source3/torture/test_smb2.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/source3/torture/test_smb2.c b/source3/torture/test_smb2.c
index d33b7ab3cd..34fac4d958 100644
--- a/source3/torture/test_smb2.c
+++ b/source3/torture/test_smb2.c
@@ -38,6 +38,8 @@ bool run_smb2_basic(int dummy)
uint32_t nread;
uint8_t *dir_data;
uint32_t dir_data_length;
+ uint32_t saved_tid = 0;
+ uint64_t saved_uid = 0;
printf("Starting SMB2-BASIC\n");
@@ -156,6 +158,41 @@ bool run_smb2_basic(int dummy)
return false;
}
+ saved_tid = cli->smb2.tid;
+ status = smb2cli_tdis(cli);
+ if (!NT_STATUS_IS_OK(status)) {
+ printf("smb2cli_tdis returned %s\n", nt_errstr(status));
+ return false;
+ }
+ cli->smb2.tid = saved_tid;
+
+ status = smb2cli_tdis(cli);
+ if (!NT_STATUS_EQUAL(status, NT_STATUS_NETWORK_NAME_DELETED)) {
+ printf("2nd smb2cli_tdis returned %s\n", nt_errstr(status));
+ return false;
+ }
+
+ saved_uid = smb2cli_session_current_id(cli->smb2.session);
+ status = smb2cli_logoff(cli);
+ if (!NT_STATUS_IS_OK(status)) {
+ printf("smb2cli_logoff returned %s\n", nt_errstr(status));
+ return false;
+ }
+
+ cli->smb2.session = smbXcli_session_create(cli, cli->conn);
+ if (cli->smb2.session == NULL) {
+ printf("smbXcli_session_create() returned NULL\n");
+ return false;
+ }
+
+ smb2cli_session_set_id_and_flags(cli->smb2.session, saved_uid, 0);
+
+ status = smb2cli_logoff(cli);
+ if (!NT_STATUS_EQUAL(status, NT_STATUS_USER_SESSION_DELETED)) {
+ printf("2nd smb2cli_logoff returned %s\n", nt_errstr(status));
+ return false;
+ }
+
return true;
}