From 89eaa9ed8e52ff9447285974d2acd586257e4319 Mon Sep 17 00:00:00 2001 From: =?utf8?q?G=C3=BCnther=20Deschner?= Date: Wed, 17 Mar 2010 11:36:09 +0100 Subject: [PATCH] s4-smbtorture: add test_DeleteKey_opts to RPC-WINREG. Guenther --- source4/torture/rpc/winreg.c | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/source4/torture/rpc/winreg.c b/source4/torture/rpc/winreg.c index 4421761dc13..2c3f542c7af 100644 --- a/source4/torture/rpc/winreg.c +++ b/source4/torture/rpc/winreg.c @@ -1414,24 +1414,34 @@ static bool test_SecurityDescriptors(struct dcerpc_pipe *p, return ret; } -static bool test_DeleteKey(struct dcerpc_binding_handle *b, - struct torture_context *tctx, - struct policy_handle *handle, const char *key) +static bool test_DeleteKey_opts(struct dcerpc_binding_handle *b, + struct torture_context *tctx, + struct policy_handle *handle, + const char *key, + WERROR expected_result) { - NTSTATUS status; struct winreg_DeleteKey r; + torture_comment(tctx, "Testing DeleteKey(%s)\n", key); + r.in.handle = handle; init_winreg_String(&r.in.key, key); - status = dcerpc_winreg_DeleteKey_r(b, tctx, &r); - - torture_assert_ntstatus_ok(tctx, status, "DeleteKey failed"); - torture_assert_werr_ok(tctx, r.out.result, "DeleteKey failed"); + torture_assert_ntstatus_ok(tctx, dcerpc_winreg_DeleteKey_r(b, tctx, &r), + "Delete Key failed"); + torture_assert_werr_equal(tctx, r.out.result, expected_result, + "DeleteKey failed"); return true; } +static bool test_DeleteKey(struct dcerpc_binding_handle *b, + struct torture_context *tctx, + struct policy_handle *handle, const char *key) +{ + return test_DeleteKey_opts(b, tctx, handle, key, WERR_OK); +} + static bool test_QueryInfoKey(struct dcerpc_binding_handle *b, struct torture_context *tctx, struct policy_handle *handle, char *kclass) -- 2.11.4.GIT