diff options
author | Andreas Schneider <asn@samba.org> | 2010-08-05 15:35:52 +0200 |
---|---|---|
committer | Andreas Schneider <asn@samba.org> | 2010-08-05 16:11:19 +0200 |
commit | 2a15f7008c5b49cfa91c8001ad2541c5a6c80f73 (patch) | |
tree | 3e3e0b2f6cc39c1ac05ea0a495b7cff25e5b8eaa /source4 | |
parent | 0a8e382d73d16062502b98037d89bf003abc3c4b (diff) | |
download | samba-2a15f7008c5b49cfa91c8001ad2541c5a6c80f73.tar.gz samba-2a15f7008c5b49cfa91c8001ad2541c5a6c80f73.tar.bz2 samba-2a15f7008c5b49cfa91c8001ad2541c5a6c80f73.zip |
s3-torture: Correctly cleanup the winreg volatile key test.
Günther please check!
Diffstat (limited to 'source4')
-rw-r--r-- | source4/torture/rpc/winreg.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/source4/torture/rpc/winreg.c b/source4/torture/rpc/winreg.c index 3fe141c714..f5e92954c3 100644 --- a/source4/torture/rpc/winreg.c +++ b/source4/torture/rpc/winreg.c @@ -2583,7 +2583,7 @@ static bool test_volatile_keys(struct torture_context *tctx, struct policy_handle *handle, int hkey) { - struct policy_handle new_handle; + struct policy_handle new_handle, hive_handle; enum winreg_CreateAction action_taken; torture_comment(tctx, "Testing VOLATILE key\n"); @@ -2657,15 +2657,11 @@ static bool test_volatile_keys(struct torture_context *tctx, "failed to close"); torture_assert(tctx, - test_CloseKey(b, tctx, handle), - "failed to close"); - - torture_assert(tctx, - test_OpenHive(tctx, b, handle, hkey), + test_OpenHive(tctx, b, &hive_handle, hkey), "failed top open hive"); torture_assert(tctx, - test_OpenKey_opts(tctx, b, handle, TEST_KEY_VOLATILE, + test_OpenKey_opts(tctx, b, &hive_handle, TEST_KEY_VOLATILE, REG_OPTION_VOLATILE, SEC_FLAG_MAXIMUM_ALLOWED, &new_handle, @@ -2673,13 +2669,22 @@ static bool test_volatile_keys(struct torture_context *tctx, "failed to open volatile key"); torture_assert(tctx, - test_OpenKey_opts(tctx, b, handle, TEST_KEY_VOLATILE, + test_OpenKey_opts(tctx, b, &hive_handle, TEST_KEY_VOLATILE, REG_OPTION_NON_VOLATILE, SEC_FLAG_MAXIMUM_ALLOWED, &new_handle, WERR_BADFILE), "failed to open volatile key"); + torture_assert(tctx, + test_CloseKey(b, tctx, &hive_handle), + "failed to close"); + + torture_assert(tctx, + test_DeleteKey(b, tctx, handle, TEST_KEY_VOLATILE), + "failed to delete key"); + + torture_comment(tctx, "Testing VOLATILE key succeeded\n"); return true; |