summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2010-02-15 23:03:48 +0100
committerGünther Deschner <gd@samba.org>2010-02-15 23:05:05 +0100
commit351f694d6102611fc65a0f02dc1c580bcab2e9d6 (patch)
tree0dc931407cd3c30fb2ae296461d9016a2f82de5d
parent23d1dd5189e0662efb532c31b26c71434a00cff4 (diff)
downloadsamba-351f694d6102611fc65a0f02dc1c580bcab2e9d6.tar.gz
samba-351f694d6102611fc65a0f02dc1c580bcab2e9d6.tar.bz2
samba-351f694d6102611fc65a0f02dc1c580bcab2e9d6.zip
testprogs: add "samba3" and "architecture=" options to spoolss tester.
Guenther
-rw-r--r--testprogs/win32/spoolss/spoolss.c42
-rw-r--r--testprogs/win32/spoolss/torture.h1
2 files changed, 39 insertions, 4 deletions
diff --git a/testprogs/win32/spoolss/spoolss.c b/testprogs/win32/spoolss/spoolss.c
index b83259dd90..12641f02b9 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 23746cc2b7..c295330283 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;
};
/****************************************************************************