summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2007-11-27 10:34:53 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:46:25 +0100
commitfd461adfd017f5fe26ffd7340ccfd953363c28ab (patch)
treea925b27856c03149ceb9c050a8bce9171f42f4a4 /source4/torture
parentb653bea814d4a738a0fc5082945b9d619e21ceb7 (diff)
downloadsamba-fd461adfd017f5fe26ffd7340ccfd953363c28ab.tar.gz
samba-fd461adfd017f5fe26ffd7340ccfd953363c28ab.tar.bz2
samba-fd461adfd017f5fe26ffd7340ccfd953363c28ab.zip
r26151: Add IDL and torture test for wkssvc_NetrValidateName() and
wkssvc_NetrValidateName2(). Guenther (This used to be commit 9f63ec388dab09ef3148635eefa58f2e32c5d151)
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/rpc/wkssvc.c64
1 files changed, 64 insertions, 0 deletions
diff --git a/source4/torture/rpc/wkssvc.c b/source4/torture/rpc/wkssvc.c
index f40af73538..d862e00d1d 100644
--- a/source4/torture/rpc/wkssvc.c
+++ b/source4/torture/rpc/wkssvc.c
@@ -504,6 +504,66 @@ static bool test_NetrLogonDomainNameDel(struct torture_context *tctx,
return true;
}
+static bool test_NetrValidateName(struct torture_context *tctx,
+ struct dcerpc_pipe *p)
+{
+ NTSTATUS status;
+ struct wkssvc_NetrValidateName r;
+ uint16_t levels[] = {0,1,2,3,4,5};
+ int i;
+
+ for (i=0; i<ARRAY_SIZE(levels); i++) {
+
+ r.in.server_name = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p));
+ r.in.name = lp_workgroup(global_loadparm);
+ r.in.Account = NULL;
+ r.in.Password = NULL;
+ r.in.name_type = levels[i];
+
+ torture_comment(tctx, "testing NetrValidateName level %u\n",
+ r.in.name_type);
+
+ status = dcerpc_wkssvc_NetrValidateName(p, tctx, &r);
+ torture_assert_ntstatus_ok(tctx, status,
+ "NetrValidateName failed");
+ torture_assert_werr_equal(tctx, r.out.result,
+ WERR_NOT_SUPPORTED,
+ "NetrValidateName failed");
+ }
+
+ return true;
+}
+
+static bool test_NetrValidateName2(struct torture_context *tctx,
+ struct dcerpc_pipe *p)
+{
+ NTSTATUS status;
+ struct wkssvc_NetrValidateName2 r;
+ uint16_t levels[] = {0,1,2,3,4,5};
+ int i;
+
+ for (i=0; i<ARRAY_SIZE(levels); i++) {
+
+ r.in.server_name = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p));
+ r.in.name = lp_workgroup(global_loadparm);
+ r.in.Account = NULL;
+ r.in.EncryptedPassword = NULL;
+ r.in.name_type = levels[i];
+
+ torture_comment(tctx, "testing NetrValidateName2 level %u\n",
+ r.in.name_type);
+
+ status = dcerpc_wkssvc_NetrValidateName2(p, tctx, &r);
+ torture_assert_ntstatus_ok(tctx, status,
+ "NetrValidateName2 failed");
+ torture_assert_werr_equal(tctx, r.out.result,
+ WERR_RPC_E_REMOTE_DISABLED,
+ "NetrValidateName2 failed");
+ }
+
+ return true;
+}
+
struct torture_suite *torture_rpc_wkssvc(TALLOC_CTX *mem_ctx)
{
struct torture_suite *suite;
@@ -537,6 +597,10 @@ struct torture_suite *torture_rpc_wkssvc(TALLOC_CTX *mem_ctx)
torture_rpc_tcase_add_test(tcase, "NetrUseAdd",
test_NetrUseAdd);
+ torture_rpc_tcase_add_test(tcase, "NetrValidateName",
+ test_NetrValidateName);
+ torture_rpc_tcase_add_test(tcase, "NetrValidateName2",
+ test_NetrValidateName2);
torture_rpc_tcase_add_test(tcase, "NetrLogonDomainNameDel",
test_NetrLogonDomainNameDel);
torture_rpc_tcase_add_test(tcase, "NetrLogonDomainNameAdd",