[SCM] Samba Shared Repository - branch master updated

Günther Deschner gd at samba.org
Mon Feb 15 15:05:18 MST 2010


The branch, master has been updated
       via  351f694... testprogs: add "samba3" and "architecture=" options to spoolss tester.
      from  23d1dd5... s4-drs: DsGetReplInfo() refactoring

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


- Log -----------------------------------------------------------------
commit 351f694d6102611fc65a0f02dc1c580bcab2e9d6
Author: Günther Deschner <gd at samba.org>
Date:   Mon Feb 15 23:03:48 2010 +0100

    testprogs: add "samba3" and "architecture=" options to spoolss tester.
    
    Guenther

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

Summary of changes:
 testprogs/win32/spoolss/spoolss.c |   42 +++++++++++++++++++++++++++++++++---
 testprogs/win32/spoolss/torture.h |    1 +
 2 files changed, 39 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/testprogs/win32/spoolss/spoolss.c b/testprogs/win32/spoolss/spoolss.c
index b83259d..12641f0 100644
--- a/testprogs/win32/spoolss/spoolss.c
+++ b/testprogs/win32/spoolss/spoolss.c
@@ -228,7 +228,7 @@ static BOOL test_EnumForms(struct torture_context *tctx,
 			   HANDLE handle)
 {
 	DWORD levels[]  = { 1, 2 };
-	DWORD success[] = { 1, 0 };
+	DWORD success[] = { 1, 1 };
 	DWORD i;
 	LPBYTE buffer = NULL;
 
@@ -241,6 +241,11 @@ static BOOL test_EnumForms(struct torture_context *tctx,
 
 		torture_comment(tctx, "Testing EnumForms level %d", levels[i]);
 
+		if (tctx->samba3 && levels[i] == 2) {
+			torture_comment(tctx, "skipping level %d enum against samba\n", levels[i]);
+			continue;
+		}
+
 		EnumForms(handle, levels[i], NULL, 0, &needed, &returned);
 		err = GetLastError();
 		if (err == ERROR_INSUFFICIENT_BUFFER) {
@@ -638,6 +643,11 @@ static BOOL test_EnumJobs(struct torture_context *tctx,
 
 		torture_comment(tctx, "Testing EnumJobs level %d", levels[i]);
 
+		if (tctx->samba3 && levels[i] == 4) {
+			torture_comment(tctx, "skipping level %d enum against samba\n", levels[i]);
+			continue;
+		}
+
 		EnumJobs(handle, 0, 100, levels[i], NULL, 0, &needed, &returned);
 		err = GetLastError();
 		if (err == ERROR_INSUFFICIENT_BUFFER) {
@@ -1028,6 +1038,21 @@ static BOOL test_PrinterData(struct torture_context *tctx,
 /****************************************************************************
 ****************************************************************************/
 
+const char *get_string_param(const char *str)
+{
+	const char *p;
+
+	p = strchr(str, '=');
+	if (!p) {
+		return NULL;
+	}
+
+	return (p+1);
+}
+
+/****************************************************************************
+****************************************************************************/
+
 int main(int argc, char *argv[])
 {
 	BOOL ret = FALSE;
@@ -1036,9 +1061,10 @@ int main(int argc, char *argv[])
 	HANDLE server_handle;
 	PRINTER_DEFAULTS defaults_admin, defaults_use;
 	struct torture_context *tctx;
+	int i;
 
 	if (argc < 2) {
-		fprintf(stderr, "usage: %s <servername> [print]\n", argv[0]);
+		fprintf(stderr, "usage: %s <servername> [print] [samba3] [architecture=ARCHITECTURE]\n", argv[0]);
 		exit(-1);
 	}
 
@@ -1051,12 +1077,20 @@ int main(int argc, char *argv[])
 
 	servername = argv[1];
 
-	if (argc >= 3) {
-		if (strcmp(argv[2], "print") == 0) {
+	for (i=1; i < argc; i++) {
+		if (strcmp(argv[i], "print") == 0) {
 			tctx->print = TRUE;
 		}
+		if (strcmp(argv[i], "samba3") == 0) {
+			tctx->samba3 = TRUE;
+		}
+		if (strncmp(argv[i], "architecture", strlen("architecture")) == 0) {
+			architecture = get_string_param(argv[i]);
+		}
 	}
 
+	printf("Running testsuite with architecture: %s\n", architecture);
+
 	defaults_admin.pDatatype = NULL;
 	defaults_admin.pDevMode = NULL;
 	defaults_admin.DesiredAccess = PRINTER_ACCESS_ADMINISTER;
diff --git a/testprogs/win32/spoolss/torture.h b/testprogs/win32/spoolss/torture.h
index 23746cc..c295330 100644
--- a/testprogs/win32/spoolss/torture.h
+++ b/testprogs/win32/spoolss/torture.h
@@ -35,6 +35,7 @@ struct torture_context {
 	enum torture_result last_result;
 	char *last_reason;
 	BOOL print;
+	BOOL samba3;
 };
 
 /****************************************************************************


-- 
Samba Shared Repository


More information about the samba-cvs mailing list