r8269: added automatic testing of rpc calls from ejs in 'make test'
authorAndrew Tridgell <tridge@samba.org>
Sun, 10 Jul 2005 00:19:41 +0000 (00:19 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:19:28 +0000 (13:19 -0500)
(This used to be commit c760180119b4ac9307783bc50892a3dc57b2465e)

source4/script/tests/selftest.sh
source4/script/tests/test_ejs.sh [new file with mode: 0755]
testprogs/ejs/echo.js
testprogs/ejs/samr.js

index d99857f2d0ed698732bd95282fdfd076e12e4df1..2993b0590e56f26fa9835a964cb5ff604694a528 100755 (executable)
@@ -107,6 +107,7 @@ START=`date`
  bin/nmblookup -U localhost localhost 
 
  failed=0
+ $SRCDIR/script/tests/test_ejs.sh localhost $USERNAME $PASSWORD || failed=`expr $failed + $?`
  $SRCDIR/script/tests/test_ldap.sh localhost $USERNAME $PASSWORD || failed=`expr $failed + $?`
  $SRCDIR/script/tests/test_quick.sh //localhost/cifs $USERNAME $PASSWORD "" || failed=`expr $failed + $?`
  $SRCDIR/script/tests/test_rpc.sh localhost $USERNAME $PASSWORD $DOMAIN || failed=`expr $failed + $?`
diff --git a/source4/script/tests/test_ejs.sh b/source4/script/tests/test_ejs.sh
new file mode 100755 (executable)
index 0000000..83a16c6
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/sh
+# test some simple EJS operations
+
+if [ $# -lt 3 ]; then
+cat <<EOF
+Usage: test_ejs.sh SERVER USERNAME PASSWORD
+EOF
+exit 1;
+fi
+
+SERVER="$1"
+USERNAME="$2"
+PASSWORD="$3"
+
+incdir=`dirname $0`
+. $incdir/test_functions.sh
+
+SCRIPTDIR=../testprogs/ejs
+
+for f in samr.js echo.js; do
+    testit "$f" bin/smbscript $SCRIPTDIR/$f ncacn_np:$SERVER -U$USERNAME%$PASSWORD || failed=`expr $failed + 1`
+done
+
index 2040a4663e60431e26b4d3af7579811c132e4ee4..9607466b0ee1cf2501b244c2d1bdd9b411eea425 100644 (file)
@@ -260,3 +260,4 @@ test_TestSurrounding(conn);
 test_TestDoublePointer(conn);
 
 print("All OK\n");
+return 0;
index df54ca60623eb7e5ad6f863200b1c252c9628ad5..1a1ca505699a298b62c5da86cf6af11d5a0c7179 100644 (file)
@@ -179,7 +179,7 @@ print("Connecting to " + binding + "\n");
 status = rpc_connect(conn, binding, "samr");
 if (status.is_ok != true) {
    print("Failed to connect to " + binding + " - " + status.errstr + "\n");
-   return;
+   return -1;
 }
 
 handle = test_Connect(conn);
@@ -187,3 +187,4 @@ test_EnumDomains(conn, handle);
 test_Close(conn, handle);
 
 print("All OK\n");
+return 0;