[SCM] Samba Shared Repository - branch master updated

Günther Deschner gd at samba.org
Fri Mar 26 16:02:03 MDT 2010


The branch, master has been updated
       via  203a661... s3-selftest: set "lpq cache time = 0" in server configuration.
       via  d3a22fc... s3-selftest: set "lpq cache time = 0" in server configuration.
       via  0909696... s4-smbtorture: more JobInfo testing.
      from  e968db6... s3 ntlm_auth: Don't malloc data that will be talloc_free()d

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


- Log -----------------------------------------------------------------
commit 203a661e01e1a138871aacb1cc329a3e3e79295a
Author: Günther Deschner <gd at samba.org>
Date:   Fri Mar 26 22:59:29 2010 +0100

    s3-selftest: set "lpq cache time = 0" in server configuration.
    
    This fixes currently broken spoolss tests.
    (make test variant).
    
    Guenther

commit d3a22fc62b69ebaea84955b1083d59ca4001d50c
Author: Günther Deschner <gd at samba.org>
Date:   Fri Mar 26 22:58:42 2010 +0100

    s3-selftest: set "lpq cache time = 0" in server configuration.
    
    This fixes currently broken spoolss tests.
    
    Guenther

commit 0909696261f8f0f112615af224156ca525c41bf5
Author: Günther Deschner <gd at samba.org>
Date:   Fri Mar 26 15:23:34 2010 +0100

    s4-smbtorture: more JobInfo testing.
    
    Guenther

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

Summary of changes:
 selftest/target/Samba3.pm        |    1 +
 source3/script/tests/selftest.sh |    1 +
 source4/torture/rpc/spoolss.c    |   70 ++++++++++++++++++++++---------------
 3 files changed, 44 insertions(+), 28 deletions(-)


Changeset truncated at 500 lines:

diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm
index be34d94..341591b 100644
--- a/selftest/target/Samba3.pm
+++ b/selftest/target/Samba3.pm
@@ -543,6 +543,7 @@ sub provision($$$$$$)
 	lp resume command = $bindir_abs/vlp tdbfile=$lockdir/vlp.tdb lpresume %p %j
 	queue pause command = $bindir_abs/vlp tdbfile=$lockdir/vlp.tdb queuepause %p
 	queue resume command = $bindir_abs/vlp tdbfile=$lockdir/vlp.tdb queueresume %p
+	lpq cache time = 0
 
 	# Begin extra options
 	$extra_options
diff --git a/source3/script/tests/selftest.sh b/source3/script/tests/selftest.sh
index 40ada28..a13877d 100755
--- a/source3/script/tests/selftest.sh
+++ b/source3/script/tests/selftest.sh
@@ -315,6 +315,7 @@ cat >$SERVERCONFFILE<<EOF
 	lp resume command = $BINDIR/vlp tdbfile=$LOCKDIR/vlp.tdb lpresume %p %j
 	queue pause command = $BINDIR/vlp tdbfile=$LOCKDIR/vlp.tdb queuepause %p
 	queue resume command = $BINDIR/vlp tdbfile=$LOCKDIR/vlp.tdb queueresume %p
+	lpq cache time = 0
 
 	#Include user defined custom parameters if set
 	$INCLUDE_CUSTOM_CONF
diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c
index 61808c0..be03ee1 100644
--- a/source4/torture/rpc/spoolss.c
+++ b/source4/torture/rpc/spoolss.c
@@ -2518,20 +2518,21 @@ static bool test_AddPort(struct torture_context *tctx,
 	return true;
 }
 
-static bool test_GetJob(struct torture_context *tctx,
-			struct dcerpc_binding_handle *b,
-			struct policy_handle *handle, uint32_t job_id)
+static bool test_GetJob_args(struct torture_context *tctx,
+			     struct dcerpc_binding_handle *b,
+			     struct policy_handle *handle,
+			     uint32_t job_id,
+			     uint32_t level,
+			     union spoolss_JobInfo *info_p)
 {
 	NTSTATUS status;
 	struct spoolss_GetJob r;
 	union spoolss_JobInfo info;
 	uint32_t needed;
-	uint32_t levels[] = {1, 2 /* 3, 4 */};
-	uint32_t i;
 
 	r.in.handle = handle;
 	r.in.job_id = job_id;
-	r.in.level = 0;
+	r.in.level = level;
 	r.in.buffer = NULL;
 	r.in.offered = 0;
 	r.out.needed = &needed;
@@ -2540,35 +2541,44 @@ static bool test_GetJob(struct torture_context *tctx,
 	torture_comment(tctx, "Testing GetJob(%d), level %d\n", job_id, r.in.level);
 
 	status = dcerpc_spoolss_GetJob_r(b, tctx, &r);
-	torture_assert_werr_equal(tctx, r.out.result, WERR_UNKNOWN_LEVEL, "Unexpected return code");
-
-	for (i = 0; i < ARRAY_SIZE(levels); i++) {
-
-		torture_comment(tctx, "Testing GetJob(%d), level %d\n", job_id, r.in.level);
-
-		needed = 0;
+	torture_assert_ntstatus_ok(tctx, status, "GetJob failed");
+	if (level == 0) {
+		torture_assert_werr_equal(tctx, r.out.result, WERR_UNKNOWN_LEVEL, "Unexpected return code");
+	}
 
-		r.in.level = levels[i];
-		r.in.offered = 0;
-		r.in.buffer = NULL;
+	if (W_ERROR_EQUAL(r.out.result, WERR_INSUFFICIENT_BUFFER)) {
+		DATA_BLOB blob = data_blob_talloc(tctx, NULL, needed);
+		data_blob_clear(&blob);
+		r.in.buffer = &blob;
+		r.in.offered = needed;
 
 		status = dcerpc_spoolss_GetJob_r(b, tctx, &r);
 		torture_assert_ntstatus_ok(tctx, status, "GetJob failed");
+		torture_assert_werr_ok(tctx, r.out.result, "GetJob failed");
+		torture_assert(tctx, r.out.info, "No job info returned");
 
-		if (W_ERROR_EQUAL(r.out.result, WERR_INSUFFICIENT_BUFFER)) {
-			DATA_BLOB blob = data_blob_talloc(tctx, NULL, needed);
-			data_blob_clear(&blob);
-			r.in.buffer = &blob;
-			r.in.offered = needed;
+		CHECK_NEEDED_SIZE_LEVEL(spoolss_JobInfo, r.out.info, r.in.level, lp_iconv_convenience(tctx->lp_ctx), needed, 4);
+	}
 
-			status = dcerpc_spoolss_GetJob_r(b, tctx, &r);
-			torture_assert_ntstatus_ok(tctx, status, "GetJob failed");
+	if (info_p) {
+		*info_p = *r.out.info;
+	}
 
-		}
-		torture_assert(tctx, r.out.info, "No job info returned");
-		torture_assert_werr_ok(tctx, r.out.result, "GetJob failed");
+	return true;
+}
 
-		CHECK_NEEDED_SIZE_LEVEL(spoolss_JobInfo, r.out.info, r.in.level, lp_iconv_convenience(tctx->lp_ctx), needed, 4);
+static bool test_GetJob(struct torture_context *tctx,
+			struct dcerpc_binding_handle *b,
+			struct policy_handle *handle,
+			uint32_t job_id)
+{
+	uint32_t levels[] = {0, 1, 2 /* 3, 4 */};
+	uint32_t i;
+
+	for (i=0; i < ARRAY_SIZE(levels); i++) {
+		torture_assert(tctx,
+			test_GetJob_args(tctx, b, handle, job_id, levels[i], NULL),
+			"GetJob failed");
 	}
 
 	return true;
@@ -2802,11 +2812,15 @@ static bool test_DoPrintTest_check_jobs(struct torture_context *tctx,
 	torture_assert_int_equal(tctx, count, num_jobs, "unexpected number of jobs in queue");
 
 	for (i=0; i < num_jobs; i++) {
+		union spoolss_JobInfo ginfo;
+
 		torture_assert_int_equal(tctx, info[i].info1.job_id, job_ids[i], "job id mismatch");
 
 		torture_assert(tctx,
-			test_GetJob(tctx, b, handle, info[i].info1.job_id),
+			test_GetJob_args(tctx, b, handle, info[i].info1.job_id, 1, &ginfo),
 			"failed to call test_GetJob");
+
+		torture_assert_int_equal(tctx, ginfo.info1.job_id, info[i].info1.job_id, "job id mismatch");
 	}
 
 	for (i=0; i < num_jobs; i++) {


-- 
Samba Shared Repository


More information about the samba-cvs mailing list