s4:torture/rpc/netlogon: add invalid level tests for netr_LogonControl2
authorStefan Metzmacher <metze@samba.org>
Tue, 1 Feb 2011 12:04:48 +0000 (13:04 +0100)
committerStefan Metzmacher <metze@samba.org>
Wed, 2 Feb 2011 11:43:32 +0000 (12:43 +0100)
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Wed Feb  2 12:43:32 CET 2011 on sn-devel-104

source4/torture/rpc/netlogon.c

index b7c9b05d1d3f8508dccb353037bcc8c9fc343e32..14052e7a0b5fe889389499749d6350a47d3dab91 100644 (file)
@@ -1999,6 +1999,30 @@ static bool test_LogonControl2(struct torture_context *tctx,
                torture_assert_ntstatus_ok(tctx, status, "LogonControl2");
        }
 
+       ZERO_STRUCT(data);
+       r.in.function_code = 52;
+       r.in.data = &data;
+
+       torture_comment(tctx, "Testing LogonControl2 function code %s (%d) level %d\n",
+                       function_code_str(tctx, r.in.function_code), r.in.function_code, r.in.level);
+
+       status = dcerpc_netr_LogonControl2_r(b, tctx, &r);
+       torture_assert_ntstatus_ok(tctx, status, "LogonControl2");
+       torture_assert_werr_equal(tctx, r.out.result, WERR_UNKNOWN_LEVEL, "LogonControl2");
+
+       data.debug_level = ~0;
+
+       r.in.function_code = NETLOGON_CONTROL_SET_DBFLAG;
+       r.in.data = &data;
+
+       r.in.level = 52;
+       torture_comment(tctx, "Testing LogonControl2 function code %s (%d) level %d\n",
+                       function_code_str(tctx, r.in.function_code), r.in.function_code, r.in.level);
+
+       status = dcerpc_netr_LogonControl2_r(b, tctx, &r);
+       torture_assert_ntstatus_ok(tctx, status, "LogonControl2");
+       torture_assert_werr_equal(tctx, r.out.result, WERR_UNKNOWN_LEVEL, "LogonControl2");
+
        return true;
 }