diff options
author | Andrew Kroeger <andrew@sprocks.gotdns.com> | 2008-02-19 09:03:32 -0600 |
---|---|---|
committer | Andrew Kroeger <andrew@sprocks.gotdns.com> | 2008-02-26 19:27:15 -0600 |
commit | 497b17ac61995f0dd07de7d9d505de5ad3a46618 (patch) | |
tree | 6543511b962428ac30f5be734d57b1eda39b040c /source4 | |
parent | a13395c8731db614e543e60d3da67873c3164ea2 (diff) | |
download | samba-497b17ac61995f0dd07de7d9d505de5ad3a46618.tar.gz samba-497b17ac61995f0dd07de7d9d505de5ad3a46618.tar.bz2 samba-497b17ac61995f0dd07de7d9d505de5ad3a46618.zip |
torture/rpc-winreg: General fixes for a number of tests.
Cleaned up issues with tests being run without the correct state being setup.
Also corrected an issue with a test expecting the wrong return value to indicate
a successful test run.
(This used to be commit d015e595ca82f8fd3941753c00a2f3d816300be9)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/torture/rpc/winreg.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/source4/torture/rpc/winreg.c b/source4/torture/rpc/winreg.c index 4695733671..96b1fb2174 100644 --- a/source4/torture/rpc/winreg.c +++ b/source4/torture/rpc/winreg.c @@ -1730,6 +1730,11 @@ static bool test_Open(struct torture_context *tctx, struct dcerpc_pipe *p, test_Cleanup(p, tctx, &handle, TEST_KEY3); test_Cleanup(p, tctx, &handle, TEST_KEY_BASE); + if (!test_CreateKey(p, tctx, &handle, TEST_KEY_BASE, NULL)) { + torture_comment(tctx, + "CreateKey (TEST_KEY_BASE) failed\n"); + } + if (!test_CreateKey(p, tctx, &handle, TEST_KEY1, NULL)) { torture_comment(tctx, "CreateKey failed - not considering a failure\n"); @@ -1763,9 +1768,12 @@ static bool test_Open(struct torture_context *tctx, struct dcerpc_pipe *p, } if (created && deleted && - test_OpenKey(p, tctx, &handle, TEST_KEY1, &newhandle)) { + !_test_OpenKey(p, tctx, &handle, TEST_KEY1, + SEC_FLAG_MAXIMUM_ALLOWED, &newhandle, + WERR_BADFILE, NULL)) { torture_comment(tctx, - "DeleteKey failed (OpenKey after Delete worked)\n"); + "DeleteKey failed (OpenKey after Delete " + "did not return WERR_BADFILE)\n"); ret = false; } @@ -1788,7 +1796,7 @@ static bool test_Open(struct torture_context *tctx, struct dcerpc_pipe *p, created4 = true; } - if (!created4 && !test_CloseKey(p, tctx, &newhandle)) { + if (created4 && !test_CloseKey(p, tctx, &newhandle)) { printf("CloseKey failed\n"); ret = false; } @@ -1803,7 +1811,7 @@ static bool test_Open(struct torture_context *tctx, struct dcerpc_pipe *p, } - if (created && !test_DeleteKey(p, tctx, &handle, TEST_KEY2)) { + if (created2 && !test_DeleteKey(p, tctx, &handle, TEST_KEY2)) { printf("DeleteKey failed\n"); ret = false; } @@ -1841,10 +1849,10 @@ static bool test_Open(struct torture_context *tctx, struct dcerpc_pipe *p, if(!test_key(p, tctx, &handle, MAX_DEPTH - 1)) { ret = false; } - } - - if (!test_key(p, tctx, &handle, 0)) { - ret = false; + } else { + if (!test_key(p, tctx, &handle, 0)) { + ret = false; + } } test_Cleanup(p, tctx, &handle, TEST_KEY_BASE); |