[SCM] Samba Shared Repository - branch master updated

Volker Lendecke vlendec at samba.org
Wed Jul 27 15:08:04 MDT 2011


The branch, master has been updated
       via  94a2328 s3: Avoid calls to cli_dos/nt_error in torture
       via  a7f8d9e s3: Fix formatting in check_error()
       via  34faeb8 s3:test_async_echo: unsure the desired smb message sequence
      from  abf3573 s3:modules fix Bug 8330 NFSv4 ACL merging logic is broken

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 94a2328367b2098bf5e125ddbd1e8c9bfde20efe
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Jul 27 21:51:45 2011 +0200

    s3: Avoid calls to cli_dos/nt_error in torture
    
    Autobuild-User: Volker Lendecke <vlendec at samba.org>
    Autobuild-Date: Wed Jul 27 23:07:51 CEST 2011 on sn-devel-104

commit a7f8d9e798bd5cf4ff16382b45e20e4b2a4c0bf8
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Jul 27 21:51:13 2011 +0200

    s3: Fix formatting in check_error()

commit 34faeb8bba86fff57466c06682b7dcbffc48a52a
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Jul 27 18:35:00 2011 +0200

    s3:test_async_echo: unsure the desired smb message sequence
    
    We want to start sending echo requests once the rpc related
    smb operation arrived the smb layer.
    
    metze

-----------------------------------------------------------------------

Summary of changes:
 source3/torture/test_async_echo.c |   10 +++++++
 source3/torture/torture.c         |   48 +++++++++++++++++++-----------------
 2 files changed, 35 insertions(+), 23 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/torture/test_async_echo.c b/source3/torture/test_async_echo.c
index 6f82939..f1d44ee 100644
--- a/source3/torture/test_async_echo.c
+++ b/source3/torture/test_async_echo.c
@@ -20,6 +20,7 @@
 #include "includes.h"
 #include "torture/proto.h"
 #include "libsmb/libsmb.h"
+#include "async_smb.h"
 #include "rpc_client/cli_pipe.h"
 #include "librpc/gen_ndr/ndr_echo_c.h"
 
@@ -100,6 +101,15 @@ bool run_async_echo(int dummy)
 	tevent_req_set_callback(req, rpccli_sleep_done, &num_reqs);
 	num_reqs += 1;
 
+	/* Wait until the rpc operation arrives at the smb layer */
+	while (tevent_req_is_in_progress(req) &&
+	       !cli_has_async_calls(cli)) {
+		if (tevent_loop_once(ev) != 0) {
+			printf("tevent_loop_once failed\n");
+			goto fail;
+		}
+	}
+
 	req = cli_echo_send(ev, ev, cli, 1, data_blob_const("hello", 5));
 	if (req == NULL) {
 		printf("cli_echo_send failed\n");
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index 36d263d..90a9068 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -503,35 +503,35 @@ static bool check_both_error(int line, NTSTATUS status,
 
 
 /* check if the server produced the expected error code */
-static bool check_error(int line, struct cli_state *c, 
+static bool check_error(int line, NTSTATUS status,
 			uint8 eclass, uint32 ecode, NTSTATUS nterr)
 {
-        if (cli_is_dos_error(c)) {
+	if (NT_STATUS_IS_DOS(status)) {
                 uint8 cclass;
                 uint32 num;
 
                 /* Check DOS error */
 
-                cli_dos_error(c, &cclass, &num);
+		cclass = NT_STATUS_DOS_CLASS(status);
+		num = NT_STATUS_DOS_CODE(status);
 
                 if (eclass != cclass || ecode != num) {
                         printf("unexpected error code class=%d code=%d\n", 
                                (int)cclass, (int)num);
                         printf(" expected %d/%d %s (line=%d)\n", 
-                               (int)eclass, (int)ecode, nt_errstr(nterr), line);
+                               (int)eclass, (int)ecode, nt_errstr(nterr),
+			       line);
                         return False;
                 }
 
         } else {
-                NTSTATUS status;
-
                 /* Check NT error */
 
-                status = cli_nt_error(c);
-
                 if (NT_STATUS_V(nterr) != NT_STATUS_V(status)) {
-                        printf("unexpected error code %s\n", nt_errstr(status));
-                        printf(" expected %s (line=%d)\n", nt_errstr(nterr), line);
+                        printf("unexpected error code %s\n",
+			       nt_errstr(status));
+                        printf(" expected %s (line=%d)\n", nt_errstr(nterr),
+			       line);
                         return False;
                 }
         }
@@ -2921,7 +2921,7 @@ static bool run_unlinktest(int dummy)
 		printf("error: server allowed unlink on an open file\n");
 		correct = False;
 	} else {
-		correct = check_error(__LINE__, cli, ERRDOS, ERRbadshare, 
+		correct = check_error(__LINE__, status, ERRDOS, ERRbadshare,
 				      NT_STATUS_SHARING_VIOLATION);
 	}
 
@@ -4874,9 +4874,9 @@ static bool run_opentest(int dummy)
 	}
 
 	/* This will fail - but the error should be ERRnoaccess, not ERRbadshare. */
-	cli_open(cli1, fname, O_RDWR, DENY_ALL, &fnum2);
+	status = cli_open(cli1, fname, O_RDWR, DENY_ALL, &fnum2);
 
-        if (check_error(__LINE__, cli1, ERRDOS, ERRnoaccess, 
+        if (check_error(__LINE__, status, ERRDOS, ERRnoaccess,
 			NT_STATUS_ACCESS_DENIED)) {
 		printf("correct error code ERRDOS/ERRnoaccess returned\n");
 	}
@@ -4896,9 +4896,9 @@ static bool run_opentest(int dummy)
 	}
 
 	/* This will fail - but the error should be ERRshare. */
-	cli_open(cli1, fname, O_RDWR, DENY_ALL, &fnum2);
+	status = cli_open(cli1, fname, O_RDWR, DENY_ALL, &fnum2);
 
-	if (check_error(__LINE__, cli1, ERRDOS, ERRbadshare, 
+	if (check_error(__LINE__, status, ERRDOS, ERRbadshare,
 			NT_STATUS_SHARING_VIOLATION)) {
 		printf("correct error code ERRDOS/ERRbadshare returned\n");
 	}
@@ -6012,23 +6012,25 @@ bool torture_chkpath_test(int dummy)
 
 	status = cli_chkpath(cli, "\\chkpath.dir\\foo.txt");
 	if (!NT_STATUS_IS_OK(status)) {
-		ret = check_error(__LINE__, cli, ERRDOS, ERRbadpath, 
+		ret = check_error(__LINE__, status, ERRDOS, ERRbadpath,
 				  NT_STATUS_NOT_A_DIRECTORY);
 	} else {
 		printf("* chkpath on a file should fail\n");
 		ret = False;
 	}
 
-	if (!NT_STATUS_IS_OK(cli_chkpath(cli, "\\chkpath.dir\\bar.txt"))) {
-		ret = check_error(__LINE__, cli, ERRDOS, ERRbadfile, 
+	status = cli_chkpath(cli, "\\chkpath.dir\\bar.txt");
+	if (!NT_STATUS_IS_OK(status)) {
+		ret = check_error(__LINE__, status, ERRDOS, ERRbadfile,
 				  NT_STATUS_OBJECT_NAME_NOT_FOUND);
 	} else {
 		printf("* chkpath on a non existant file should fail\n");
 		ret = False;
 	}
 
-	if (!NT_STATUS_IS_OK(cli_chkpath(cli, "\\chkpath.dir\\dirxx\\bar.txt"))) {
-		ret = check_error(__LINE__, cli, ERRDOS, ERRbadpath, 
+	status = cli_chkpath(cli, "\\chkpath.dir\\dirxx\\bar.txt");
+	if (!NT_STATUS_IS_OK(status)) {
+		ret = check_error(__LINE__, status, ERRDOS, ERRbadpath,
 				  NT_STATUS_OBJECT_PATH_NOT_FOUND);
 	} else {
 		printf("* chkpath on a non existent component should fail\n");
@@ -7168,8 +7170,8 @@ static bool run_uid_regression_test(int dummy)
 		goto out;
 	} else {
 		/* Should be bad uid. */
-		if (!check_error(__LINE__, cli, ERRSRV, ERRbaduid,
-				NT_STATUS_USER_SESSION_DELETED)) {
+		if (!check_error(__LINE__, status, ERRSRV, ERRbaduid,
+				 NT_STATUS_USER_SESSION_DELETED)) {
 			correct = false;
 			goto out;
 		}
@@ -7202,7 +7204,7 @@ static bool run_uid_regression_test(int dummy)
 		goto out;
 	} else {
 		/* Should be bad tid. */
-		if (!check_error(__LINE__, cli, ERRSRV, ERRinvnid,
+		if (!check_error(__LINE__, status, ERRSRV, ERRinvnid,
 				NT_STATUS_NETWORK_NAME_DELETED)) {
 			correct = false;
 			goto out;


-- 
Samba Shared Repository


More information about the samba-cvs mailing list