r8636: fixed the ejs ldb test to work with the new ldb.search() syntax, and
authorAndrew Tridgell <tridge@samba.org>
Wed, 20 Jul 2005 06:21:30 +0000 (06:21 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:29:47 +0000 (13:29 -0500)
add it to our test suite so it will be maintained

source/script/tests/test_ejs.sh
testprogs/ejs/ldb.js [changed mode: 0644->0755]

index 03b43e8f8526205e65bdf5fbdc433870e823df23..75a47155b7957ad8b6736f54d2e38960d515fbe5 100755 (executable)
@@ -20,7 +20,7 @@ SCRIPTDIR=../testprogs/ejs
 PATH=bin:$PATH
 export PATH
 
-for f in samr.js echo.js; do
+for f in samr.js echo.js ldb.js; do
     testit "$f" $SCRIPTDIR/$f $CONFIGURATION ncalrpc: -U$USERNAME%$PASSWORD || failed=`expr $failed + 1`
 done
 
old mode 100644 (file)
new mode 100755 (executable)
index dee3377..819192b
@@ -30,17 +30,17 @@ x: 4
 ");
        assert(ok);
        var attrs = new Array("x");
-       res = ldb.search("x=4", attrs);
+       res = ldb.search("x=4", NULL, ldb.SCOPE_DEFAULT, attrs);
        assert(res[0].x == 4);
        assert(res[0].objectClass == undefined);
        assert(res[0].dn == "cn=x2,cn=test");
 
-       ok = ldb.delete("cn=x,cn=test");
+       ok = ldb.del("cn=x,cn=test");
        assert(ok);
 
        ok = ldb.rename("cn=x2,cn=test", "cn=x3,cn=test");
        assert(ok);
-       res = ldb.search("x=4", attrs);
+       res = ldb.search("x=4", NULL, ldb.SCOPE_DEFAULT, attrs);
        assert(res[0].dn == "cn=x3,cn=test");
 
        ok = ldb.modify("
@@ -56,15 +56,13 @@ x: 7
        
 }
 
-var sys = sys_init();
+sys_init(ldb);
 var dbfile = "test.ldb";
-sys.unlink(dbfile);
+ldb.unlink(dbfile);
 var ok = ldb.connect("tdb://" + dbfile);
 assert(ok);
 
 basic_tests(ldb);
 
-sys.unlink(dbfile);
-
-
-
+ldb.unlink(dbfile);
+return 0;