[SCM] Samba Shared Repository - branch master updated

Günther Deschner gd at samba.org
Wed Mar 16 08:52:02 MDT 2011


The branch, master has been updated
       via  e084edc s4-smbtorture: use torture_fail and _assert macros in torture_netlogon_samba3().
       via  be55bbc s4-smbtorture: remove explicit mem_ctx from torture_netlogon_samba3().
       via  8775aee s4-smbtorture: use torture_fail and _skip in raw.write test.
       via  1b055fa s4-smbtorture: remove duplicate if branch in raw.write test.
       via  227c00d s4-smbtorture: use torture_fail/-assert api in torture_samba3_hide().
      from  fad0112 s3-build: stop including ldap and lber headers everywhere in the code.

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


- Log -----------------------------------------------------------------
commit e084edc16ea909d99453ef7663e0f5ada081fe22
Author: Günther Deschner <gd at samba.org>
Date:   Wed Mar 16 15:00:57 2011 +0100

    s4-smbtorture: use torture_fail and _assert macros in torture_netlogon_samba3().
    
    Guenther
    
    Autobuild-User: Günther Deschner <gd at samba.org>
    Autobuild-Date: Wed Mar 16 15:51:12 CET 2011 on sn-devel-104

commit be55bbc575ecc0e17bfeac7053050efd4178ead6
Author: Günther Deschner <gd at samba.org>
Date:   Wed Mar 16 14:56:16 2011 +0100

    s4-smbtorture: remove explicit mem_ctx from torture_netlogon_samba3().
    
    Guenther

commit 8775aee0368886d1bfa4660e3bbbdc1999812b72
Author: Günther Deschner <gd at samba.org>
Date:   Wed Mar 16 14:52:51 2011 +0100

    s4-smbtorture: use torture_fail and _skip in raw.write test.
    
    Guenther

commit 1b055fa6c655c9eabfb2b4735f94cebf86e10164
Author: Günther Deschner <gd at samba.org>
Date:   Wed Mar 16 14:51:30 2011 +0100

    s4-smbtorture: remove duplicate if branch in raw.write test.
    
    Guenther

commit 227c00d8bd2d9601e0c5e08df8dc567fe0e92345
Author: Günther Deschner <gd at samba.org>
Date:   Wed Mar 16 13:27:38 2011 +0100

    s4-smbtorture: use torture_fail/-assert api in torture_samba3_hide().
    
    Guenther

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

Summary of changes:
 source4/torture/raw/samba3hide.c |   85 +++++++++++-------------------------
 source4/torture/raw/write.c      |   89 +++++++++++++-------------------------
 source4/torture/rpc/samba3rpc.c  |   61 ++++++++------------------
 3 files changed, 75 insertions(+), 160 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/torture/raw/samba3hide.c b/source4/torture/raw/samba3hide.c
index 4f9e2ec..120bd83 100644
--- a/source4/torture/raw/samba3hide.c
+++ b/source4/torture/raw/samba3hide.c
@@ -135,25 +135,16 @@ bool torture_samba3_hide(struct torture_context *torture)
 	if (!torture_open_connection_share(
 		    torture, &cli, torture, torture_setting_string(torture, "host", NULL),
 		    torture_setting_string(torture, "share", NULL), torture->ev)) {
-		d_printf("torture_open_connection_share failed\n");
-		return false;
+		torture_fail(torture, "torture_open_connection_share failed\n");
 	}
 
 	status = torture_second_tcon(torture, cli->session, "hideunread",
 				     &hideunread);
-	if (!NT_STATUS_IS_OK(status)) {
-		d_printf("second_tcon(hideunread) failed: %s\n",
-			 nt_errstr(status));
-		return false;
-	}
+	torture_assert_ntstatus_ok(torture, status, "second_tcon(hideunread) failed\n");
 
 	status = torture_second_tcon(torture, cli->session, "hideunwrite",
 				     &hideunwrite);
-	if (!NT_STATUS_IS_OK(status)) {
-		d_printf("second_tcon(hideunwrite) failed: %s\n",
-			 nt_errstr(status));
-		return false;
-	}
+	torture_assert_ntstatus_ok(torture, status, "second_tcon(hideunwrite) failed\n");
 
 	status = smbcli_unlink(cli->tree, fname);
 	if (NT_STATUS_EQUAL(status, NT_STATUS_CANNOT_DELETE)) {
@@ -163,101 +154,77 @@ bool torture_samba3_hide(struct torture_context *torture)
 
 	fnum = smbcli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE);
 	if (fnum == -1) {
-		d_printf("Failed to create %s - %s\n", fname,
-			 smbcli_errstr(cli->tree));
-		return false;
+		torture_fail(torture,
+			talloc_asprintf(torture, "Failed to create %s - %s\n", fname, smbcli_errstr(cli->tree)));
 	}
 
 	smbcli_close(cli->tree, fnum);
 
 	if (!smbcli_file_exists(cli->tree, fname)) {
-		d_printf("%s does not exist\n", fname);
-		return false;
+		torture_fail(torture, talloc_asprintf(torture, "%s does not exist\n", fname));
 	}
 
 	/* R/W file should be visible everywhere */
 
 	status = smbcli_chmod(cli->tree, fname, UNIX_R_USR|UNIX_W_USR);
-	if (!NT_STATUS_IS_OK(status)) {
-		d_printf("smbcli_chmod failed: %s\n", nt_errstr(status));
-		return false;
-	}
+	torture_assert_ntstatus_ok(torture, status, "smbcli_chmod failed\n");
+
 	if (!is_writeable(torture, cli->tree, fname)) {
-		d_printf("File not writable\n");
-		return false;
+		torture_fail(torture, "File not writable\n");
 	}
 	if (!is_readable(cli->tree, fname)) {
-		d_printf("File not readable\n");
-		return false;
+		torture_fail(torture, "File not readable\n");
 	}
 	if (!is_visible(cli->tree, fname)) {
-		d_printf("r/w file not visible via normal share\n");
-		return false;
+		torture_fail(torture, "r/w file not visible via normal share\n");
 	}
 	if (!is_visible(hideunread, fname)) {
-		d_printf("r/w file not visible via hide unreadable\n");
-		return false;
+		torture_fail(torture, "r/w file not visible via hide unreadable\n");
 	}
 	if (!is_visible(hideunwrite, fname)) {
-		d_printf("r/w file not visible via hide unwriteable\n");
-		return false;
+		torture_fail(torture, "r/w file not visible via hide unwriteable\n");
 	}
 
 	/* R/O file should not be visible via hide unwriteable files */
 
 	status = smbcli_chmod(cli->tree, fname, UNIX_R_USR);
+	torture_assert_ntstatus_ok(torture, status, "smbcli_chmod failed\n");
 
-	if (!NT_STATUS_IS_OK(status)) {
-		d_printf("smbcli_chmod failed: %s\n", nt_errstr(status));
-		return false;
-	}
 	if (is_writeable(torture, cli->tree, fname)) {
-		d_printf("r/o is writable\n");
-		return false;
+		torture_fail(torture, "r/o is writable\n");
 	}
 	if (!is_readable(cli->tree, fname)) {
-		d_printf("r/o not readable\n");
-		return false;
+		torture_fail(torture, "r/o not readable\n");
 	}
 	if (!is_visible(cli->tree, fname)) {
-		d_printf("r/o file not visible via normal share\n");
-		return false;
+		torture_fail(torture, "r/o file not visible via normal share\n");
 	}
 	if (!is_visible(hideunread, fname)) {
-		d_printf("r/o file not visible via hide unreadable\n");
-		return false;
+		torture_fail(torture, "r/o file not visible via hide unreadable\n");
 	}
 	if (is_visible(hideunwrite, fname)) {
-		d_printf("r/o file visible via hide unwriteable\n");
-		return false;
+		torture_fail(torture, "r/o file visible via hide unwriteable\n");
 	}
 
 	/* inaccessible file should be only visible on normal share */
 
 	status = smbcli_chmod(cli->tree, fname, 0);
-	if (!NT_STATUS_IS_OK(status)) {
-		d_printf("smbcli_chmod failed: %s\n", nt_errstr(status));
-		return false;
-	}
+	torture_assert_ntstatus_ok(torture, status, "smbcli_chmod failed\n");
+
 	if (is_writeable(torture, cli->tree, fname)) {
-		d_printf("inaccessible file is writable\n");
-		return false;
+		torture_fail(torture, "inaccessible file is writable\n");
 	}
 	if (is_readable(cli->tree, fname)) {
-		d_printf("inaccessible file is readable\n");
-		return false;
+		torture_fail(torture, "inaccessible file is readable\n");
 	}
 	if (!is_visible(cli->tree, fname)) {
-		d_printf("inaccessible file not visible via normal share\n");
-		return false;
+		torture_fail(torture, "inaccessible file not visible via normal share\n");
 	}
 	if (is_visible(hideunread, fname)) {
-		d_printf("inaccessible file visible via hide unreadable\n");
-		return false;
+		torture_fail(torture, "inaccessible file visible via hide unreadable\n");
 	}
 	if (is_visible(hideunwrite, fname)) {
-		d_printf("inaccessible file visible via hide unwriteable\n");
-		return false;
+		torture_fail(torture, "inaccessible file visible via hide unwriteable\n");
 	}
 
 	smbcli_chmod(cli->tree, fname, UNIX_R_USR|UNIX_W_USR);
diff --git a/source4/torture/raw/write.c b/source4/torture/raw/write.c
index fa2f8ef..d3d21c5 100644
--- a/source4/torture/raw/write.c
+++ b/source4/torture/raw/write.c
@@ -111,7 +111,7 @@ static bool test_write(struct torture_context *tctx,
 	buf = talloc_zero_array(tctx, uint8_t, maxsize);
 
 	if (!torture_setup_dir(cli, BASEDIR)) {
-		return false;
+		torture_fail(tctx, "failed to setup basedir");
 	}
 
 	torture_comment(tctx, "Testing RAW_WRITE_WRITE\n");
@@ -119,9 +119,9 @@ static bool test_write(struct torture_context *tctx,
 
 	fnum = smbcli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE);
 	if (fnum == -1) {
-		torture_comment(tctx, "Failed to create %s - %s\n", fname, smbcli_errstr(cli->tree));
 		ret = false;
-		goto done;
+		torture_fail_goto(tctx, done,
+			talloc_asprintf(tctx, "Failed to create %s - %s\n", fname, smbcli_errstr(cli->tree)));
 	}
 
 	torture_comment(tctx, "Trying zero write\n");
@@ -146,9 +146,8 @@ static bool test_write(struct torture_context *tctx,
 
 	memset(buf, 0, maxsize);
 	if (smbcli_read(cli->tree, fnum, buf, 0, 13) != 13) {
-		torture_comment(tctx, "read failed at %s\n", __location__);
 		ret = false;
-		goto done;
+		torture_fail_goto(tctx, done, talloc_asprintf(tctx, "read failed at %s\n", __location__));
 	}
 	CHECK_BUFFER(buf+4, seed, 9);
 	CHECK_VALUE(IVAL(buf,0), 0);
@@ -165,9 +164,8 @@ static bool test_write(struct torture_context *tctx,
 
 	memset(buf, 0, maxsize);
 	if (smbcli_read(cli->tree, fnum, buf, 0, 4000) != 4000) {
-		torture_comment(tctx, "read failed at %s\n", __location__);
 		ret = false;
-		goto done;
+		torture_fail_goto(tctx, done, talloc_asprintf(tctx, "read failed at %s\n", __location__));
 	}
 	CHECK_BUFFER(buf, seed, 4000);
 
@@ -188,11 +186,6 @@ static bool test_write(struct torture_context *tctx,
 		goto done;
 	}
 
-	if (!(cli->transport->negotiate.capabilities & CAP_LARGE_FILES)) {
-		torture_comment(tctx, "skipping large file tests - CAP_LARGE_FILES not set\n");
-		goto done;
-	}
-
 	torture_comment(tctx, "Trying 2^32 offset\n");
 	setup_buffer(buf, seed, maxsize);
 	io.write.in.file.fnum = fnum;
@@ -206,9 +199,8 @@ static bool test_write(struct torture_context *tctx,
 
 	memset(buf, 0, maxsize);
 	if (smbcli_read(cli->tree, fnum, buf, io.write.in.offset, 4000) != 4000) {
-		torture_comment(tctx, "read failed at %s\n", __location__);
 		ret = false;
-		goto done;
+		torture_fail_goto(tctx, done, talloc_asprintf(tctx, "read failed at %s\n", __location__));
 	}
 	CHECK_BUFFER(buf, seed, 4000);
 
@@ -250,7 +242,7 @@ static bool test_writex(struct torture_context *tctx,
 	}
 
 	if (!torture_setup_dir(cli, BASEDIR)) {
-		return false;
+		torture_fail(tctx, "failed to setup basedir");
 	}
 
 	torture_comment(tctx, "Testing RAW_WRITE_WRITEX\n");
@@ -258,9 +250,8 @@ static bool test_writex(struct torture_context *tctx,
 
 	fnum = smbcli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE);
 	if (fnum == -1) {
-		torture_comment(tctx, "Failed to create %s - %s\n", fname, smbcli_errstr(cli->tree));
 		ret = false;
-		goto done;
+		torture_fail_goto(tctx, done, talloc_asprintf(tctx, "Failed to create %s - %s\n", fname, smbcli_errstr(cli->tree)));
 	}
 
 	torture_comment(tctx, "Trying zero write\n");
@@ -286,9 +277,8 @@ static bool test_writex(struct torture_context *tctx,
 
 	memset(buf, 0, maxsize);
 	if (smbcli_read(cli->tree, fnum, buf, 0, 13) != 13) {
-		torture_comment(tctx, "read failed at %s\n", __location__);
 		ret = false;
-		goto done;
+		torture_fail_goto(tctx, done, talloc_asprintf(tctx, "read failed at %s\n", __location__));
 	}
 	CHECK_BUFFER(buf+4, seed, 9);
 	CHECK_VALUE(IVAL(buf,0), 0);
@@ -305,9 +295,8 @@ static bool test_writex(struct torture_context *tctx,
 
 	memset(buf, 0, maxsize);
 	if (smbcli_read(cli->tree, fnum, buf, 0, 4000) != 4000) {
-		torture_comment(tctx, "read failed at %s\n", __location__);
 		ret = false;
-		goto done;
+		torture_fail_goto(tctx, done, talloc_asprintf(tctx, "read failed at %s\n", __location__));
 	}
 	CHECK_BUFFER(buf, seed, 4000);
 
@@ -338,9 +327,8 @@ static bool test_writex(struct torture_context *tctx,
 	torture_comment(tctx, "Trying locked region\n");
 	cli->session->pid++;
 	if (NT_STATUS_IS_ERR(smbcli_lock(cli->tree, fnum, 3, 1, 0, WRITE_LOCK))) {
-		torture_comment(tctx, "Failed to lock file at %s\n", __location__);
 		ret = false;
-		goto done;
+		torture_fail_goto(tctx, done, talloc_asprintf(tctx, "Failed to lock file at %s\n", __location__));
 	}
 	cli->session->pid--;
 	io.writex.in.wmode = 0;
@@ -354,8 +342,7 @@ static bool test_writex(struct torture_context *tctx,
 	CHECK_STATUS(status, NT_STATUS_OK);
 
 	if (!(cli->transport->negotiate.capabilities & CAP_LARGE_FILES)) {
-		torture_comment(tctx, "skipping large file tests - CAP_LARGE_FILES not set\n");
-		goto done;
+		torture_skip(tctx, "skipping large file tests - CAP_LARGE_FILES not set\n");
 	}
 
 	torture_comment(tctx, "Trying 2^32 offset\n");
@@ -371,9 +358,8 @@ static bool test_writex(struct torture_context *tctx,
 
 	memset(buf, 0, maxsize);
 	if (smbcli_read(cli->tree, fnum, buf, io.writex.in.offset, 4000) != 4000) {
-		torture_comment(tctx, "read failed at %s\n", __location__);
 		ret = false;
-		goto done;
+		torture_fail_goto(tctx, done, talloc_asprintf(tctx, "read failed at %s\n", __location__));
 	}
 	CHECK_BUFFER(buf, seed, 4000);
 
@@ -395,9 +381,8 @@ static bool test_writex(struct torture_context *tctx,
 
 		memset(buf, 0, maxsize);
 		if (smbcli_read(cli->tree, fnum, buf, io.writex.in.offset, 4000) != 4000) {
-			torture_comment(tctx, "read failed at %s\n", __location__);
 			ret = false;
-			goto done;
+			torture_fail_goto(tctx, done, talloc_asprintf(tctx, "read failed at %s\n", __location__));
 		}
 		CHECK_BUFFER(buf, seed+1, 4000);
 	}
@@ -432,12 +417,11 @@ static bool test_writeunlock(struct torture_context *tctx,
 	buf = talloc_zero_array(tctx, uint8_t, maxsize);
 
 	if (!cli->transport->negotiate.lockread_supported) {
-		torture_comment(tctx, "Server does not support writeunlock - skipping\n");
-		return true;
+		torture_skip(tctx, "Server does not support writeunlock - skipping\n");
 	}
 
 	if (!torture_setup_dir(cli, BASEDIR)) {
-		return false;
+		torture_fail(tctx, "failed to setup basedir");
 	}
 
 	torture_comment(tctx, "Testing RAW_WRITE_WRITEUNLOCK\n");
@@ -445,9 +429,8 @@ static bool test_writeunlock(struct torture_context *tctx,
 
 	fnum = smbcli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE);
 	if (fnum == -1) {
-		torture_comment(tctx, "Failed to create %s - %s\n", fname, smbcli_errstr(cli->tree));
 		ret = false;
-		goto done;
+		torture_fail_goto(tctx, done, talloc_asprintf(tctx, "Failed to create %s - %s\n", fname, smbcli_errstr(cli->tree)));
 	}
 
 	torture_comment(tctx, "Trying zero write\n");
@@ -469,9 +452,8 @@ static bool test_writeunlock(struct torture_context *tctx,
 	status = smb_raw_write(cli->tree, &io);
 	CHECK_STATUS(status, NT_STATUS_RANGE_NOT_LOCKED);
 	if (smbcli_read(cli->tree, fnum, buf, 0, 13) != 13) {
-		torture_comment(tctx, "read failed at %s\n", __location__);
 		ret = false;
-		goto done;
+		torture_fail_goto(tctx, done, talloc_asprintf(tctx, "read failed at %s\n", __location__));
 	}
 	CHECK_BUFFER(buf+4, seed, 9);
 	CHECK_VALUE(IVAL(buf,0), 0);
@@ -485,9 +467,8 @@ static bool test_writeunlock(struct torture_context *tctx,
 
 	memset(buf, 0, maxsize);
 	if (smbcli_read(cli->tree, fnum, buf, 0, 13) != 13) {
-		torture_comment(tctx, "read failed at %s\n", __location__);
 		ret = false;
-		goto done;
+		torture_fail_goto(tctx, done, talloc_asprintf(tctx, "read failed at %s\n", __location__));
 	}
 	CHECK_BUFFER(buf+4, seed, 9);
 	CHECK_VALUE(IVAL(buf,0), 0);
@@ -509,9 +490,8 @@ static bool test_writeunlock(struct torture_context *tctx,
 
 	memset(buf, 0, maxsize);
 	if (smbcli_read(cli->tree, fnum, buf, 0, 4000) != 4000) {
-		torture_comment(tctx, "read failed at %s\n", __location__);
 		ret = false;
-		goto done;
+		torture_fail_goto(tctx, done, talloc_asprintf(tctx, "read failed at %s\n", __location__));
 	}
 	CHECK_BUFFER(buf, seed, 4000);
 
@@ -528,8 +508,7 @@ static bool test_writeunlock(struct torture_context *tctx,
 	CHECK_STATUS(status, NT_STATUS_OK);
 
 	if (!(cli->transport->negotiate.capabilities & CAP_LARGE_FILES)) {
-		torture_comment(tctx, "skipping large file tests - CAP_LARGE_FILES not set\n");
-		goto done;
+		torture_skip(tctx, "skipping large file tests - CAP_LARGE_FILES not set\n");
 	}
 
 	torture_comment(tctx, "Trying 2^32 offset\n");
@@ -547,9 +526,8 @@ static bool test_writeunlock(struct torture_context *tctx,
 
 	memset(buf, 0, maxsize);
 	if (smbcli_read(cli->tree, fnum, buf, io.writeunlock.in.offset, 4000) != 4000) {
-		torture_comment(tctx, "read failed at %s\n", __location__);
 		ret = false;
-		goto done;
+		torture_fail_goto(tctx, done, talloc_asprintf(tctx, "read failed at %s\n", __location__));
 	}
 	CHECK_BUFFER(buf, seed, 4000);
 
@@ -580,12 +558,11 @@ static bool test_writeclose(struct torture_context *tctx,
 	buf = talloc_zero_array(tctx, uint8_t, maxsize);
 
 	if (!torture_setting_bool(tctx, "writeclose_support", true)) {
-		torture_comment(tctx, "Server does not support writeclose - skipping\n");
-		return true;
+		torture_skip(tctx, "Server does not support writeclose - skipping\n");
 	}
 
 	if (!torture_setup_dir(cli, BASEDIR)) {
-		return false;
+		torture_fail(tctx, "failed to setup basedir");
 	}
 
 	torture_comment(tctx, "Testing RAW_WRITE_WRITECLOSE\n");
@@ -593,9 +570,8 @@ static bool test_writeclose(struct torture_context *tctx,
 
 	fnum = smbcli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE);
 	if (fnum == -1) {
-		torture_comment(tctx, "Failed to create %s - %s\n", fname, smbcli_errstr(cli->tree));
 		ret = false;
-		goto done;
+		torture_fail_goto(tctx, done, talloc_asprintf(tctx, "Failed to create %s - %s\n", fname, smbcli_errstr(cli->tree)));
 	}
 
 	torture_comment(tctx, "Trying zero write\n");
@@ -628,9 +604,8 @@ static bool test_writeclose(struct torture_context *tctx,
 	io.writeclose.in.file.fnum = fnum;
 
 	if (smbcli_read(cli->tree, fnum, buf, 0, 13) != 13) {
-		torture_comment(tctx, "read failed at %s\n", __location__);
 		ret = false;
-		goto done;
+		torture_fail_goto(tctx, done, talloc_asprintf(tctx, "read failed at %s\n", __location__));
 	}
 	CHECK_BUFFER(buf+4, seed, 9);
 	CHECK_VALUE(IVAL(buf,0), 0);
@@ -645,9 +620,8 @@ static bool test_writeclose(struct torture_context *tctx,
 
 	memset(buf, 0, maxsize);
 	if (smbcli_read(cli->tree, fnum, buf, 0, 13) != 13) {
-		torture_comment(tctx, "read failed at %s\n", __location__);
 		ret = false;
-		goto done;
+		torture_fail_goto(tctx, done, talloc_asprintf(tctx, "read failed at %s\n", __location__));
 	}
 	CHECK_BUFFER(buf+4, seed, 9);
 	CHECK_VALUE(IVAL(buf,0), 0);
@@ -670,9 +644,8 @@ static bool test_writeclose(struct torture_context *tctx,
 
 	memset(buf, 0, maxsize);
 	if (smbcli_read(cli->tree, fnum, buf, 0, 4000) != 4000) {
-		torture_comment(tctx, "read failed at %s\n", __location__);
 		ret = false;
-		goto done;
+		torture_fail_goto(tctx, done, talloc_asprintf(tctx, "read failed at %s\n", __location__));
 	}
 	CHECK_BUFFER(buf, seed, 4000);
 
@@ -689,8 +662,7 @@ static bool test_writeclose(struct torture_context *tctx,
 	CHECK_STATUS(status, NT_STATUS_OK);
 
 	if (!(cli->transport->negotiate.capabilities & CAP_LARGE_FILES)) {
-		torture_comment(tctx, "skipping large file tests - CAP_LARGE_FILES not set\n");
-		goto done;
+		torture_skip(tctx, "skipping large file tests - CAP_LARGE_FILES not set\n");
 	}
 
 	torture_comment(tctx, "Trying 2^32 offset\n");
@@ -709,9 +681,8 @@ static bool test_writeclose(struct torture_context *tctx,
 
 	memset(buf, 0, maxsize);
 	if (smbcli_read(cli->tree, fnum, buf, io.writeclose.in.offset, 4000) != 4000) {
-		torture_comment(tctx, "read failed at %s\n", __location__);
 		ret = false;
-		goto done;
+		torture_fail_goto(tctx, done, talloc_asprintf(tctx, "read failed at %s\n", __location__));
 	}
 	CHECK_BUFFER(buf, seed, 4000);
 
diff --git a/source4/torture/rpc/samba3rpc.c b/source4/torture/rpc/samba3rpc.c
index e1950bd..74450a6 100644
--- a/source4/torture/rpc/samba3rpc.c
+++ b/source4/torture/rpc/samba3rpc.c
@@ -1295,9 +1295,7 @@ static bool leave(struct torture_context *tctx,
 
 static bool torture_netlogon_samba3(struct torture_context *torture)
 {
-	TALLOC_CTX *mem_ctx;
 	NTSTATUS status;
-	bool ret = false;
 	struct smbcli_state *cli;
 	struct cli_credentials *anon_creds;
 	struct cli_credentials *wks_creds;
@@ -1311,22 +1309,14 @@ static bool torture_netlogon_samba3(struct torture_context *torture)
 		wks_name = get_myname(torture);
 	}
 
-	mem_ctx = talloc_init("torture_netlogon_samba3");
-
-	if (mem_ctx == NULL) {
-		torture_comment(torture, "talloc_init failed\n");
-		return false;
-	}
-
-	if (!(anon_creds = cli_credentials_init_anon(mem_ctx))) {
-		torture_comment(torture, "create_anon_creds failed\n");


-- 
Samba Shared Repository


More information about the samba-cvs mailing list