[SCM] Samba Shared Repository - branch master updated

Stefan Metzmacher metze at samba.org
Mon May 7 20:51:04 MDT 2012


The branch, master has been updated
       via  5d4d8fe s4:torture/raw/context: add subtests as torture testcases
       via  dd804dd s4:torture/raw/context: INVALID_PARAMETER vs. LOGON_FAILURE...
       via  7c0c1fa s4:torture/raw: make torture_raw_context a test suite
       via  05bed62 s4:torture/raw/context: make use of torture_* macros and avoid 'printf'
       via  27efeab s4:torture/raw/context: pass tctx to test_pid_exit_only_sees_open()
      from  75494f7 selftest: samba4 doesn't support reauth

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


- Log -----------------------------------------------------------------
commit 5d4d8fefe28051ace587494bff5e16b4e4211773
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu May 3 14:41:21 2012 +0200

    s4:torture/raw/context: add subtests as torture testcases
    
    TODO: add test_session with 'use spnego = false'.
          We need a way to do set an option just for one test case.
    
    Note: the 'use spnego = false' was ignored before as it's
          only used on the first session setup on a connection.
    
    metze
    
    Autobuild-User: Stefan Metzmacher <metze at samba.org>
    Autobuild-Date: Tue May  8 04:50:39 CEST 2012 on sn-devel-104

commit dd804dd8caf2744aba5968b86724a538159708eb
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue May 1 12:38:06 2012 +0200

    s4:torture/raw/context: INVALID_PARAMETER vs. LOGON_FAILURE...
    
    If the try a session setup without EXTENDED_SECURITY after
    one with EXTENDED_SECURITY Windows 2008 R2 returns INVALID_PARAMETER,
    while Windows 2000 sp4 returns LOGON_FAILURE...
    
    metze

commit 7c0c1fabd08cac83f306240f00a98901543a367f
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed May 2 13:46:34 2012 +0200

    s4:torture/raw: make torture_raw_context a test suite
    
    metze

commit 05bed62371e3acfb1813024ae45bd563e3a1d749
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue May 1 12:39:21 2012 +0200

    s4:torture/raw/context: make use of torture_* macros and avoid 'printf'
    
    metze

commit 27efeabab47694cb2f147d4c964c62213cc03fef
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue May 1 12:35:28 2012 +0200

    s4:torture/raw/context: pass tctx to test_pid_exit_only_sees_open()
    
    metze

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

Summary of changes:
 source4/torture/raw/context.c |  262 +++++++++++++++++++----------------------
 source4/torture/raw/raw.c     |    2 +-
 2 files changed, 121 insertions(+), 143 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/torture/raw/context.c b/source4/torture/raw/context.c
index 45e7482..af53453 100644
--- a/source4/torture/raw/context.c
+++ b/source4/torture/raw/context.c
@@ -30,35 +30,23 @@
 
 #define BASEDIR "\\rawcontext"
 
-#define CHECK_STATUS(status, correct) do { \
-	if (!NT_STATUS_EQUAL(status, correct)) { \
-		printf("(%s) Incorrect status %s - should be %s\n", \
-		       __location__, nt_errstr(status), nt_errstr(correct)); \
-		ret = false; \
-		goto done; \
-	}} while (0)
-
-#define CHECK_VALUE(v, correct) do { \
-	if ((v) != (correct)) { \
-		printf("(%s) Incorrect value %s=%d - should be %d\n", \
-		       __location__, #v, v, correct); \
-		ret = false; \
-		goto done; \
-	}} while (0)
-
-#define CHECK_NOT_VALUE(v, correct) do { \
-	if ((v) == (correct)) { \
-		printf("(%s) Incorrect value %s=%d - should not be %d\n", \
-		       __location__, #v, v, correct); \
-		ret = false; \
-		goto done; \
-	}} while (0)
+#define CHECK_STATUS(status, correct) \
+	torture_assert_ntstatus_equal_goto(tctx, status, correct, ret, done, __location__)
+
+#define CHECK_VALUE(v, correct) \
+	torture_assert_int_equal_goto(tctx, v, correct, ret, done, __location__)
+
+#define CHECK_NOT_VALUE(v, correct) \
+	torture_assert_goto(tctx, ((v) != (correct)), ret, done, \
+		talloc_asprintf(tctx, "(%s) Incorrect value %s=%d - should not be %d\n", \
+		       __location__, #v, v, correct));
 
 
 /*
   test session ops
 */
-static bool test_session(struct smbcli_state *cli, struct torture_context *tctx)
+static bool test_session(struct torture_context *tctx,
+			 struct smbcli_state *cli)
 {
 	NTSTATUS status;
 	bool ret = true;
@@ -82,13 +70,13 @@ static bool test_session(struct smbcli_state *cli, struct torture_context *tctx)
 	int i;
 	struct smbcli_session_options options;
 
-	printf("TESTING SESSION HANDLING\n");
+	torture_comment(tctx, "TESTING SESSION HANDLING\n");
 
 	if (!torture_setup_dir(cli, BASEDIR)) {
 		return false;
 	}
 
-	printf("create a second security context on the same transport\n");
+	torture_comment(tctx, "create a second security context on the same transport\n");
 
 	lpcfg_smbcli_session_options(tctx->lp_ctx, &options);
 	gensec_settings = lpcfg_gensec_settings(tctx, tctx->lp_ctx);
@@ -107,7 +95,7 @@ static bool test_session(struct smbcli_state *cli, struct torture_context *tctx)
 	
 	session->vuid = setup.out.vuid;
 
-	printf("create a third security context on the same transport, with vuid set\n");
+	torture_comment(tctx, "create a third security context on the same transport, with vuid set\n");
 	session2 = smbcli_session_init(cli->transport, tctx, false, options);
 
 	session2->vuid = session->vuid;
@@ -121,12 +109,12 @@ static bool test_session(struct smbcli_state *cli, struct torture_context *tctx)
 	CHECK_STATUS(status, NT_STATUS_OK);
 
 	session2->vuid = setup.out.vuid;
-	printf("vuid1=%d vuid2=%d vuid3=%d\n", cli->session->vuid, session->vuid, session2->vuid);
+	torture_comment(tctx, "vuid1=%d vuid2=%d vuid3=%d\n", cli->session->vuid, session->vuid, session2->vuid);
 	
 	if (cli->transport->negotiate.capabilities & CAP_EXTENDED_SECURITY) {
 		/* Samba4 currently fails this - we need to determine if this insane behaviour is important */
 		if (session2->vuid == session->vuid) {
-			printf("server allows the user to re-use an existing vuid in session setup \n");
+			torture_comment(tctx, "server allows the user to re-use an existing vuid in session setup \n");
 		}
 	} else {
 		CHECK_NOT_VALUE(session2->vuid, session->vuid);
@@ -134,7 +122,7 @@ static bool test_session(struct smbcli_state *cli, struct torture_context *tctx)
 	talloc_free(session2);
 
 	if (cli->transport->negotiate.capabilities & CAP_EXTENDED_SECURITY) {
-		printf("create a fourth security context on the same transport, without extended security\n");
+		torture_comment(tctx, "create a fourth security context on the same transport, without extended security\n");
 		session3 = smbcli_session_init(cli->transport, tctx, false, options);
 
 		session3->vuid = session->vuid;
@@ -145,9 +133,15 @@ static bool test_session(struct smbcli_state *cli, struct torture_context *tctx)
 		setup.in.credentials = cmdline_credentials;
 
 		status = smb_composite_sesssetup(session3, &setup);
-		CHECK_STATUS(status, NT_STATUS_LOGON_FAILURE);
+		if (!NT_STATUS_EQUAL(status, NT_STATUS_LOGON_FAILURE)) {
+			/*
+			 * Windows 2008 R2 returns INVALID_PARAMETER
+			 * while Windows 2000 sp4 returns LOGON_FAILURE...
+			 */
+			CHECK_STATUS(status, NT_STATUS_INVALID_PARAMETER);
+		}
 
-		printf("create a fouth anonymous security context on the same transport, without extended security\n");
+		torture_comment(tctx, "create a fouth anonymous security context on the same transport, without extended security\n");
 		session4 = smbcli_session_init(cli->transport, tctx, false, options);
 
 		session4->vuid = session->vuid;
@@ -167,11 +161,11 @@ static bool test_session(struct smbcli_state *cli, struct torture_context *tctx)
 		talloc_free(session4);
 	}
 		
-	printf("use the same tree as the existing connection\n");
+	torture_comment(tctx, "use the same tree as the existing connection\n");
 	tree = smbcli_tree_init(session, tctx, false);
 	tree->tid = cli->tree->tid;
 
-	printf("create a file using the new vuid\n");
+	torture_comment(tctx, "create a file using the new vuid\n");
 	io.generic.level = RAW_OPEN_NTCREATEX;
 	io.ntcreatex.in.root_fid.fnum = 0;
 	io.ntcreatex.in.flags = 0;
@@ -188,7 +182,7 @@ static bool test_session(struct smbcli_state *cli, struct torture_context *tctx)
 	CHECK_STATUS(status, NT_STATUS_OK);
 	fnum = io.ntcreatex.out.file.fnum;
 
-	printf("write using the old vuid\n");
+	torture_comment(tctx, "write using the old vuid\n");
 	wr.generic.level = RAW_WRITE_WRITEX;
 	wr.writex.in.file.fnum = fnum;
 	wr.writex.in.offset = 0;
@@ -200,32 +194,32 @@ static bool test_session(struct smbcli_state *cli, struct torture_context *tctx)
 	status = smb_raw_write(cli->tree, &wr);
 	CHECK_STATUS(status, NT_STATUS_INVALID_HANDLE);
 
-	printf("write with the new vuid\n");
+	torture_comment(tctx, "write with the new vuid\n");
 	status = smb_raw_write(tree, &wr);
 	CHECK_STATUS(status, NT_STATUS_OK);
 	CHECK_VALUE(wr.writex.out.nwritten, 1);
 
-	printf("logoff the new vuid\n");
+	torture_comment(tctx, "logoff the new vuid\n");
 	status = smb_raw_ulogoff(session);
 	CHECK_STATUS(status, NT_STATUS_OK);
 
-	printf("the new vuid should not now be accessible\n");
+	torture_comment(tctx, "the new vuid should not now be accessible\n");
 	status = smb_raw_write(tree, &wr);
 	CHECK_STATUS(status, NT_STATUS_INVALID_HANDLE);
 
-	printf("second logoff for the new vuid should fail\n");
+	torture_comment(tctx, "second logoff for the new vuid should fail\n");
 	status = smb_raw_ulogoff(session);
 	CHECK_STATUS(status, NT_STATUS_DOS(ERRSRV, ERRbaduid));
 	talloc_free(session);
 
-	printf("the fnum should have been auto-closed\n");
+	torture_comment(tctx, "the fnum should have been auto-closed\n");
 	cl.close.level = RAW_CLOSE_CLOSE;
 	cl.close.in.file.fnum = fnum;
 	cl.close.in.write_time = 0;
 	status = smb_raw_close(cli->tree, &cl);
 	CHECK_STATUS(status, NT_STATUS_INVALID_HANDLE);
 
-	printf("create %d secondary security contexts on the same transport\n", 
+	torture_comment(tctx, "create %d secondary security contexts on the same transport\n",
 	       (int)ARRAY_SIZE(sessions));
 	for (i=0; i <ARRAY_SIZE(sessions); i++) {
 		setups[i].in.sesskey = cli->transport->negotiate.sesskey;
@@ -241,13 +235,13 @@ static bool test_session(struct smbcli_state *cli, struct torture_context *tctx)
 	}
 
 
-	printf("finishing %d secondary security contexts on the same transport\n", 
+	torture_comment(tctx, "finishing %d secondary security contexts on the same transport\n",
 	       (int)ARRAY_SIZE(sessions));
 	for (i=0; i< ARRAY_SIZE(sessions); i++) {
 		status = smb_composite_sesssetup_recv(composite_contexts[i]);
 		CHECK_STATUS(status, NT_STATUS_OK);
 		sessions[i]->vuid = setups[i].out.vuid;
-		printf("VUID: %d\n", sessions[i]->vuid);
+		torture_comment(tctx, "VUID: %d\n", sessions[i]->vuid);
 		status = smb_raw_ulogoff(sessions[i]);
 		CHECK_STATUS(status, NT_STATUS_OK);
 	}
@@ -263,7 +257,7 @@ done:
 /*
   test tree ops
 */
-static bool test_tree(struct smbcli_state *cli, struct torture_context *tctx)
+static bool test_tree(struct torture_context *tctx, struct smbcli_state *cli)
 {
 	NTSTATUS status;
 	bool ret = true;
@@ -277,7 +271,7 @@ static bool test_tree(struct smbcli_state *cli, struct torture_context *tctx)
 	const char *fname = BASEDIR "\\test.txt";
 	uint8_t c = 1;
 
-	printf("TESTING TREE HANDLING\n");
+	torture_comment(tctx, "TESTING TREE HANDLING\n");
 
 	if (!torture_setup_dir(cli, BASEDIR)) {
 		return false;
@@ -286,7 +280,7 @@ static bool test_tree(struct smbcli_state *cli, struct torture_context *tctx)
 	share = torture_setting_string(tctx, "share", NULL);
 	host  = torture_setting_string(tctx, "host", NULL);
 	
-	printf("create a second tree context on the same session\n");
+	torture_comment(tctx, "create a second tree context on the same session\n");
 	tree = smbcli_tree_init(cli->session, tctx, false);
 
 	tcon.generic.level = RAW_TCON_TCONX;
@@ -299,15 +293,15 @@ static bool test_tree(struct smbcli_state *cli, struct torture_context *tctx)
 	
 
 	tree->tid = tcon.tconx.out.tid;
-	printf("tid1=%d tid2=%d\n", cli->tree->tid, tree->tid);
+	torture_comment(tctx, "tid1=%d tid2=%d\n", cli->tree->tid, tree->tid);
 
-	printf("try a tconx with a bad device type\n");
+	torture_comment(tctx, "try a tconx with a bad device type\n");
 	tcon.tconx.in.device = "FOO";	
 	status = smb_raw_tcon(tree, tctx, &tcon);
 	CHECK_STATUS(status, NT_STATUS_BAD_DEVICE_TYPE);
 
 
-	printf("create a file using the new tid\n");
+	torture_comment(tctx, "create a file using the new tid\n");
 	io.generic.level = RAW_OPEN_NTCREATEX;
 	io.ntcreatex.in.root_fid.fnum = 0;
 	io.ntcreatex.in.flags = 0;
@@ -324,7 +318,7 @@ static bool test_tree(struct smbcli_state *cli, struct torture_context *tctx)
 	CHECK_STATUS(status, NT_STATUS_OK);
 	fnum = io.ntcreatex.out.file.fnum;
 
-	printf("write using the old tid\n");
+	torture_comment(tctx, "write using the old tid\n");
 	wr.generic.level = RAW_WRITE_WRITEX;
 	wr.writex.in.file.fnum = fnum;
 	wr.writex.in.offset = 0;
@@ -336,20 +330,20 @@ static bool test_tree(struct smbcli_state *cli, struct torture_context *tctx)
 	status = smb_raw_write(cli->tree, &wr);
 	CHECK_STATUS(status, NT_STATUS_INVALID_HANDLE);
 
-	printf("write with the new tid\n");
+	torture_comment(tctx, "write with the new tid\n");
 	status = smb_raw_write(tree, &wr);
 	CHECK_STATUS(status, NT_STATUS_OK);
 	CHECK_VALUE(wr.writex.out.nwritten, 1);
 
-	printf("disconnect the new tid\n");
+	torture_comment(tctx, "disconnect the new tid\n");
 	status = smb_tree_disconnect(tree);
 	CHECK_STATUS(status, NT_STATUS_OK);
 
-	printf("the new tid should not now be accessible\n");
+	torture_comment(tctx, "the new tid should not now be accessible\n");
 	status = smb_raw_write(tree, &wr);
 	CHECK_STATUS(status, NT_STATUS_INVALID_HANDLE);
 
-	printf("the fnum should have been auto-closed\n");
+	torture_comment(tctx, "the fnum should have been auto-closed\n");
 	cl.close.level = RAW_CLOSE_CLOSE;
 	cl.close.in.file.fnum = fnum;
 	cl.close.in.write_time = 0;
@@ -368,7 +362,7 @@ done:
   this demonstrates that a tcon isn't autoclosed by a ulogoff
   the tcon can be reused using any other valid session later
 */
-static bool test_tree_ulogoff(struct smbcli_state *cli, struct torture_context *tctx)
+static bool test_tree_ulogoff(struct torture_context *tctx, struct smbcli_state *cli)
 {
 	NTSTATUS status;
 	bool ret = true;
@@ -386,7 +380,7 @@ static bool test_tree_ulogoff(struct smbcli_state *cli, struct torture_context *
 	uint8_t c = 1;
 	struct smbcli_session_options options;
 
-	printf("TESTING TREE with ulogoff\n");
+	torture_comment(tctx, "TESTING TREE with ulogoff\n");
 
 	if (!torture_setup_dir(cli, BASEDIR)) {
 		return false;
@@ -397,7 +391,7 @@ static bool test_tree_ulogoff(struct smbcli_state *cli, struct torture_context *
 
 	lpcfg_smbcli_session_options(tctx->lp_ctx, &options);
 
-	printf("create the first new sessions\n");
+	torture_comment(tctx, "create the first new sessions\n");
 	session1 = smbcli_session_init(cli->transport, tctx, false, options);
 	setup.in.sesskey = cli->transport->negotiate.sesskey;
 	setup.in.capabilities = cli->transport->negotiate.capabilities;
@@ -407,9 +401,9 @@ static bool test_tree_ulogoff(struct smbcli_state *cli, struct torture_context *
 	status = smb_composite_sesssetup(session1, &setup);
 	CHECK_STATUS(status, NT_STATUS_OK);
 	session1->vuid = setup.out.vuid;
-	printf("vuid1=%d\n", session1->vuid);
+	torture_comment(tctx, "vuid1=%d\n", session1->vuid);
 
-	printf("create a tree context on the with vuid1\n");
+	torture_comment(tctx, "create a tree context on the with vuid1\n");
 	tree = smbcli_tree_init(session1, tctx, false);
 	tcon.generic.level = RAW_TCON_TCONX;
 	tcon.tconx.in.flags = 0;
@@ -419,9 +413,9 @@ static bool test_tree_ulogoff(struct smbcli_state *cli, struct torture_context *
 	status = smb_raw_tcon(tree, tctx, &tcon);
 	CHECK_STATUS(status, NT_STATUS_OK);
 	tree->tid = tcon.tconx.out.tid;
-	printf("tid=%d\n", tree->tid);
+	torture_comment(tctx, "tid=%d\n", tree->tid);
 
-	printf("create a file using vuid1\n");
+	torture_comment(tctx, "create a file using vuid1\n");
 	io.generic.level = RAW_OPEN_NTCREATEX;
 	io.ntcreatex.in.root_fid.fnum = 0;
 	io.ntcreatex.in.flags = 0;
@@ -438,7 +432,7 @@ static bool test_tree_ulogoff(struct smbcli_state *cli, struct torture_context *
 	CHECK_STATUS(status, NT_STATUS_OK);
 	fnum1 = io.ntcreatex.out.file.fnum;
 
-	printf("write using vuid1\n");
+	torture_comment(tctx, "write using vuid1\n");
 	wr.generic.level = RAW_WRITE_WRITEX;
 	wr.writex.in.file.fnum = fnum1;
 	wr.writex.in.offset = 0;
@@ -450,11 +444,11 @@ static bool test_tree_ulogoff(struct smbcli_state *cli, struct torture_context *
 	CHECK_STATUS(status, NT_STATUS_OK);
 	CHECK_VALUE(wr.writex.out.nwritten, 1);
 
-	printf("ulogoff the vuid1\n");
+	torture_comment(tctx, "ulogoff the vuid1\n");
 	status = smb_raw_ulogoff(session1);
 	CHECK_STATUS(status, NT_STATUS_OK);
 
-	printf("create the second new sessions\n");
+	torture_comment(tctx, "create the second new sessions\n");
 	session2 = smbcli_session_init(cli->transport, tctx, false, options);
 	setup.in.sesskey = cli->transport->negotiate.sesskey;
 	setup.in.capabilities = cli->transport->negotiate.capabilities;
@@ -464,12 +458,12 @@ static bool test_tree_ulogoff(struct smbcli_state *cli, struct torture_context *
 	status = smb_composite_sesssetup(session2, &setup);
 	CHECK_STATUS(status, NT_STATUS_OK);
 	session2->vuid = setup.out.vuid;
-	printf("vuid2=%d\n", session2->vuid);
+	torture_comment(tctx, "vuid2=%d\n", session2->vuid);
 
-	printf("use the existing tree with vuid2\n");
+	torture_comment(tctx, "use the existing tree with vuid2\n");
 	tree->session = session2;
 
-	printf("create a file using vuid2\n");
+	torture_comment(tctx, "create a file using vuid2\n");
 	io.generic.level = RAW_OPEN_NTCREATEX;
 	io.ntcreatex.in.root_fid.fnum = 0;
 	io.ntcreatex.in.flags = 0;
@@ -486,7 +480,7 @@ static bool test_tree_ulogoff(struct smbcli_state *cli, struct torture_context *
 	CHECK_STATUS(status, NT_STATUS_OK);
 	fnum2 = io.ntcreatex.out.file.fnum;
 
-	printf("write using vuid2\n");
+	torture_comment(tctx, "write using vuid2\n");
 	wr.generic.level = RAW_WRITE_WRITEX;
 	wr.writex.in.file.fnum = fnum2;
 	wr.writex.in.offset = 0;
@@ -498,16 +492,16 @@ static bool test_tree_ulogoff(struct smbcli_state *cli, struct torture_context *
 	CHECK_STATUS(status, NT_STATUS_OK);
 	CHECK_VALUE(wr.writex.out.nwritten, 1);
 
-	printf("ulogoff the vuid2\n");
+	torture_comment(tctx, "ulogoff the vuid2\n");
 	status = smb_raw_ulogoff(session2);
 	CHECK_STATUS(status, NT_STATUS_OK);
 
 	/* this also demonstrates that SMBtdis doesn't need a valid vuid */
-	printf("disconnect the existing tree connection\n");
+	torture_comment(tctx, "disconnect the existing tree connection\n");
 	status = smb_tree_disconnect(tree);
 	CHECK_STATUS(status, NT_STATUS_OK);
 
-	printf("disconnect the existing tree connection\n");
+	torture_comment(tctx, "disconnect the existing tree connection\n");
 	status = smb_tree_disconnect(tree);
 	CHECK_STATUS(status, NT_STATUS_DOS(ERRSRV,ERRinvnid));
 
@@ -523,9 +517,11 @@ done:
   this test demonstrates that exit() only sees the PID
   used for the open() calls
 */
-static bool test_pid_exit_only_sees_open(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
+static bool test_pid_exit_only_sees_open(struct torture_context *tctx,
+					 struct smbcli_state *cli)
 {
 	NTSTATUS status;
+	TALLOC_CTX *mem_ctx = tctx;
 	bool ret = true;
 	union smb_open io;
 	union smb_write wr;
@@ -535,7 +531,7 @@ static bool test_pid_exit_only_sees_open(struct smbcli_state *cli, TALLOC_CTX *m
 	uint8_t c = 1;
 	uint16_t pid1, pid2;
 
-	printf("TESTING PID HANDLING exit() only cares about open() PID\n");
+	torture_comment(tctx, "TESTING PID HANDLING exit() only cares about open() PID\n");
 
 	if (!torture_setup_dir(cli, BASEDIR)) {
 		return false;
@@ -544,9 +540,9 @@ static bool test_pid_exit_only_sees_open(struct smbcli_state *cli, TALLOC_CTX *m
 	pid1 = cli->session->pid;
 	pid2 = pid1 + 1;
 
-	printf("pid1=%d pid2=%d\n", pid1, pid2);
+	torture_comment(tctx, "pid1=%d pid2=%d\n", pid1, pid2);
 
-	printf("create a file using pid1\n");
+	torture_comment(tctx, "create a file using pid1\n");
 	cli->session->pid = pid1;
 	io.generic.level = RAW_OPEN_NTCREATEX;
 	io.ntcreatex.in.root_fid.fnum = 0;
@@ -564,7 +560,7 @@ static bool test_pid_exit_only_sees_open(struct smbcli_state *cli, TALLOC_CTX *m
 	CHECK_STATUS(status, NT_STATUS_OK);
 	fnum = io.ntcreatex.out.file.fnum;
 
-	printf("write using pid2\n");
+	torture_comment(tctx, "write using pid2\n");
 	cli->session->pid = pid2;
 	wr.generic.level = RAW_WRITE_WRITEX;
 	wr.writex.in.file.fnum = fnum;
@@ -577,23 +573,23 @@ static bool test_pid_exit_only_sees_open(struct smbcli_state *cli, TALLOC_CTX *m
 	CHECK_STATUS(status, NT_STATUS_OK);
 	CHECK_VALUE(wr.writex.out.nwritten, 1);
 
-	printf("exit pid2\n");
+	torture_comment(tctx, "exit pid2\n");
 	cli->session->pid = pid2;
 	status = smb_raw_exit(cli->session);
 	CHECK_STATUS(status, NT_STATUS_OK);
 
-	printf("the fnum should still be accessible via pid2\n");
+	torture_comment(tctx, "the fnum should still be accessible via pid2\n");
 	cli->session->pid = pid2;
 	status = smb_raw_write(cli->tree, &wr);
 	CHECK_STATUS(status, NT_STATUS_OK);
 	CHECK_VALUE(wr.writex.out.nwritten, 1);
 
-	printf("exit pid2\n");
+	torture_comment(tctx, "exit pid2\n");
 	cli->session->pid = pid2;
 	status = smb_raw_exit(cli->session);
 	CHECK_STATUS(status, NT_STATUS_OK);
 
-	printf("the fnum should still be accessible via pid1 and pid2\n");
+	torture_comment(tctx, "the fnum should still be accessible via pid1 and pid2\n");
 	cli->session->pid = pid1;
 	status = smb_raw_write(cli->tree, &wr);
 	CHECK_STATUS(status, NT_STATUS_OK);
@@ -603,12 +599,12 @@ static bool test_pid_exit_only_sees_open(struct smbcli_state *cli, TALLOC_CTX *m
 	CHECK_STATUS(status, NT_STATUS_OK);
 	CHECK_VALUE(wr.writex.out.nwritten, 1);
 
-	printf("exit pid1\n");
+	torture_comment(tctx, "exit pid1\n");
 	cli->session->pid = pid1;
 	status = smb_raw_exit(cli->session);
 	CHECK_STATUS(status, NT_STATUS_OK);
 
-	printf("the fnum should not now be accessible via pid1 or pid2\n");
+	torture_comment(tctx, "the fnum should not now be accessible via pid1 or pid2\n");
 	cli->session->pid = pid1;
 	status = smb_raw_write(cli->tree, &wr);
 	CHECK_STATUS(status, NT_STATUS_INVALID_HANDLE);
@@ -616,7 +612,7 @@ static bool test_pid_exit_only_sees_open(struct smbcli_state *cli, TALLOC_CTX *m
 	status = smb_raw_write(cli->tree, &wr);
 	CHECK_STATUS(status, NT_STATUS_INVALID_HANDLE);
 
-	printf("the fnum should have been auto-closed\n");
+	torture_comment(tctx, "the fnum should have been auto-closed\n");
 	cli->session->pid = pid1;
 	cl.close.level = RAW_CLOSE_CLOSE;
 	cl.close.in.file.fnum = fnum;
@@ -631,7 +627,8 @@ done:
 /*
   test pid ops with 2 sessions
 */
-static bool test_pid_2sess(struct smbcli_state *cli, struct torture_context *tctx)
+static bool test_pid_2sess(struct torture_context *tctx,
+			   struct smbcli_state *cli)
 {
 	NTSTATUS status;


-- 
Samba Shared Repository


More information about the samba-cvs mailing list