From 51b30c61f4cfc257b4a3938363041214a4106907 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 18 Apr 2012 17:55:51 +0200 Subject: 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 --- source3/torture/test_smb2.c | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) (limited to 'source3/torture') 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; } -- cgit