diff options
author | Michael Adam <obnox@samba.org> | 2012-04-18 17:55:51 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2012-06-22 17:28:18 +0200 |
commit | 51b30c61f4cfc257b4a3938363041214a4106907 (patch) | |
tree | 17dc09ddc47e5302c1dbe4af4e4feae73cb46874 /source3/torture | |
parent | 4676e7f65df5e6743ed2319e64d787429c23faf0 (diff) | |
download | samba-51b30c61f4cfc257b4a3938363041214a4106907.tar.gz samba-51b30c61f4cfc257b4a3938363041214a4106907.tar.bz2 samba-51b30c61f4cfc257b4a3938363041214a4106907.zip |
s3:torture:smb2: pass smb2-session-reconnect test (add generosity in error case)
samba checks tree before file, so we get a
STATUS_NETWORK_NAME_DELETED instead STATUS_FILE_CLOSED
when operating on a file handle on a invalid tree id.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source3/torture')
-rw-r--r-- | source3/torture/test_smb2.c | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/source3/torture/test_smb2.c b/source3/torture/test_smb2.c index 8aff588cc7..af0e1561d9 100644 --- a/source3/torture/test_smb2.c +++ b/source3/torture/test_smb2.c @@ -529,7 +529,9 @@ bool run_smb2_session_reconnect(int dummy) */ status = smb2cli_flush(cli2->conn, cli2->timeout, cli2->smb2.session, cli2->smb2.tid, fid_persistent, fid_volatile); - if (!NT_STATUS_EQUAL(status, NT_STATUS_FILE_CLOSED)) { + if (!NT_STATUS_EQUAL(status, NT_STATUS_FILE_CLOSED) && + !NT_STATUS_EQUAL(status, NT_STATUS_NETWORK_NAME_DELETED)) + { printf("smb2cli_flush returned %s\n", nt_errstr(status)); return false; } @@ -537,7 +539,9 @@ bool run_smb2_session_reconnect(int dummy) status = smb2cli_write(cli2->conn, cli2->timeout, cli2->smb2.session, cli2->smb2.tid, strlen(hello), 0, fid_persistent, fid_volatile, 0, 0, (const uint8_t *)hello); - if (!NT_STATUS_EQUAL(status, NT_STATUS_FILE_CLOSED)) { + if (!NT_STATUS_EQUAL(status, NT_STATUS_FILE_CLOSED) && + !NT_STATUS_EQUAL(status, NT_STATUS_NETWORK_NAME_DELETED)) + { printf("smb2cli_write returned %s\n", nt_errstr(status)); return false; } @@ -546,7 +550,9 @@ bool run_smb2_session_reconnect(int dummy) cli2->smb2.tid, 0x10000, 0, fid_persistent, fid_volatile, 2, 0, talloc_tos(), &result, &nread); - if (!NT_STATUS_EQUAL(status, NT_STATUS_FILE_CLOSED)) { + if (!NT_STATUS_EQUAL(status, NT_STATUS_FILE_CLOSED) && + !NT_STATUS_EQUAL(status, NT_STATUS_NETWORK_NAME_DELETED)) + { printf("smb2cli_read returned %s\n", nt_errstr(status)); return false; } @@ -585,7 +591,9 @@ bool run_smb2_session_reconnect(int dummy) status = smb2cli_flush(cli2->conn, cli2->timeout, cli2->smb2.session, cli2->smb2.tid, fid_persistent, fid_volatile); - if (!NT_STATUS_EQUAL(status, NT_STATUS_FILE_CLOSED)) { + if (!NT_STATUS_EQUAL(status, NT_STATUS_FILE_CLOSED) && + !NT_STATUS_EQUAL(status, NT_STATUS_NETWORK_NAME_DELETED)) + { printf("smb2cli_flush returned %s\n", nt_errstr(status)); return false; } @@ -593,7 +601,9 @@ bool run_smb2_session_reconnect(int dummy) status = smb2cli_write(cli2->conn, cli2->timeout, cli2->smb2.session, cli2->smb2.tid, strlen(hello), 0, fid_persistent, fid_volatile, 0, 0, (const uint8_t *)hello); - if (!NT_STATUS_EQUAL(status, NT_STATUS_FILE_CLOSED)) { + if (!NT_STATUS_EQUAL(status, NT_STATUS_FILE_CLOSED) && + !NT_STATUS_EQUAL(status, NT_STATUS_NETWORK_NAME_DELETED)) + { printf("smb2cli_write returned %s\n", nt_errstr(status)); return false; } @@ -602,7 +612,9 @@ bool run_smb2_session_reconnect(int dummy) cli2->smb2.tid, 0x10000, 0, fid_persistent, fid_volatile, 2, 0, talloc_tos(), &result, &nread); - if (!NT_STATUS_EQUAL(status, NT_STATUS_FILE_CLOSED)) { + if (!NT_STATUS_EQUAL(status, NT_STATUS_FILE_CLOSED) && + !NT_STATUS_EQUAL(status, NT_STATUS_NETWORK_NAME_DELETED)) + { printf("smb2cli_read returned %s\n", nt_errstr(status)); return false; } @@ -619,7 +631,9 @@ bool run_smb2_session_reconnect(int dummy) NULL, /* smb2_create_blobs *blobs */ &fid_persistent, &fid_volatile); - if (!NT_STATUS_EQUAL(status, NT_STATUS_NETWORK_NAME_DELETED)) { + if (!NT_STATUS_EQUAL(status, NT_STATUS_NETWORK_NAME_DELETED) && + !NT_STATUS_EQUAL(status, NT_STATUS_NETWORK_NAME_DELETED)) + { printf("smb2cli_create on cli2 %s\n", nt_errstr(status)); return false; } |