From c6132465d166c2760b6ab291fea90c216b920372 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 22 May 2008 12:34:50 +0200 Subject: Remove unused EJS testprogs. (This used to be commit e14c9302009b371f385612d2fd500773d238006a) --- testprogs/ejs/loadparm.js | 25 ------------------------- testprogs/ejs/resolveName.js | 13 ------------- 2 files changed, 38 deletions(-) delete mode 100644 testprogs/ejs/loadparm.js delete mode 100644 testprogs/ejs/resolveName.js (limited to 'testprogs') diff --git a/testprogs/ejs/loadparm.js b/testprogs/ejs/loadparm.js deleted file mode 100644 index f56ca9f7fc..0000000000 --- a/testprogs/ejs/loadparm.js +++ /dev/null @@ -1,25 +0,0 @@ -/* - demonstrate access to loadparm functions from ejs -*/ - -loadparm_init(local); - -function showParameter(name) { - print(name + ": "); - printVars(get(name)); -} - -for (v in ARGV) { - showParameter(ARGV[v]); -} - -print("defined services: "); -printVars(services()); - -showParameter("server services"); -showParameter("netbios name"); -showParameter("security"); -showParameter("workgroup"); -showParameter("log level"); -showParameter("server signing"); -showParameter("interfaces"); diff --git a/testprogs/ejs/resolveName.js b/testprogs/ejs/resolveName.js deleted file mode 100644 index 1619b69d69..0000000000 --- a/testprogs/ejs/resolveName.js +++ /dev/null @@ -1,13 +0,0 @@ -/* - Demonstrate use of resolveName() js function -*/ - -var result = new Object(); - -res = resolveName(result, ARGV[0]); - -if (res.is_ok) { - println(result.value); -} else { - println(res.errstr); -} -- cgit From 27005cb7a2182c50c8bf9e683de1bea2613a3078 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 22 May 2008 05:13:31 +0200 Subject: Convert samr test to python. (This used to be commit 88d473b202e82b462ef82ffdeb4f1710918ffda5) --- testprogs/ejs/samr.js | 126 -------------------------------------------------- 1 file changed, 126 deletions(-) delete mode 100755 testprogs/ejs/samr.js (limited to 'testprogs') diff --git a/testprogs/ejs/samr.js b/testprogs/ejs/samr.js deleted file mode 100755 index fbdae974be..0000000000 --- a/testprogs/ejs/samr.js +++ /dev/null @@ -1,126 +0,0 @@ -#!/usr/bin/env smbscript -/* - test samr calls from ejs -*/ - -var options = GetOptions(ARGV, - "POPT_AUTOHELP", - "POPT_COMMON_SAMBA", - "POPT_COMMON_CREDENTIALS"); -if (options == undefined) { - println("Failed to parse options"); - return -1; -} - -libinclude("base.js"); -libinclude("samr.js"); - - -/* - test the samr_Connect interface -*/ -function test_Connect(samr) -{ - print("Testing samr_Connect\n"); - return samrConnect(samr); -} - - -/* - test the samr_LookupDomain interface -*/ -function test_LookupDomain(samr, handle, domain) -{ - print("Testing samr_LookupDomain\n"); - return samrLookupDomain(samr, handle, domain); -} - -/* - test the samr_OpenDomain interface -*/ -function test_OpenDomain(samr, handle, sid) -{ - print("Testing samr_OpenDomain\n"); - return samrOpenDomain(samr, handle, sid); -} - -/* - test the samr_EnumDomainUsers interface -*/ -function test_EnumDomainUsers(samr, dom_handle) -{ - var i, users; - print("Testing samr_EnumDomainUsers\n"); - users = samrEnumDomainUsers(samr, dom_handle); - print("Found " + users.length + " users\n"); - for (i=0;i"); - return -1; -} -var binding = options.ARGV[0]; -var samr = samr_init(); - -print("Connecting to " + binding + "\n"); -status = samr.connect(binding); -if (status.is_ok != true) { - print("Failed to connect to " + binding + " - " + status.errstr + "\n"); - return -1; -} - -handle = test_Connect(samr); -test_EnumDomains(samr, handle); -samrClose(samr, handle); - -print("All OK\n"); -return 0; -- cgit From fb7e359561b77444feae0c71b034c7cac1820694 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 22 May 2008 05:23:50 +0200 Subject: Remove unused echo ejs script. (This used to be commit 3a6b009d505503b2eb22acadeaac485151ed0173) --- testprogs/ejs/echo.js | 235 -------------------------------------------------- 1 file changed, 235 deletions(-) delete mode 100755 testprogs/ejs/echo.js (limited to 'testprogs') diff --git a/testprogs/ejs/echo.js b/testprogs/ejs/echo.js deleted file mode 100755 index 3750baf0fb..0000000000 --- a/testprogs/ejs/echo.js +++ /dev/null @@ -1,235 +0,0 @@ -#!/usr/bin/env smbscript -/* - test echo pipe calls from ejs -*/ - -var options = GetOptions(ARGV, - "POPT_AUTOHELP", - "POPT_COMMON_SAMBA", - "POPT_COMMON_CREDENTIALS"); -if (options == undefined) { - println("Failed to parse options"); - return -1; -} - -libinclude("base.js"); - -/* - generate a ramp as an integer array - */ -function ramp_array(N) -{ - var a = new Array(N); - var data = datablob_init(); - for (i=0;i"); - return -1; -} -var binding = options.ARGV[0]; -var echo = rpcecho_init(); -datablob_init(echo); - -print("Connecting to " + binding + "\n"); -status = echo.connect(binding); -if (status.is_ok != true) { - printf("Failed to connect to %s - %s\n", binding, status.errstr); - return; -} - -test_AddOne(echo); -test_EchoData(echo); -test_SinkData(echo); -test_SourceData(echo); - -print("SKIPPING test_TestCall as pidl cannot generate code for it\n"); -/* test_TestCall(echo); */ -test_TestCall2(echo); -test_TestSleep(echo); -test_TestEnum(echo); -test_TestSurrounding(echo); -test_TestDoublePointer(echo); - -println("All OK\n"); -return 0; -- cgit From 9e37d25a92eaa7c65bb5d4822832fbf98a9504cb Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 26 May 2008 13:34:36 +0200 Subject: Remove unused scripts. (This used to be commit 3d22b72bb780065059f45ebeb6025d1bceb1f5b6) --- testprogs/ejs/argv.js | 14 -------------- testprogs/ejs/nbtstats | 33 --------------------------------- 2 files changed, 47 deletions(-) delete mode 100644 testprogs/ejs/argv.js delete mode 100755 testprogs/ejs/nbtstats (limited to 'testprogs') diff --git a/testprogs/ejs/argv.js b/testprogs/ejs/argv.js deleted file mode 100644 index ffb6e007eb..0000000000 --- a/testprogs/ejs/argv.js +++ /dev/null @@ -1,14 +0,0 @@ -/* - demonstrate use of GetOptions -*/ - -var options = GetOptions(ARGV, - "POPT_AUTOHELP", - "POPT_COMMON_SAMBA", - "myopt=s", - "intopt=i", - "noopt"); - -println("You called this script with arguments:"); - -printVars(options); diff --git a/testprogs/ejs/nbtstats b/testprogs/ejs/nbtstats deleted file mode 100755 index 1c8a6a5e7e..0000000000 --- a/testprogs/ejs/nbtstats +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env smbscript -/* - demonstrate access to irpc calls from ejs -*/ - -var options = GetOptions(ARGV, - "POPT_AUTOHELP", - "POPT_COMMON_SAMBA"); -if (options == undefined) { - println("Failed to parse options"); - return -1; -} - -var conn = new Object(); -var irpc = irpc_init(); - -status = irpc_connect(conn, "nbt_server"); -assert(status.is_ok == true); - -io = new Object(); -io.input = new Object(); -io.input.level = irpc.NBTD_INFO_STATISTICS; -status = irpc.nbtd_information(conn, io); -assert(status.is_ok == true); -assert(io.results.length == 1); - -print("nbt_server statistics:\n"); -stats = io.results[0].info.stats; - -for (r in stats) { - print("\t" + r + ":\t" + stats[r] + "\n"); -} -return 0; -- cgit From 4e9ca6caf913016292a3f7555bd91768d6f90efd Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 26 May 2008 14:00:28 +0200 Subject: Remove unused EJS net bindings. (This used to be commit 3923414849c5a3b14379e2cd3e61d862150800a6) --- testprogs/ejs/ejsnet.js | 46 ---------------------- testprogs/ejs/ejsnet/nethost.js | 45 --------------------- testprogs/ejs/ejsnet/netusr.js | 86 ----------------------------------------- 3 files changed, 177 deletions(-) delete mode 100755 testprogs/ejs/ejsnet.js delete mode 100644 testprogs/ejs/ejsnet/nethost.js delete mode 100644 testprogs/ejs/ejsnet/netusr.js (limited to 'testprogs') diff --git a/testprogs/ejs/ejsnet.js b/testprogs/ejs/ejsnet.js deleted file mode 100755 index a5570de34c..0000000000 --- a/testprogs/ejs/ejsnet.js +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env smbscript - -libinclude("base.js"); - -/* note: these require specifying a proper path in "js include" parameter */ -libinclude("ejsnet/netusr.js"); -libinclude("ejsnet/nethost.js"); - -function PrintNetHelp() -{ - println("Usage: ejsnet.js [options]"); -} - -/* here we start */ - -var options = GetOptions(ARGV, - "POPT_AUTOHELP", - "POPT_COMMON_SAMBA", - "POPT_COMMON_CREDENTIALS"); -if (options == undefined) { - PrintNetHelp(); - return -1; -} - -if (options.ARGV.length < 1) { - PrintNetHelp(); - return -1; -} - -/* use command line creds if available */ -var creds = options.get_credentials(); -var ctx = NetContext(creds); - -var cmd = options.ARGV[0]; -if (cmd == "user") { - UserManager(ctx, options); - -} else if (cmd == "host") { - HostManager(ctx, options); - -} else { - PrintNetHelp(); - return -1; -} - -return 0; diff --git a/testprogs/ejs/ejsnet/nethost.js b/testprogs/ejs/ejsnet/nethost.js deleted file mode 100644 index 9e11ae89c5..0000000000 --- a/testprogs/ejs/ejsnet/nethost.js +++ /dev/null @@ -1,45 +0,0 @@ -function PrintNetHostHelp() -{ - println("Host management - available commands:"); - println("\t domainlist - list users in specified domain"); -} - - -function ListDomains(hostCtx) -{ - var domain; - - var list = hostCtx.DomainList(); - if (list == undefined) { - println("Error when listing domains"); - return -1; - } - - for (var i = 0; i < list.Count; i++) { - domain = list.Domains[i]; - printf("%s\n", domain.Name); - } - - printf("\nResult: %s\n", list.Status.errstr); -} - - -function HostManager(ctx, options) -{ - var hostCtx; - - if (options.ARGV.length < 2) { - PrintNetHostHelp(); - return -1; - } - - var hostCmd = options.ARGV[1]; - - if (hostCmd == "domainlist") { - hostCtx = ctx.HostMgr(); - ListDomains(hostCtx); - - } else { - println("unknown command"); - } -} diff --git a/testprogs/ejs/ejsnet/netusr.js b/testprogs/ejs/ejsnet/netusr.js deleted file mode 100644 index da6e851ce7..0000000000 --- a/testprogs/ejs/ejsnet/netusr.js +++ /dev/null @@ -1,86 +0,0 @@ -function PrintNetUsrHelp(options) -{ - println("User management - available commands:"); - println("\t list - list users in specified domain"); - println("\t info - display user account information"); -} - - -function ListUsers(usrCtx) -{ - var list, user; - var finished = false; - - for (list = usrCtx.List(list); list.Status.is_ok && !finished; list = usrCtx.List(list)) { - for (i = 0; i < list.Count; i++) { - user = list.Users[i]; - printf("%s\n", user.Username); - } - - finished = list.EndOfList; - } - - printf("\nResult: %s\n", list.Status.errstr); -} - - -function UserInfo(usrCtx, username) -{ - var info; - - info = usrCtx.Info(username); - if (info == null) { - println("Account unknown"); - return -1; - } - - println("User account info:\n"); - printf("AccountName = %s\n", info.AccountName); - printf("Description = %s\n", info.Description); - printf("FullName = %s\n", info.FullName); - printf("AcctExpiry = %s\n", info.AcctExpiry); -} - - -function UserManager(ctx, options) -{ - var usrCtx; - - if (options.ARGV.length < 2) { - PrintNetUsrHelp(options); - return -1; - - } - - var usrCmd = options.ARGV[1]; - - if (usrCmd == "create") { - - } else if (usrCmd == "info") { - var userName; - - if (options.ARGV.length > 2) { - userName = options.ARGV[2]; - } else { - println("No username provided"); - return -1; - } - usrCtx = ctx.UserMgr(); - - UserInfo(usrCtx, userName); - - } else if (usrCmd == "list") { - - if (options.ARGV.length > 2) { - usrCtx = ctx.UserMgr(options.ARGV[2]); - } else { - usrCtx = ctx.UserMgr(); - } - - ListUsers(usrCtx); - - } else { - println("Unknown command specified."); - PrintNetUsrHelp(options); - } -} -- cgit