summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorKamen Mazdrashki <kamen.mazdrashki@postpath.com>2009-09-10 13:47:14 +0300
committerAndrew Bartlett <abartlet@samba.org>2009-09-11 07:29:56 +1000
commit0c8eee971172f74a896d9e8c499efd9805491fd9 (patch)
tree235717a1144692fd5e825f07356470176568ffd3 /source4
parentbebeb4ff701caa353d82dc7c2c9cb4555aff101f (diff)
downloadsamba-0c8eee971172f74a896d9e8c499efd9805491fd9.tar.gz
samba-0c8eee971172f74a896d9e8c499efd9805491fd9.tar.bz2
samba-0c8eee971172f74a896d9e8c499efd9805491fd9.zip
s4/tort: CRACKNAMES tests to use private structure for testing.
DsCrackNamesPrivate structure basically inherits DsPrivate structure while adding few test-specific members.
Diffstat (limited to 'source4')
-rw-r--r--source4/torture/rpc/drsuapi_cracknames.c35
1 files changed, 33 insertions, 2 deletions
diff --git a/source4/torture/rpc/drsuapi_cracknames.c b/source4/torture/rpc/drsuapi_cracknames.c
index b49a006e80..c14776b255 100644
--- a/source4/torture/rpc/drsuapi_cracknames.c
+++ b/source4/torture/rpc/drsuapi_cracknames.c
@@ -28,6 +28,15 @@
#include "ldb/include/ldb.h"
#include "libcli/security/security.h"
+struct DsCrackNamesPrivate {
+ struct DsPrivate base;
+
+ /* following names are used in Crack Names Matrix test */
+ const char *fqdn_name;
+ const char *user_principal_name;
+ const char *service_principal_name;
+};
+
static bool test_DsCrackNamesMatrix(struct torture_context *tctx,
struct DsPrivate *priv, const char *dn,
const char *user_principal_name, const char *service_principal_name)
@@ -1008,6 +1017,28 @@ bool test_DsCrackNames(struct torture_context *tctx,
}
/**
+ * Test case setup for CrackNames
+ */
+static bool torture_drsuapi_cracknames_setup(struct torture_context *tctx, void **data)
+{
+ struct DsCrackNamesPrivate *priv;
+
+ *data = priv = talloc_zero(tctx, struct DsCrackNamesPrivate);
+
+ return torture_drsuapi_tcase_setup_common(tctx, &priv->base);
+}
+
+/**
+ * Test case tear-down for CrackNames
+ */
+static bool torture_drsuapi_cracknames_teardown(struct torture_context *tctx, void *data)
+{
+ struct DsCrackNamesPrivate *priv = talloc_get_type(data, struct DsCrackNamesPrivate);
+
+ return torture_drsuapi_tcase_teardown_common(tctx, &priv->base);
+}
+
+/**
* CRACKNAMES test suite implementation
*/
void torture_rpc_drsuapi_cracknames_tcase(struct torture_suite *suite)
@@ -1018,8 +1049,8 @@ void torture_rpc_drsuapi_cracknames_tcase(struct torture_suite *suite)
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);
+ torture_drsuapi_cracknames_setup,
+ torture_drsuapi_cracknames_teardown);
test = torture_tcase_add_simple_test(tcase, "CRACKNAMES-TEST", (run_func)test_DsCrackNames);
}