summaryrefslogtreecommitdiffstats
path: root/testprogs
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-07-08 09:38:41 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:19:23 -0500
commitd1298d9c81979da73be30f4b38f592636c81607b (patch)
tree61a7cfd93697d2bd0e2b98a83fdc27594e67d658 /testprogs
parente897a570673d4c79361ed386ebdb14b0ec5a106c (diff)
downloadsamba-d1298d9c81979da73be30f4b38f592636c81607b.tar.gz
samba-d1298d9c81979da73be30f4b38f592636c81607b.tar.xz
samba-d1298d9c81979da73be30f4b38f592636c81607b.zip
r8237: expanded the samr.js test to do a samr_Connect(), samr_EnumDomains() and samr_Close()
(This used to be commit 5be26e7491be14ab5b6450a666911eef7c6b8785)
Diffstat (limited to 'testprogs')
-rw-r--r--testprogs/ejs/samr.js41
1 files changed, 37 insertions, 4 deletions
diff --git a/testprogs/ejs/samr.js b/testprogs/ejs/samr.js
index fac1cb712e0..dd3abe00613 100644
--- a/testprogs/ejs/samr.js
+++ b/testprogs/ejs/samr.js
@@ -30,16 +30,47 @@ function check_status_ok(status)
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);
+ return io.output.connect_handle;
+}
+
+/*
+ test the samr_Close interface
+*/
+function test_Close(conn, handle)
+{
+ var io = irpcObj();
+ print("Testing samr_Close\n");
+ io.input.handle = handle;
+ status = dcerpc_samr_Close(conn, io);
check_status_ok(status);
}
+/*
+ test the samr_EnumDomains interface
+*/
+function test_EnumDomains(conn, handle)
+{
+ var io = irpcObj();
+ print("Testing samr_EnumDomains\n");
+ io.input.connect_handle = handle;
+ io.input.resume_handle = 0;
+ io.input.buf_size = 0;
+ status = dcerpc_samr_EnumDomains(conn, io);
+ check_status_ok(status);
+ print("Found " + io.output.num_entries + " domains\n");
+ entries = io.output.sam.entries;
+ for (i=0;i<io.output.num_entries;i++) {
+ print("\t" + entries[i].name.string + "\n");
+ }
+}
+
+
+
if (ARGV.length == 0) {
print("Usage: samr.js <RPCBINDING>\n");
exit(0);
@@ -55,6 +86,8 @@ if (status.is_ok != true) {
return;
}
-test_Connect(conn);
+handle = test_Connect(conn);
+test_EnumDomains(conn, handle);
+test_Close(conn, handle);
print("All OK\n");