diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2006-06-16 22:06:09 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:09:09 -0500 |
commit | 582d46ec42144bddccddacadd52a0256f58cb453 (patch) | |
tree | 0545454b21f1ef986117f7c2e72fe957d2b662e2 /source4/torture/auth/ntlmssp.c | |
parent | cc9d70bbba4e326ba89dec8cdc58b64b89f33091 (diff) | |
download | samba-582d46ec42144bddccddacadd52a0256f58cb453.tar.gz samba-582d46ec42144bddccddacadd52a0256f58cb453.tar.bz2 samba-582d46ec42144bddccddacadd52a0256f58cb453.zip |
r16304: Improve testing UI API. This now allows registering the full
test suite tree, looks a bit more like other unit testing API's,
fixes some memory responsibility issues, introduces testcases,
and removes the need for tests to call torture_ok().
(This used to be commit 0445b1a56a02552f895f400960b9ced39244a144)
Diffstat (limited to 'source4/torture/auth/ntlmssp.c')
-rw-r--r-- | source4/torture/auth/ntlmssp.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/source4/torture/auth/ntlmssp.c b/source4/torture/auth/ntlmssp.c index 072d9a3b27..5c75a5b028 100644 --- a/source4/torture/auth/ntlmssp.c +++ b/source4/torture/auth/ntlmssp.c @@ -25,18 +25,16 @@ #include "torture/torture.h" #include "torture/ui.h" -BOOL torture_ntlmssp_self_check(struct torture_context *torture) +static BOOL torture_ntlmssp_self_check(struct torture_context *test, + const void *_data) { struct gensec_security *gensec_security; struct gensec_ntlmssp_state *gensec_ntlmssp_state; DATA_BLOB data; DATA_BLOB sig, expected_sig; - NTSTATUS status; - struct torture_test *test = torture_test(torture, "ntlmssp_self_check", - "NTLMSSP Self Check"); torture_assert_ntstatus_ok(test, - gensec_client_start(torture, &gensec_security, NULL), + gensec_client_start(test, &gensec_security, NULL), "gensec client start"); gensec_set_credentials(gensec_security, cmdline_credentials); @@ -73,7 +71,6 @@ BOOL torture_ntlmssp_self_check(struct torture_context *torture) if (sig.length != expected_sig.length) { torture_fail(test, "Wrong sig length: %d != %d", (int)sig.length, (int)expected_sig.length); - talloc_free(test); return False; } @@ -83,7 +80,7 @@ BOOL torture_ntlmssp_self_check(struct torture_context *torture) talloc_free(gensec_security); torture_assert_ntstatus_ok(test, - gensec_client_start(torture, &gensec_security, NULL), + gensec_client_start(test, &gensec_security, NULL), "Failed to start GENSEC for NTLMSSP"); gensec_set_credentials(gensec_security, cmdline_credentials); @@ -120,7 +117,6 @@ BOOL torture_ntlmssp_self_check(struct torture_context *torture) if (sig.length != expected_sig.length) { torture_fail(test, "Wrong sig length: %d != %d", (int)sig.length, (int)expected_sig.length); - talloc_free(test); return False; } @@ -129,8 +125,16 @@ BOOL torture_ntlmssp_self_check(struct torture_context *torture) "data mismatch"); talloc_free(gensec_security); - torture_ok(test); - talloc_free(test); return True; } + +BOOL torture_ntlmssp(struct torture_context *torture) +{ + struct torture_suite *suite = torture_suite_create(torture, "AUTH-NTLMSSP"); + + torture_suite_add_simple_tcase(suite, "NTLMSSP self check", + torture_ntlmssp_self_check, NULL); + + return torture_run_suite(torture, suite); +} |