Rev 11295: Merge upstream in file:///home/jelmer/bzr.samba/4.0-perlselftest/

Jelmer Vernooij jelmer at samba.org
Thu Jan 25 12:44:14 GMT 2007


------------------------------------------------------------
revno: 11295
revision-id: jelmer at samba.org-20070125124321-ugthx6mbo2sbvm60
parent: jelmer at samba.org-20070125123559-fz1orjr1s14txh91
parent: jelmer at samba.org-20070125123431-g3pqm92r31ez9xyc
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 4.0-perlselftest
timestamp: Thu 2007-01-25 13:43:21 +0100
message:
  Merge upstream
added:
  testprogs/blackbox/test_ldb.sh test_ldb.sh-20070125123323-4fdjpq40elzgl034-1
modified:
  source/script/tests/test_ldap.sh svn-v2:6549 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0-source%2fscript%2ftests%2ftest_ldap.sh
  source/script/tests/test_local.sh svn-v2:7434 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0-source%2fscript%2ftests%2ftest_local.sh
  source/script/tests/tests_all.sh svn-v2:8525 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0-source%2fscript%2ftests%2ftests_all.sh
  testprogs/blackbox/test_cifsdd.sh svn-v2:20747 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0-testprogs%2fblackbox%2ftest_cifsdd.sh
  testprogs/ejs/minschema.js     svn-v2:10990 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0-testprogs%2fejs%2fminschema.js
  webapps/install/provision.esp  svn-v2:20517 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0-webapps%2finstall%2fprovision.esp
  webapps/install/vampire.esp    svn-v2:20517 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0-webapps%2finstall%2fvampire.esp
    ------------------------------------------------------------
    revno: 11286.1.5.1.28
    merged: jelmer at samba.org-20070125123431-g3pqm92r31ez9xyc
    parent: svn-v2:21008 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0
    committer: Jelmer Vernooij <jelmer at samba.org>
    branch nick: SAMBA_4_0
    timestamp: Thu 2007-01-25 13:34:31 +0100
    message:
      Actually run tests during test phase rather than when generating the recipe.
    ------------------------------------------------------------
    revno: 11286.1.5.1.27
    merged: svn-v2:21008 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0
    parent: svn-v2:21000 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0
    committer: abartlet
    timestamp: Wed 2007-01-24 22:56:17 +0000
    message:
      We added a new argument to the provision() function, but I forgot to
      update SWAT.
      
      Andrew Bartlett
    ------------------------------------------------------------
    revno: 11286.1.5.1.26
    merged: svn-v2:21000 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0
    parent: svn-v2:20999 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0
    committer: metze
    timestamp: Wed 2007-01-24 12:46:26 +0000
    message:
      add some options to control what ldif is dumped
      
      default is dump everything
      
      metze
    ------------------------------------------------------------
    revno: 11286.1.5.1.25
    merged: svn-v2:20999 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0
    parent: svn-v2:20997 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0
    committer: metze
    timestamp: Wed 2007-01-24 12:23:42 +0000
    message:
      - update the list of attributes for classSchema and atttributeSchema objects
      - use ${SCHEMADN} instead of CN=Schema,CN=Configuration,${BASEDN}
      - do not include autogenerated values: instanceType, cn and name in the ldif output
      - take care of the systemOnly attribute and a resulting NO-USER-MODIFICATION
      
      metze
=== added file 'testprogs/blackbox/test_ldb.sh'
--- a/testprogs/blackbox/test_ldb.sh	1970-01-01 00:00:00 +0000
+++ b/testprogs/blackbox/test_ldb.sh	2007-01-25 12:34:31 +0000
@@ -0,0 +1,76 @@
+#!/bin/sh
+
+p=$1
+shift 1
+options="$*"
+
+check() {
+	name="$1"
+	shift
+	cmdline="$*"
+	echo "test: $name"
+	$cmdline
+	status=$?
+	if [ x$status = x0 ]; then
+		echo "success: $name"
+	else
+		echo "failure: $name"
+		failed=`expr $failed + 1`
+	fi
+	return $status
+}
+
+
+
+check "RootDSE" bin/ldbsearch $CONFIGURATION $options --basedn='' -H $p://$SERVER -s base DUMMY=x dnsHostName highestCommittedUSN || failed=`expr $failed + 1`
+
+echo "Getting defaultNamingContext"
+BASEDN=`bin/ldbsearch $CONFIGURATION $options --basedn='' -H $p://$SERVER -s base DUMMY=x defaultNamingContext | grep defaultNamingContext | awk '{print $2}'`
+echo "BASEDN is $BASEDN"
+
+check "Listing Users" bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER '(objectclass=user)' sAMAccountName || failed=`expr $failed + 1`
+
+check "Listing Groups" bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER '(objectclass=group)' sAMAccountName || failed=`expr $failed + 1`
+
+nentries=`bin/ldbsearch $options -H $p://$SERVER $CONFIGURATION '(|(|(&(!(groupType:1.2.840.113556.1.4.803:=1))(groupType:1.2.840.113556.1.4.803:=2147483648)(groupType:1.2.840.113556.1.4.804:=10))(samAccountType=805306368))(samAccountType=805306369))' sAMAccountName | grep sAMAccountName | wc -l`
+echo "Found $nentries entries"
+if [ $nentries -lt 10 ]; then
+echo "Should have found at least 10 entries"
+failed=`expr $failed + 1`
+fi
+
+echo "Check rootDSE for Controls"
+nentries=`bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER -s base -b "" '(objectclass=*)' | grep -i supportedControl | wc -l`
+if [ $nentries -lt 4 ]; then
+echo "Should have found at least 4 entries"
+failed=`expr $failed + 1`
+fi
+
+echo "Test Paged Results Control"
+nentries=`bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER --controls=paged_results:1:5 '(objectclass=user)' | grep sAMAccountName | wc -l`
+if [ $nentries -lt 1 ]; then
+echo "Paged Results Control test returned 0 items"
+failed=`expr $failed + 1`
+fi
+
+echo "Test Server Sort Control"
+nentries=`bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER --controls=server_sort:1:0:sAMAccountName '(objectclass=user)' | grep sAMAccountName | wc -l`
+if [ $nentries -lt 1 ]; then
+echo "Server Sort Control test returned 0 items"
+failed=`expr $failed + 1`
+fi
+
+echo "Test Extended DN Control"
+nentries=`bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER --controls=extended_dn:1:0 '(objectclass=user)' | grep sAMAccountName | wc -l`
+if [ $nentries -lt 1 ]; then
+echo "Extended DN Control test returned 0 items"
+failed=`expr $failed + 1`
+fi
+
+echo "Test Attribute Scope Query Control"
+nentries=`bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER --controls=asq:1:member -s base -b "CN=Administrators,CN=Builtin,$BASEDN" | grep sAMAccountName | wc -l`
+if [ $nentries -lt 1 ]; then
+echo "Attribute Scope Query test returned 0 items"
+failed=`expr $failed + 1`
+fi
+exit $failed

=== modified file 'source/script/tests/test_ldap.sh'
--- a/source/script/tests/test_ldap.sh	2007-01-22 22:55:34 +0000
+++ b/source/script/tests/test_ldap.sh	2007-01-25 12:43:21 +0000
@@ -23,62 +23,10 @@
 incdir=`dirname $0`
 . $incdir/test_functions.sh
 
+
 for p in $PROTOCOLS; do
  for options in "" "--option=socket:testnonblock=true" "-U$USERNAME%$PASSWORD --option=socket:testnonblock=true" "-U$USERNAME%$PASSWORD"; do
-    echo "TESTING PROTOCOL $p with options $options"
-
-    testit "RootDSE" bin/ldbsearch $CONFIGURATION $options --basedn='' -H $p://$SERVER -s base DUMMY=x dnsHostName highestCommittedUSN || failed=`expr $failed + 1`
-
-    echo "Getting defaultNamingContext"
-    BASEDN=`bin/ldbsearch $CONFIGURATION $options --basedn='' -H $p://$SERVER -s base DUMMY=x defaultNamingContext | grep defaultNamingContext | awk '{print $2}'`
-    echo "BASEDN is $BASEDN"
-
-    testit "Listing Users" bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER '(objectclass=user)' sAMAccountName || failed=`expr $failed + 1`
-
-    testit "Listing Groups" bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER '(objectclass=group)' sAMAccountName || failed=`expr $failed + 1`
-
-    nentries=`bin/ldbsearch $options -H $p://$SERVER $CONFIGURATION '(|(|(&(!(groupType:1.2.840.113556.1.4.803:=1))(groupType:1.2.840.113556.1.4.803:=2147483648)(groupType:1.2.840.113556.1.4.804:=10))(samAccountType=805306368))(samAccountType=805306369))' sAMAccountName | grep sAMAccountName | wc -l`
-    echo "Found $nentries entries"
-    if [ $nentries -lt 10 ]; then
-	echo "Should have found at least 10 entries"
-	failed=`expr $failed + 1`
-    fi
-
-    echo "Check rootDSE for Controls"
-    nentries=`bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER -s base -b "" '(objectclass=*)' | grep -i supportedControl | wc -l`
-    if [ $nentries -lt 4 ]; then
-	echo "Should have found at least 4 entries"
-	failed=`expr $failed + 1`
-    fi
-
-    echo "Test Paged Results Control"
-    nentries=`bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER --controls=paged_results:1:5 '(objectclass=user)' | grep sAMAccountName | wc -l`
-    if [ $nentries -lt 1 ]; then
-	echo "Paged Results Control test returned 0 items"
-	failed=`expr $failed + 1`
-    fi
-
-    echo "Test Server Sort Control"
-    nentries=`bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER --controls=server_sort:1:0:sAMAccountName '(objectclass=user)' | grep sAMAccountName | wc -l`
-    if [ $nentries -lt 1 ]; then
-	echo "Server Sort Control test returned 0 items"
-	failed=`expr $failed + 1`
-    fi
-
-    echo "Test Extended DN Control"
-    nentries=`bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER --controls=extended_dn:1:0 '(objectclass=user)' | grep sAMAccountName | wc -l`
-    if [ $nentries -lt 1 ]; then
-	echo "Extended DN Control test returned 0 items"
-	failed=`expr $failed + 1`
-    fi
-
-    echo "Test Attribute Scope Query Control"
-    nentries=`bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER --controls=asq:1:member -s base -b "CN=Administrators,CN=Builtin,$BASEDN" | grep sAMAccountName | wc -l`
-   if [ $nentries -lt 1 ]; then
-	echo "Attribute Scope Query test returned 0 items"
-	failed=`expr $failed + 1`
-   fi
-
+	 testit "TESTING PROTOCOL $p with options $options" ../testprogs/blackbox/test_ldb.sh $p $options
  done
 done
 

=== modified file 'source/script/tests/test_local.sh'
--- a/source/script/tests/test_local.sh	2007-01-23 01:29:17 +0000
+++ b/source/script/tests/test_local.sh	2007-01-25 12:34:31 +0000
@@ -26,7 +26,7 @@
 incdir=`dirname $0`
 . $incdir/test_functions.sh
 
-# the local tests doesn't need smbd
+# the local tests don't need smbd
 SMBD_TEST_FIFO=""
 export SMBD_TEST_FIFO
 

=== modified file 'source/script/tests/tests_all.sh'
--- a/source/script/tests/tests_all.sh	2007-01-23 10:08:08 +0000
+++ b/source/script/tests/tests_all.sh	2007-01-25 12:34:31 +0000
@@ -1,5 +1,4 @@
 #!/bin/sh
- $SRCDIR/script/tests/test_pidl.sh
  $SRCDIR/script/tests/test_ejs.sh $DOMAIN $USERNAME $PASSWORD
  $SRCDIR/script/tests/test_ldap.sh $SERVER $USERNAME $PASSWORD
  $SRCDIR/script/tests/test_nbt.sh $SERVER
@@ -11,5 +10,6 @@
  $SRCDIR/script/tests/test_echo.sh $SERVER $USERNAME $PASSWORD $DOMAIN
  $SRCDIR/script/tests/test_posix.sh //$SERVER/tmp $USERNAME $PASSWORD ""
  $SRCDIR/script/tests/test_local.sh
+ $SRCDIR/script/tests/test_pidl.sh
  $SRCDIR/script/tests/test_blackbox.sh $SERVER $USERNAME $PASSWORD $DOMAIN $PREFIX
  $SRCDIR/script/tests/test_simple.sh //$SERVER/simple $USERNAME $PASSWORD ""

=== modified file 'testprogs/blackbox/test_cifsdd.sh'
--- a/testprogs/blackbox/test_cifsdd.sh	2007-01-14 01:39:34 +0000
+++ b/testprogs/blackbox/test_cifsdd.sh	2007-01-25 12:34:31 +0000
@@ -37,8 +37,6 @@
 	return $status
 }
 
-
-
 runcopy() {
 	message="$1"
 	shift
@@ -48,7 +46,7 @@
 }
 
 compare() {
-    tesit "$1" cmp "$2" "$3"
+    testit "$1" cmp "$2" "$3"
 }
 
 sourcepath=tempfile.src.$$

=== modified file 'testprogs/ejs/minschema.js'
--- a/testprogs/ejs/minschema.js	2006-08-26 15:38:01 +0000
+++ b/testprogs/ejs/minschema.js	2007-01-24 12:46:26 +0000
@@ -12,12 +12,41 @@
 			 "POPT_AUTOHELP",
 			 "POPT_COMMON_SAMBA",
 			 "POPT_COMMON_CREDENTIALS",
-			 "verbose");
+			 "verbose",
+			 "classes",
+			 "attributes",
+			 "subschema",
+			 "subschema-auto");
 if (options == undefined) {
    println("Failed to parse options");
    return -1;
 }
 verbose = options["verbose"];
+dump_all = "yes";
+dump_classes = options["classes"];
+dump_attributes = options["attributes"];
+dump_subschema = options["subschema"];
+dump_subschema_auto = options["subschema-auto"];
+
+if (dump_classes != undefined) {
+	dump_all = undefined;
+}
+if (dump_attributes != undefined) {
+	dump_all = undefined;
+}
+if (dump_subschema != undefined) {
+	dump_all = undefined;
+}
+if (dump_subschema_auto != undefined) {
+	dump_all = undefined;
+	dump_subschema = "yes";
+}
+if (dump_all != undefined) {
+	dump_classes = "yes";
+	dump_attributes = "yes";
+	dump_subschema = "yes";
+	dump_subschema_auto = "yes";
+}
 
 if (options.ARGV.length != 2) {
    println("Usage: minschema.js <URL> <classfile>");
@@ -40,22 +69,69 @@
 objectclasses_expanded = new Object();
 
 /* the attributes we need for objectclasses */
-class_attrs = new Array("objectClass", 
-			"auxiliaryClass", "systemAuxiliaryClass",
-			"possSuperiors", "systemPossSuperiors",
-			"lDAPDisplayName", "governsID",
-			"rDNAttID", "mustContain", "systemMustContain",
-			"mayContain", "systemMayContain",
-			"objectClassCategory", "subClassOf", 
-			"defaultObjectCategory", "defaultHidingValue", 
-			"systemFlags", "systemOnly", "defaultSecurityDescriptor",
-			"objectCategory", "possibleInferiors", "displaySpecification",
-			"schemaIDGUID");
-
-attrib_attrs = new Array("objectClass", "lDAPDisplayName", 
-			 "isSingleValued", "linkID", "systemFlags", "systemOnly",
-			 "schemaIDGUID", "adminDisplayName", "attributeID",
-			 "attributeSyntax", "oMSyntax", "oMObjectClass");
+class_attrs = new Array("objectClass",
+			"subClassOf",
+			"governsID",
+			"possSuperiors",
+			"mayContain",
+			"mustContain",
+			"auxiliaryClass",
+			"rDNAttID",
+			"showInAdvancedViewOnly",
+			"adminDisplayName",
+			"adminDescription",
+			"objectClassCategory",
+			"lDAPDisplayName",
+			"schemaIDGUID",
+			"systemOnly",
+			"systemPossSuperiors",
+			"systemMayContain",
+			"systemMustContain",
+			"systemAuxiliaryClass",
+			"defaultSecurityDescriptor",
+			"systemFlags",
+			"defaultHidingValue",
+			"objectCategory",
+			"defaultObjectCategory",
+
+			/* this attributes are not used by w2k3 */
+			"schemaFlagsEx",
+			"msDs-IntId",
+			"msDs-Schema-Extensions",
+			"classDisplayName",
+			"isDefunct");
+
+
+attrib_attrs = new Array("objectClass",
+			 "attributeID",
+			 "attributeSyntax",
+			 "isSingleValued",
+			 "rangeLower",
+			 "rangeUpper",
+			 "mAPIID",
+			 "linkID",
+			 "showInAdvancedViewOnly",
+			 "adminDisplayName",
+			 "oMObjectClass",
+			 "adminDescription",
+			 "oMSyntax",
+			 "searchFlags",
+			 "extendedCharsAllowed",
+			 "lDAPDisplayName",
+			 "schemaIDGUID",
+			 "attributeSecurityGUID",
+			 "systemOnly",
+			 "systemFlags",
+			 "isMemberOfPartialAttributeSet",
+			 "objectCategory",
+
+			 /* this attributes are not used by w2k3 */
+			 "schemaFlagsEx",
+			 "msDs-IntId",
+			 "msDs-Schema-Extensions",
+			 "classDisplayName",
+			 "isEphemeral",
+			 "isDefunct");
 
 /*
   notes:
@@ -144,14 +220,14 @@
 
 
 /*
-  fix a string DN to use ${BASEDN}
+  fix a string DN to use ${SCHEMADN}
 */
 function fix_dn(dn) {
-	var s = strstr(dn, rootDse.defaultNamingContext);
+	var s = strstr(dn, rootDse.schemaNamingContext);
 	if (s == NULL) {
 		return dn;
 	}
-	return substr(dn, 0, strlen(dn) - strlen(s)) + "${BASEDN}";
+	return substr(dn, 0, strlen(dn) - strlen(s)) + "${SCHEMADN}";
 }
 
 /*
@@ -159,9 +235,7 @@
 */
 function write_ldif_one(o, attrs) {
 	var i;
-	printf("dn: CN=%s,CN=Schema,CN=Configuration,${BASEDN}\n", o.cn);
-	printf("cn: %s\n", o.cn);
-	printf("name: %s\n", o.cn);
+	printf("dn: CN=%s,${SCHEMADN}\n", o.cn);
 	for (i=0;i<attrs.length;i++) {
 		var a = attrs[i];
 		if (o[a] == undefined) {
@@ -616,6 +690,10 @@
 	if (attrib['isSingleValued'] == "TRUE") {
 		printf("SINGLE-VALUE ");
 	}
+	if (attrib['systemOnly'] == "TRUE") {
+		printf("NO-USER-MODIFICATION ");
+	}
+
 	printf(")\n");
 }
 
@@ -624,14 +702,15 @@
   write the aggregate record
 */
 function write_aggregate() {
-	printf("dn: CN=Aggregate,CN=Schema,CN=Configuration,${BASEDN}\n");
+	printf("dn: CN=Aggregate,${SCHEMADN}\n");
 	print("objectClass: top
 objectClass: subSchema
-cn: Aggregate
-instanceType: 4
-name: Aggregate
-objectCategory: CN=SubSchema,CN=Schema,CN=Configuration,${BASEDN}
+objectCategory: CN=SubSchema,${SCHEMADN}
 ");
+	if (dump_subschema_auto == undefined) {
+		return;	
+	}
+
 	for (i in objectclasses) {
 		write_aggregate_objectclass(objectclasses[i]);
 	}
@@ -679,7 +758,7 @@
 	num_classes++;
 }
 /* so EJS do not have while nor the break statement
-   can't find any other way than doing more loops
+   cannot find any other way than doing more loops
    than necessary to recursively expand all classes
  */
 var inf;
@@ -730,10 +809,15 @@
 /*
   dump an ldif form of the attributes and objectclasses
 */
-write_ldif(attributes, attrib_attrs);
-write_ldif(objectclasses, class_attrs);
-
-write_aggregate();
+if (dump_attributes != undefined) {
+	write_ldif(attributes, attrib_attrs);
+}
+if (dump_classes != undefined) {
+	write_ldif(objectclasses, class_attrs);
+}
+if (dump_subschema != undefined) {
+	write_aggregate();
+}
 
 if (verbose == undefined) {
 	exit(0);

=== modified file 'webapps/install/provision.esp'
--- a/webapps/install/provision.esp	2007-01-03 20:17:37 +0000
+++ b/webapps/install/provision.esp	2007-01-24 22:56:17 +0000
@@ -61,7 +61,7 @@
 	} else {
 		var paths = provision_default_paths(subobj);
 		if (!provision(subobj, writefln, false, paths, 
-			       session.authinfo.session_info, session.authinfo.credentials)) {
+			       session.authinfo.session_info, session.authinfo.credentials, false)) {
 			writefln("Provision failed!");
 		} else if (!provision_dns(subobj, writefln, paths,
 					  session.authinfo.session_info, session.authinfo.credentials)) {

=== modified file 'webapps/install/vampire.esp'
--- a/webapps/install/vampire.esp	2007-01-11 23:09:57 +0000
+++ b/webapps/install/vampire.esp	2007-01-24 22:56:17 +0000
@@ -76,7 +76,7 @@
 
 		/* Setup a basic database structure, but don't setup any users */
 		if (!provision(subobj, writefln, true, paths,
-			       session_info, credentials)) {
+			       session_info, credentials, false)) {
 			writefln("Provision failed!");
 
 		/* Join domain */



More information about the samba-cvs mailing list