From 948ccad21aba791cff56026d310b5d70858b34e6 Mon Sep 17 00:00:00 2001
From: Kamen Mazdrashki <kamen.mazdrashki@postpath.com>
Date: Fri, 28 Aug 2009 18:35:31 +0300
Subject: [PATCH] tort: RPC-CRACKNAMES test case refactored

---
 source4/torture/rpc/drsuapi_cracknames.c |   17 +++++++++++++++++
 source4/torture/rpc/rpc.c                |    2 +-
 2 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/source4/torture/rpc/drsuapi_cracknames.c b/source4/torture/rpc/drsuapi_cracknames.c
index 42373a8..5377882 100644
--- a/source4/torture/rpc/drsuapi_cracknames.c
+++ b/source4/torture/rpc/drsuapi_cracknames.c
@@ -1002,3 +1002,20 @@ bool test_DsCrackNames(struct torture_context *tctx,
 	return test_DsCrackNamesMatrix(tctx, priv, FQDN_1779_name,
 					user_principal_name, service_principal_name);
 }
+
+/**
+ * CRACKNAMES test suite implementation
+ */
+void torture_rpc_drsuapi_cracknames_tcase(struct torture_suite *suite)
+{
+	typedef bool (*run_func) (struct torture_context *test, void *tcase_data);
+
+	struct torture_test *test;
+	struct torture_tcase *tcase = torture_suite_add_tcase(suite, "CRACKNAMES");
+
+	torture_tcase_set_fixture(tcase,
+				  torture_rpc_drsuapi_tcase_setup,
+				  torture_rpc_drsuapi_tcase_teardown);
+
+	test = torture_tcase_add_simple_test(tcase, "CRACKNAMES-TEST", (run_func)test_DsCrackNames);
+}
diff --git a/source4/torture/rpc/rpc.c b/source4/torture/rpc/rpc.c
index ffdd748..e58fd85 100644
--- a/source4/torture/rpc/rpc.c
+++ b/source4/torture/rpc/rpc.c
@@ -489,7 +489,7 @@ NTSTATUS torture_rpc_init(void)
 	torture_suite_add_simple_test(suite, "SAMBA3-WKSSVC", torture_samba3_rpc_wkssvc);
 	torture_suite_add_simple_test(suite, "SAMBA3-WINREG", torture_samba3_rpc_winreg);
 	torture_suite_add_simple_test(suite, "DRSUAPI", torture_rpc_drsuapi);
-	torture_suite_add_simple_test(suite, "CRACKNAMES", torture_rpc_drsuapi_cracknames);
+	torture_rpc_drsuapi_cracknames_tcase(suite);
 	torture_suite_add_suite(suite, torture_rpc_dssetup(suite));
 	torture_suite_add_suite(suite, torture_rpc_browser(suite));
 	torture_suite_add_simple_test(suite, "SAMBA3-REGCONFIG", torture_samba3_regconfig);
-- 
1.6.0.4
