svn commit: samba r9814 - in branches/SOC/SAMBA_4_0: . source/lib/ldb/tests source/script/tests source/scripting/ejs testdata/samba3 testprogs/ejs

metze at samba.org metze at samba.org
Tue Aug 30 23:41:38 GMT 2005


Author: metze
Date: 2005-08-30 23:41:37 +0000 (Tue, 30 Aug 2005)
New Revision: 9814

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=9814

Log:
 r11663 at SERNOX (orig r9813):  jelmer | 2005-08-31 00:38:34 +0200
 Conver testsuite for samba3sam module to EJS
 

Added:
   branches/SOC/SAMBA_4_0/testdata/samba3/smbpasswd
   branches/SOC/SAMBA_4_0/testprogs/ejs/samba3sam
Removed:
   branches/SOC/SAMBA_4_0/source/lib/ldb/tests/test-samba3sam.sh
Modified:
   branches/SOC/SAMBA_4_0/
   branches/SOC/SAMBA_4_0/source/script/tests/selftest.sh
   branches/SOC/SAMBA_4_0/source/scripting/ejs/smbcalls_sys.c


Changeset:

Property changes on: branches/SOC/SAMBA_4_0
___________________________________________________________________
Name: svk:merge
   - 0c0555d6-39d7-0310-84fc-f1cc0bd64818:/branches/SAMBA_4_0:9808
a953eb74-4aff-0310-a63c-855d20285ebb:/local/samba4:11627
d349723c-e9fc-0310-b8a8-fdedf1c27407:/local/SAMBA_4_0:5616
d349723c-e9fc-0310-b8a8-fdedf1c27407:/local/samba-SAMBA_4_0:5609
   + 0c0555d6-39d7-0310-84fc-f1cc0bd64818:/branches/SAMBA_4_0:9813
a953eb74-4aff-0310-a63c-855d20285ebb:/local/samba4:11627
d349723c-e9fc-0310-b8a8-fdedf1c27407:/local/SAMBA_4_0:5616
d349723c-e9fc-0310-b8a8-fdedf1c27407:/local/samba-SAMBA_4_0:5609

Deleted: branches/SOC/SAMBA_4_0/source/lib/ldb/tests/test-samba3sam.sh
===================================================================
--- branches/SOC/SAMBA_4_0/source/lib/ldb/tests/test-samba3sam.sh	2005-08-30 22:38:34 UTC (rev 9813)
+++ branches/SOC/SAMBA_4_0/source/lib/ldb/tests/test-samba3sam.sh	2005-08-30 23:41:37 UTC (rev 9814)
@@ -1,61 +0,0 @@
-#!/bin/sh
-
-S3URL=$1
-
-if [ -z "$S3URL" ];
-then
-	rm -f samba3.ldb
-	S3URL="tdb://samba3.ldb"
-	echo "Adding samba3 LDIF..."
-	$VALGRIND ldbadd -H tdb://samba3.ldb < samba3.ldif || exit 1
-fi
-
-rm -f samba4.ldb
-
-echo "Initial samba4 LDIF..."
-$VALGRIND ldbadd -H tdb://samba4.ldb <<EOF
-dn: @MODULES
- at LIST: samba3sam
-
-dn: @MAP=samba3sam
- at MAP_URL: $S3URL
-
-EOF
-
-LOC="-H tdb://samba4.ldb"
-
-echo "Looking up by non-mapped attribute"
-$VALGRIND ldbsearch $LOC "(cn=Administrator)" || exit 1
-
-echo "Looking up by mapped attribute"
-$VALGRIND ldbsearch $LOC "(name=Backup Operators)" || exit 1
-
-echo "Looking up by old name of renamed attribute"
-$VALGRIND ldbsearch $LOC "(displayName=Backup Operators)" || exit 1
-
-echo "Adding a record"
-$VALGRIND ldbadd $LOC <<EOF
-dn: cn=Foo,dc=idealx,dc=org
-unixName: root
-lastLogon: 20000
-cn: Foo
-showInAdvancedViewOnly: TRUE
-
-EOF
-
-echo "Checking for existance of record"
-$VALGRIND ldbsearch $LOC "(cn=Foo)" unixName lastLogon cn showInAdvancedViewOnly || exit 1
-
-echo "Checking for persistence of non-mappable attribute"
-$VALGRIND ldbsearch $LOC "(cn=Foo)" showInAdvancedViewOnly | grep showInAdvancedViewOnly || exit 1
-
-echo "Adding record with mapped attribute in dn"
-$VALGRIND ldbadd $LOC <<EOF
-dn: unixName=nobody,dc=idealx,dc=org
-unixName: nobody 
-cn: Niemand
-
-EOF
-
-echo "Checking for existance of record (mapped)"
-$VALGRIND ldbsearch $LOC "(unixName=nobody)" unixName cn dn || exit 1

Modified: branches/SOC/SAMBA_4_0/source/script/tests/selftest.sh
===================================================================
--- branches/SOC/SAMBA_4_0/source/script/tests/selftest.sh	2005-08-30 22:38:34 UTC (rev 9813)
+++ branches/SOC/SAMBA_4_0/source/script/tests/selftest.sh	2005-08-30 23:41:37 UTC (rev 9814)
@@ -88,7 +88,7 @@
 	ncalrpc dir = $NCALRPCDIR
 	lock dir = $LOCKDIR
 	setup directory = $SRCDIR/setup
-        js include = $SRCDIR/scripting/libjs
+	js include = $SRCDIR/scripting/libjs
 	name resolve order = bcast
 	interfaces = lo*
 	tls enabled = $TLS_ENABLED
@@ -107,10 +107,10 @@
 [cifs]
 	read only = no
 	ntvfs handler = cifs
-        cifs:server = localhost
-        cifs:user = $USERNAME
-        cifs:password = $PASSWORD
-        cifs:domain = $DOMAIN
+	cifs:server = localhost
+	cifs:user = $USERNAME
+	cifs:password = $PASSWORD
+	cifs:domain = $DOMAIN
 	cifs:share = tmp
 EOF
 

Modified: branches/SOC/SAMBA_4_0/source/scripting/ejs/smbcalls_sys.c
===================================================================
--- branches/SOC/SAMBA_4_0/source/scripting/ejs/smbcalls_sys.c	2005-08-30 22:38:34 UTC (rev 9813)
+++ branches/SOC/SAMBA_4_0/source/scripting/ejs/smbcalls_sys.c	2005-08-30 23:41:37 UTC (rev 9814)
@@ -137,7 +137,7 @@
 
 /*
   unlink a file
-   ok = unlink(fname);
+   ok = sys.unlink(fname);
 */
 static int ejs_sys_unlink(MprVarHandle eid, int argc, char **argv)
 {
@@ -154,7 +154,7 @@
 /*
   load a file as a string
   usage:
-     string = sys_file_load(filename);
+     string = sys.file_load(filename);
 */
 static int ejs_sys_file_load(MprVarHandle eid, int argc, char **argv)
 {
@@ -173,7 +173,7 @@
 /*
   save a file from a string
   usage:
-     ok = sys_file_save(filename, str);
+     ok = sys.file_save(filename, str);
 */
 static int ejs_sys_file_save(MprVarHandle eid, int argc, char **argv)
 {

Added: branches/SOC/SAMBA_4_0/testdata/samba3/smbpasswd
===================================================================
--- branches/SOC/SAMBA_4_0/testdata/samba3/smbpasswd	2005-08-30 22:38:34 UTC (rev 9813)
+++ branches/SOC/SAMBA_4_0/testdata/samba3/smbpasswd	2005-08-30 23:41:37 UTC (rev 9814)
@@ -0,0 +1,3 @@
+nobodypw:65534:B28BD20B0D3770EBAAD3B435B51404EE:B123AB4EC733F895B1260A3A08D9C69B:[NU         ]:LCT-43148525:
+rootpw:0:552902031BEDE9EFAAD3B435B51404EE:878D8014606CDA29677A44EFA1353FC7:[U          ]:LCT-4314851B:
+jelmerpw:1000:193130B61A7F81C0AAD3B435B51404EE:C2AE1FE6E648846352453E816F2AEB93:[U          ]:LCT-4314850D:

Added: branches/SOC/SAMBA_4_0/testprogs/ejs/samba3sam
===================================================================
--- branches/SOC/SAMBA_4_0/testprogs/ejs/samba3sam	2005-08-30 22:38:34 UTC (rev 9813)
+++ branches/SOC/SAMBA_4_0/testprogs/ejs/samba3sam	2005-08-30 23:41:37 UTC (rev 9814)
@@ -0,0 +1,78 @@
+#!/usr/bin/env smbscript
+
+libinclude("base.js");
+var sys = sys_init();
+var s3url;
+var s3 = ldb_init();
+var ok;
+
+if (ARGV.length == 2) {
+	s3url = ARGV[1];
+	ok = s3.connect(s3url);
+	assert(ok);
+} else {
+	s3url = "tdb://samba3.ldb";
+	sys.unlink("samba3.ldb");
+	println("Adding samba3 LDIF...");
+	var s3 = ldb_init();
+	ok = s3.connect(s3url);
+	assert(ok);
+	var ldif = sys.file_load("../../testdata/samba3/samba3.ldif");
+	assert(ldif != undefined);
+	ok = s3.add(ldif);
+	assert(ok);
+}
+
+println("Initial samba4 LDIF...");
+var s4 = ldb_init();
+ok = s4.connect("tdb://samba4.ldb");
+assert(ok);
+ok = s4.add(sprintf("
+dn: @MODULES
+ at LIST: samba3sam
+
+dn: @MAP=samba3sam
+ at MAP_URL: %s", s3url));
+assert(ok);
+
+println("Looking up by non-mapped attribute");
+msg = s4.search("(cn=Administrator)");
+assert(msg.length == 1);
+
+println("Looking up by mapped attribute");
+msg = s4.search("(name=Backup Operators)");
+assert(msg.length == 1);
+
+println("Looking up by old name of renamed attribute");
+msg = s4.search("(displayName=Backup Operators)");
+assert(msg.length == 1);
+
+println("Adding a record");
+ok = s4.add("
+dn: cn=Foo,dc=idealx,dc=org
+unixName: root
+lastLogon: 20000
+cn: Foo
+showInAdvancedViewOnly: TRUE
+");
+assert(ok);
+
+println("Checking for existance of record");
+msg = s4.search("(cn=Foo)", new Array('unixName','lastLogon','cn','showInAdvancedViewOnly'));
+assert(msg.length == 1);
+
+println("Checking for persistence of non-mappable attribute");
+msg = s4.search("(cn=Foo)", new Array('showInAdvancedViewOnly'));
+assert(msg.length == 1);
+
+println("Adding record with mapped attribute in dn");
+ok = s4.add("
+dn: unixName=nobody,dc=idealx,dc=org
+unixName: nobody 
+cn: Niemand
+");
+assert(ok);
+
+println("Checking for existance of record (mapped)");
+msg = s4.search("(unixName=nobody)", new Array('unixName','cn','dn'));
+assert(msg.length == 1);


Property changes on: branches/SOC/SAMBA_4_0/testprogs/ejs/samba3sam
___________________________________________________________________
Name: svn:executable
   + *



More information about the samba-cvs mailing list