summaryrefslogtreecommitdiff
path: root/testprogs
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-07-08 08:19:59 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:19:23 -0500
commit82251eddee06e44a96640ca540ba002c11dcedf5 (patch)
tree7210df3f58248d0f61105864bc1f928241df3cea /testprogs
parentf55b2b96108d71197807b46af16085167556bf6e (diff)
downloadsamba-82251eddee06e44a96640ca540ba002c11dcedf5.tar.gz
samba-82251eddee06e44a96640ca540ba002c11dcedf5.tar.bz2
samba-82251eddee06e44a96640ca540ba002c11dcedf5.zip
r8234: started on testing samr calls from ejs. So far it only does samr_Connect()
(This used to be commit 2e50a5b780bed20415620011130af83ef73c4f85)
Diffstat (limited to 'testprogs')
-rw-r--r--testprogs/ejs/echo.js2
-rw-r--r--testprogs/ejs/samr.js60
2 files changed, 61 insertions, 1 deletions
diff --git a/testprogs/ejs/echo.js b/testprogs/ejs/echo.js
index df12e46486..2040a4663e 100644
--- a/testprogs/ejs/echo.js
+++ b/testprogs/ejs/echo.js
@@ -1,5 +1,5 @@
/*
- demonstrate access to rpc calls from ejs
+ test echo pipe calls from ejs
*/
diff --git a/testprogs/ejs/samr.js b/testprogs/ejs/samr.js
new file mode 100644
index 0000000000..fac1cb712e
--- /dev/null
+++ b/testprogs/ejs/samr.js
@@ -0,0 +1,60 @@
+/*
+ test samr calls from ejs
+*/
+
+
+/*
+ helper function to setup a rpc io object, ready for input
+*/
+function irpcObj()
+{
+ var o = new Object();
+ o.input = new Object();
+ return o;
+}
+
+/*
+ check that a status result is OK
+*/
+function check_status_ok(status)
+{
+ if (status.is_ok != true) {
+ printVars(status);
+ }
+ assert(status.is_ok == true);
+}
+
+/*
+ test the samr_Connect interface
+*/
+function test_Connect(conn)
+{
+ var io = irpcObj();
+
+ print("Testing samr_Connect\n");
+
+ io.input.system_name = NULL;
+ io.input.access_mask = 0;
+ status = dcerpc_samr_Connect(conn, io);
+ printVars(io);
+ check_status_ok(status);
+}
+
+if (ARGV.length == 0) {
+ print("Usage: samr.js <RPCBINDING>\n");
+ exit(0);
+}
+
+var binding = ARGV[0];
+var conn = new Object();
+
+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;
+}
+
+test_Connect(conn);
+
+print("All OK\n");