[SCM] Samba Shared Repository - branch v4-0-test updated - release-4-0-0alpha3-181-gfee7ea7

Jelmer Vernooij jelmer at samba.org
Tue Apr 15 23:43:36 GMT 2008


The branch, v4-0-test has been updated
       via  fee7ea7080ec40182efc6ffe57b267444eb9389a (commit)
       via  4f0954905a902381e66eec74fd30ff7adde232b8 (commit)
       via  46ad68ad0b9c604a6519de68c9bce8f5154b5c14 (commit)
       via  56340a5fa1b075001bba829686861a59406e1f5d (commit)
       via  a3f0e4151bd87399a8bab9b71bad36bdc53c365c (commit)
       via  f22602797fe841859c67558bb78e04c98b9e27e0 (commit)
       via  92873264d707bed88beac54a73a29d66c011f80c (commit)
       via  ad58a508542bd93115be0ad826fb93aa3d349658 (commit)
       via  0f789e6779eca38d93b968a0ffbbb8559ce483f1 (commit)
       via  0a2942f6e948177fcc671eae705e6e61644de81c (commit)
       via  a24651d649d24589a6c65e7bc4be9c49fdc80b2a (commit)
       via  e8e9f2cc7b0503e30b211094f452829395a73eec (commit)
      from  b9cac469f3c869a26f415a6c551cf6e8fbb06ed6 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v4-0-test


- Log -----------------------------------------------------------------
commit fee7ea7080ec40182efc6ffe57b267444eb9389a
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Wed Apr 16 01:32:54 2008 +0200

    Remove unused arguments from reg_open_local().

commit 4f0954905a902381e66eec74fd30ff7adde232b8
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Wed Apr 16 01:10:20 2008 +0200

    Fix -r test, knownfailure return code.

commit 46ad68ad0b9c604a6519de68c9bce8f5154b5c14
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Wed Apr 16 00:17:03 2008 +0200

    Mention the actual exit code when a suite failed.

commit 56340a5fa1b075001bba829686861a59406e1f5d
Merge: a3f0e4151bd87399a8bab9b71bad36bdc53c365c 0a2942f6e948177fcc671eae705e6e61644de81c
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Wed Apr 16 00:05:36 2008 +0200

    Merge branch 'wbinfo-test' of git://git.samba.org/kai/samba/kai-work-in-progress into v4-0-selftest

commit a3f0e4151bd87399a8bab9b71bad36bdc53c365c
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Wed Apr 16 00:05:12 2008 +0200

    Fix executable bit on blackbox ndrdump tests.

commit f22602797fe841859c67558bb78e04c98b9e27e0
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Wed Apr 16 00:04:11 2008 +0200

    Provide the right error count to formatters.

commit 92873264d707bed88beac54a73a29d66c011f80c
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Wed Apr 16 00:03:45 2008 +0200

    Properly warn about exit codes that indicate success while tests claim
    failure.

commit ad58a508542bd93115be0ad826fb93aa3d349658
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Wed Apr 16 00:03:00 2008 +0200

    Support knownfail Subunit command.

commit 0f789e6779eca38d93b968a0ffbbb8559ce483f1
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Tue Apr 15 23:52:06 2008 +0200

    Deal with commands not even starting.

commit 0a2942f6e948177fcc671eae705e6e61644de81c
Author: Kai Blin <kai at samba.org>
Date:   Tue Apr 15 17:04:36 2008 +0200

    blackbox: Add many more tests for wbinfo

commit a24651d649d24589a6c65e7bc4be9c49fdc80b2a
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Tue Apr 15 23:21:43 2008 +0200

    Add some documentation about the expected testsuite output.

commit e8e9f2cc7b0503e30b211094f452829395a73eec
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Tue Apr 15 22:42:52 2008 +0200

    Add some documentation on test behaviour in selftest.

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

Summary of changes:
 source/lib/registry/local.c          |    9 +--
 source/lib/registry/registry.h       |    4 +-
 source/lib/registry/registry.i       |    4 +-
 source/lib/registry/registry.py      |    2 +-
 source/lib/registry/registry_wrap.c  |  107 +++++++++---------
 source/lib/registry/samba.c          |    2 +-
 source/lib/registry/tests/registry.c |    2 +-
 source/lib/registry/tools/common.c   |    2 +-
 source/lib/registry/tools/regdiff.c  |    2 +-
 source/selftest/README               |   81 ++++++++++++--
 source/selftest/Subunit.pm           |   15 ++-
 source/selftest/output/plain.pm      |    3 +
 source/selftest/samba4_tests.sh      |    3 +-
 source/selftest/selftest.pl          |   18 ++-
 testprogs/blackbox/test_wbinfo.sh    |  201 ++++++++++++++++++++++++++++++++++
 15 files changed, 363 insertions(+), 92 deletions(-)
 mode change 100644 => 100755 testprogs/blackbox/test_ndrdump.sh
 create mode 100755 testprogs/blackbox/test_wbinfo.sh


Changeset truncated at 500 lines:

diff --git a/source/lib/registry/local.c b/source/lib/registry/local.c
index 5bf2d86..903bbb0 100644
--- a/source/lib/registry/local.c
+++ b/source/lib/registry/local.c
@@ -37,9 +37,6 @@ struct registry_local {
 		struct hive_key *key;
 		struct mountpoint *prev, *next;
 	} *mountpoints;
-
-	struct auth_session_info *session_info;
-	struct cli_credentials *credentials;
 };
 
 struct local_key {
@@ -294,9 +291,7 @@ const static struct registry_operations local_ops = {
 	.get_key_info = local_get_key_info,
 };
 
-WERROR reg_open_local(TALLOC_CTX *mem_ctx, struct registry_context **ctx,
-		      struct auth_session_info *session_info,
-		      struct cli_credentials *credentials)
+WERROR reg_open_local(TALLOC_CTX *mem_ctx, struct registry_context **ctx)
 {
 	struct registry_local *ret = talloc_zero(mem_ctx,
 						 struct registry_local);
@@ -304,8 +299,6 @@ WERROR reg_open_local(TALLOC_CTX *mem_ctx, struct registry_context **ctx,
 	W_ERROR_HAVE_NO_MEMORY(ret);
 
 	ret->ops = &local_ops;
-	ret->session_info = session_info;
-	ret->credentials = credentials;
 
 	*ctx = (struct registry_context *)ret;
 
diff --git a/source/lib/registry/registry.h b/source/lib/registry/registry.h
index a86294b..d4c4a89 100644
--- a/source/lib/registry/registry.h
+++ b/source/lib/registry/registry.h
@@ -355,9 +355,7 @@ struct loadparm_context;
  * Open the locally defined registry.
  */
 WERROR reg_open_local(TALLOC_CTX *mem_ctx,
-		      struct registry_context **ctx,
-		      struct auth_session_info *session_info,
-		      struct cli_credentials *credentials);
+		      struct registry_context **ctx);
 
 WERROR reg_open_samba(TALLOC_CTX *mem_ctx,
 		      struct registry_context **ctx,
diff --git a/source/lib/registry/registry.i b/source/lib/registry/registry.i
index 8ab402d..1b3c1c2 100644
--- a/source/lib/registry/registry.i
+++ b/source/lib/registry/registry.i
@@ -57,9 +57,7 @@ const char *str_regtype(int type);
 }
 
 %rename(Registry) reg_open_local;
-WERROR reg_open_local(TALLOC_CTX *parent_ctx, struct registry_context **ctx,
-                      struct auth_session_info *session_info,
-                      struct cli_credentials *credentials);
+WERROR reg_open_local(TALLOC_CTX *parent_ctx, struct registry_context **ctx);
 
 %typemap(in,noblock=1) const char ** {
   /* Check if is a list */
diff --git a/source/lib/registry/registry.py b/source/lib/registry/registry.py
index bf8ac60..9dab309 100644
--- a/source/lib/registry/registry.py
+++ b/source/lib/registry/registry.py
@@ -1,5 +1,5 @@
 # This file was automatically generated by SWIG (http://www.swig.org).
-# Version 1.3.33
+# Version 1.3.35
 #
 # Don't modify this file, modify the SWIG interface instead.
 
diff --git a/source/lib/registry/registry_wrap.c b/source/lib/registry/registry_wrap.c
index da09ecb..4879b2e 100644
--- a/source/lib/registry/registry_wrap.c
+++ b/source/lib/registry/registry_wrap.c
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.33
+ * Version 1.3.35
  * 
  * This file is not intended to be easily readable and contains a number of 
  * coding conventions designed to improve portability and efficiency. Do not make
@@ -126,7 +126,7 @@
 
 /* This should only be incremented when either the layout of swig_type_info changes,
    or for whatever reason, the runtime changes incompatibly */
-#define SWIG_RUNTIME_VERSION "3"
+#define SWIG_RUNTIME_VERSION "4"
 
 /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
 #ifdef SWIG_TYPE_TABLE
@@ -161,6 +161,7 @@
 
 /* Flags for pointer conversions */
 #define SWIG_POINTER_DISOWN        0x1
+#define SWIG_CAST_NEW_MEMORY       0x2
 
 /* Flags for new pointer objects */
 #define SWIG_POINTER_OWN           0x1
@@ -301,10 +302,10 @@ SWIGINTERNINLINE int SWIG_CheckState(int r) {
 extern "C" {
 #endif
 
-typedef void *(*swig_converter_func)(void *);
+typedef void *(*swig_converter_func)(void *, int *);
 typedef struct swig_type_info *(*swig_dycast_func)(void **);
 
-/* Structure to store inforomation on one type */
+/* Structure to store information on one type */
 typedef struct swig_type_info {
   const char             *name;			/* mangled name of this type */
   const char             *str;			/* human readable name of this type */
@@ -431,8 +432,8 @@ SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) {
   Cast a pointer up an inheritance hierarchy
 */
 SWIGRUNTIMEINLINE void *
-SWIG_TypeCast(swig_cast_info *ty, void *ptr) {
-  return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr);
+SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
+  return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
 }
 
 /* 
@@ -856,7 +857,7 @@ SWIG_Python_AddErrorMsg(const char* mesg)
     Py_DECREF(old_str);
     Py_DECREF(value);
   } else {
-    PyErr_Format(PyExc_RuntimeError, mesg);
+    PyErr_SetString(PyExc_RuntimeError, mesg);
   }
 }
 
@@ -1416,7 +1417,7 @@ PySwigObject_dealloc(PyObject *v)
 {
   PySwigObject *sobj = (PySwigObject *) v;
   PyObject *next = sobj->next;
-  if (sobj->own) {
+  if (sobj->own == SWIG_POINTER_OWN) {
     swig_type_info *ty = sobj->ty;
     PySwigClientData *data = ty ? (PySwigClientData *) ty->clientdata : 0;
     PyObject *destroy = data ? data->destroy : 0;
@@ -1434,12 +1435,13 @@ PySwigObject_dealloc(PyObject *v)
 	res = ((*meth)(mself, v));
       }
       Py_XDECREF(res);
-    } else {
-      const char *name = SWIG_TypePrettyName(ty);
+    } 
 #if !defined(SWIG_PYTHON_SILENT_MEMLEAK)
-      printf("swig/python detected a memory leak of type '%s', no destructor found.\n", name);
-#endif
+    else {
+      const char *name = SWIG_TypePrettyName(ty);
+      printf("swig/python detected a memory leak of type '%s', no destructor found.\n", (name ? name : "unknown"));
     }
+#endif
   } 
   Py_XDECREF(next);
   PyObject_DEL(v);
@@ -1944,7 +1946,7 @@ SWIG_Python_GetSwigThis(PyObject *pyobj)
 
 SWIGRUNTIME int
 SWIG_Python_AcquirePtr(PyObject *obj, int own) {
-  if (own) {
+  if (own == SWIG_POINTER_OWN) {
     PySwigObject *sobj = SWIG_Python_GetSwigThis(obj);
     if (sobj) {
       int oldown = sobj->own;
@@ -1965,6 +1967,8 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int
     return SWIG_OK;
   } else {
     PySwigObject *sobj = SWIG_Python_GetSwigThis(obj);
+    if (own)
+      *own = 0;
     while (sobj) {
       void *vptr = sobj->ptr;
       if (ty) {
@@ -1978,7 +1982,15 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int
 	  if (!tc) {
 	    sobj = (PySwigObject *)sobj->next;
 	  } else {
-	    if (ptr) *ptr = SWIG_TypeCast(tc,vptr);
+	    if (ptr) {
+              int newmemory = 0;
+              *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
+              if (newmemory == SWIG_CAST_NEW_MEMORY) {
+                assert(own);
+                if (own)
+                  *own = *own | SWIG_CAST_NEW_MEMORY;
+              }
+            }
 	    break;
 	  }
 	}
@@ -1988,7 +2000,8 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int
       }
     }
     if (sobj) {
-      if (own) *own = sobj->own;
+      if (own)
+        *own = *own | sobj->own;
       if (flags & SWIG_POINTER_DISOWN) {
 	sobj->own = 0;
       }
@@ -2053,8 +2066,13 @@ SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) {
     }
     if (ty) {
       swig_cast_info *tc = SWIG_TypeCheck(desc,ty);
-      if (!tc) return SWIG_ERROR;
-      *ptr = SWIG_TypeCast(tc,vptr);
+      if (tc) {
+        int newmemory = 0;
+        *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
+        assert(!newmemory); /* newmemory handling not yet implemented */
+      } else {
+        return SWIG_ERROR;
+      }
     } else {
       *ptr = vptr;
     }
@@ -2514,7 +2532,7 @@ static swig_module_info swig_module = {swig_types, 25, 0, 0, 0, 0};
 
 #define SWIG_name    "_registry"
 
-#define SWIGVERSION 0x010333 
+#define SWIGVERSION 0x010335 
 #define SWIG_VERSION SWIGVERSION
 
 
@@ -2910,44 +2928,17 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_Registry(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
+SWIGINTERN PyObject *_wrap_Registry(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   TALLOC_CTX *arg1 = (TALLOC_CTX *) 0 ;
   struct registry_context **arg2 = (struct registry_context **) 0 ;
-  struct auth_session_info *arg3 = (struct auth_session_info *) 0 ;
-  struct cli_credentials *arg4 = (struct cli_credentials *) 0 ;
   WERROR result;
   struct registry_context *tmp2 ;
-  void *argp3 = 0 ;
-  int res3 = 0 ;
-  void *argp4 = 0 ;
-  int res4 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  char *  kwnames[] = {
-    (char *) "session_info",(char *) "credentials", NULL 
-  };
   
-  arg3 = NULL;
-  arg4 = NULL;
   arg1 = NULL;
   arg2 = &tmp2;
-  if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"|OO:Registry",kwnames,&obj0,&obj1)) SWIG_fail;
-  if (obj0) {
-    res3 = SWIG_ConvertPtr(obj0, &argp3,SWIGTYPE_p_auth_session_info, 0 |  0 );
-    if (!SWIG_IsOK(res3)) {
-      SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Registry" "', argument " "3"" of type '" "struct auth_session_info *""'"); 
-    }
-    arg3 = (struct auth_session_info *)(argp3);
-  }
-  if (obj1) {
-    res4 = SWIG_ConvertPtr(obj1, &argp4,SWIGTYPE_p_cli_credentials, 0 |  0 );
-    if (!SWIG_IsOK(res4)) {
-      SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Registry" "', argument " "4"" of type '" "struct cli_credentials *""'"); 
-    }
-    arg4 = (struct cli_credentials *)(argp4);
-  }
-  result = reg_open_local(arg1,arg2,arg3,arg4);
+  if (!SWIG_Python_UnpackTuple(args,"Registry",0,0,0)) SWIG_fail;
+  result = reg_open_local(arg1,arg2);
   if (!W_ERROR_IS_OK(result)) {
     PyObject *obj = Py_BuildValue((char *)"(i,s)", W_ERROR_V(result), win_errstr(result));
     PyErr_SetObject(PyExc_RuntimeError, obj);
@@ -3410,7 +3401,10 @@ check_1:
   }
   
 fail:
-  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'reg_mount_hive'.\n  Possible C/C++ prototypes are:\n""    mount_hive(reg *,struct hive_key *,uint32_t,char const **)\n""    mount_hive(reg *,struct hive_key *,char const *)\n");
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'reg_mount_hive'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    mount_hive(reg *,struct hive_key *,uint32_t,char const **)\n"
+    "    mount_hive(reg *,struct hive_key *,char const *)\n");
   return NULL;
 }
 
@@ -3420,7 +3414,7 @@ SWIGINTERN PyObject *_wrap_new_reg(PyObject *SWIGUNUSEDPARM(self), PyObject *arg
   reg *result = 0 ;
   
   if (!SWIG_Python_UnpackTuple(args,"new_reg",0,0,0)) SWIG_fail;
-  result = (reg *)(reg *) calloc(1, sizeof(reg));
+  result = (reg *)calloc(1, sizeof(reg));
   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_registry_context, SWIG_POINTER_NEW |  0 );
   return resultobj;
 fail:
@@ -3765,7 +3759,7 @@ fail:
 static PyMethodDef SwigMethods[] = {
 	 { (char *)"reg_get_predef_name", (PyCFunction) _wrap_reg_get_predef_name, METH_VARARGS | METH_KEYWORDS, NULL},
 	 { (char *)"str_regtype", (PyCFunction) _wrap_str_regtype, METH_VARARGS | METH_KEYWORDS, NULL},
-	 { (char *)"Registry", (PyCFunction) _wrap_Registry, METH_VARARGS | METH_KEYWORDS, NULL},
+	 { (char *)"Registry", (PyCFunction)_wrap_Registry, METH_NOARGS, NULL},
 	 { (char *)"reg_get_predefined_key_by_name", (PyCFunction) _wrap_reg_get_predefined_key_by_name, METH_VARARGS | METH_KEYWORDS, NULL},
 	 { (char *)"reg_key_del_abs", (PyCFunction) _wrap_reg_key_del_abs, METH_VARARGS | METH_KEYWORDS, NULL},
 	 { (char *)"reg_get_predefined_key", (PyCFunction) _wrap_reg_get_predefined_key, METH_VARARGS | METH_KEYWORDS, NULL},
@@ -3962,7 +3956,7 @@ SWIGRUNTIME void
 SWIG_InitializeModule(void *clientdata) {
   size_t i;
   swig_module_info *module_head, *iter;
-  int found;
+  int found, init;
   
   clientdata = clientdata;
   
@@ -3972,6 +3966,9 @@ SWIG_InitializeModule(void *clientdata) {
     swig_module.type_initial = swig_type_initial;
     swig_module.cast_initial = swig_cast_initial;
     swig_module.next = &swig_module;
+    init = 1;
+  } else {
+    init = 0;
   }
   
   /* Try and load any already created modules */
@@ -4000,6 +3997,12 @@ SWIG_InitializeModule(void *clientdata) {
     module_head->next = &swig_module;
   }
   
+  /* When multiple interpeters are used, a module could have already been initialized in
+       a different interpreter, but not yet have a pointer in this interpreter.
+       In this case, we do not want to continue adding types... everything should be
+       set up already */
+  if (init == 0) return;
+  
   /* Now work on filling in swig_module.types */
 #ifdef SWIGRUNTIME_DEBUG
   printf("SWIG_InitializeModule: size %d\n", swig_module.size);
diff --git a/source/lib/registry/samba.c b/source/lib/registry/samba.c
index 599385e..59693dd 100644
--- a/source/lib/registry/samba.c
+++ b/source/lib/registry/samba.c
@@ -61,7 +61,7 @@ _PUBLIC_ WERROR reg_open_samba(TALLOC_CTX *mem_ctx,
 {
 	WERROR result;
 
-	result = reg_open_local(mem_ctx, ctx, session_info, credentials);
+	result = reg_open_local(mem_ctx, ctx);
 	if (!W_ERROR_IS_OK(result)) {
 		return result;
 	}
diff --git a/source/lib/registry/tests/registry.c b/source/lib/registry/tests/registry.c
index b19a6ab..33512a0 100644
--- a/source/lib/registry/tests/registry.c
+++ b/source/lib/registry/tests/registry.c
@@ -517,7 +517,7 @@ static bool setup_local_registry(struct torture_context *tctx, void **data)
 	struct hive_key *hive_key;
 	const char *filename;
 
-	error = reg_open_local(tctx, &rctx, NULL, NULL);
+	error = reg_open_local(tctx, &rctx);
 	torture_assert_werr_ok(tctx, error, "Opening local registry failed");
 
 	status = torture_temp_dir(tctx, "registry-local", &tempdir);
diff --git a/source/lib/registry/tools/common.c b/source/lib/registry/tools/common.c
index cec0f8b..52f3c6f 100644
--- a/source/lib/registry/tools/common.c
+++ b/source/lib/registry/tools/common.c
@@ -57,7 +57,7 @@ struct registry_key *reg_common_open_file(const char *path,
 		return NULL;
 	}
 
-	error = reg_open_local(NULL, &h, NULL, creds);
+	error = reg_open_local(NULL, &h);
 	if (!W_ERROR_IS_OK(error)) {
 		fprintf(stderr, "Unable to initialize local registry: %s\n",
 			win_errstr(error));
diff --git a/source/lib/registry/tools/regdiff.c b/source/lib/registry/tools/regdiff.c
index c94380e..69fcfc2 100644
--- a/source/lib/registry/tools/regdiff.c
+++ b/source/lib/registry/tools/regdiff.c
@@ -48,7 +48,7 @@ static struct registry_context *open_backend(poptContext pc,
 					remote_host, NULL);
 		break;
 	case REG_NULL:
-		error = reg_open_local(NULL, &ctx, NULL, cmdline_credentials);
+		error = reg_open_local(NULL, &ctx);
 		break;
 	}
 
diff --git a/source/selftest/README b/source/selftest/README
index e8e87c8..f8be20a 100644
--- a/source/selftest/README
+++ b/source/selftest/README
@@ -3,15 +3,70 @@
 This directory contains test scripts that are useful for running a
 bunch of tests all at once. 
 
-===============
-Available tests
-===============
-The available tests are obtained from a script, usually 
-selftest/samba{3,4}_tests.sh. This script should for each test output 
+Available testsuites
+====================
+The available testsuites are obtained from a script, usually 
+selftest/samba{3,4}_tests.sh. This script should for each testsuite output 
 the name of the test, the command to run and the environment that should be 
-provided.
+provided. Use the included "plantest" function to generate the required output.
+
+Testsuite behaviour
+================================
+
+Exit code
+------------
+The testsuites should exit with a non-zero exit code if at least one 
+test failed. Skipped tests should not influence the exit code.
+
+Output format
+-------------
+Testsuites can simply use the exit code to indicate whether all of their 
+tests have succeeded or one or more have failed. It is also possible to 
+provide more granular information using the Subunit protocol. 
+
+This protocol works by writing simple messages to standard output. Any 
+messages that can not be interpreted by this protocol are considered comments 
+for the last announced test.
+
+Accepted commands are:
+
+test
+~~~~~~~~~~~~
+test: <NAME>
+
+Announce that a new test with the specified name is starting
+
+success
+~~~~~~~~~~~~~~~
+success: <NAME> 
+
+Announce that the test with the specified name is done and ran successfully.
+
+failure
+~~~~~~~~~~~~~~~
+failure: <NAME> 
+failure: <NAME> [ REASON ]
+
+Announce that the test with the specified name failed. Optionally, it is 
+possible to specify a reason it failed.
+
+skip
+~~~~~~~~~~~~
+skip: <NAME>
+skip: <NAME> [ REASON ]
+
+Announce that the test with the specified name was skipped. Optionally a 
+reason can be specified.
+
+knownfail
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+knownfail: <NAME>
+knownfail: <NAME> [ REASON ]
+
+Announce that the test with the specified name was run and failed as expected.
+Alternatively it is also possible to simply return "failure:" here but 
+specify in the samba4-knownfailures file that it is failing.
 
-============
 Environments
 ============
 Tests often need to run against a server with particular things set up, 
@@ -23,6 +78,7 @@ The following environments are currently available:
  - none: No server set up, no variables set.
  - dc: Domain controller set up. The following environment variables will 
    be set:
+
      * USERNAME: Administrator user name
 	 * PASSWORD: Administrator password
 	 * DOMAIN: Domain name
@@ -34,6 +90,7 @@ The following environments are currently available:
 
  - member: Domain controller and member server that is joined to it set up. The
    following environment variables will be set:
+
      * USERNAME: Domain administrator user name
 	 * PASSWORD: Domain administrator password
 	 * DOMAIN: Domain name
@@ -41,22 +98,22 @@ The following environments are currently available:
 	 * SERVER: Name of the member server
 
 
-=============
 Running tests


-- 
Samba Shared Repository


More information about the samba-cvs mailing list