summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamen Mazdrashki <kamen.mazdrashki@postpath.com>2009-10-08 02:56:22 +0300
committerAnatoliy Atanasov <anatoliy.atanasov@postpath.com>2009-10-16 12:54:14 +0300
commit421191a4433e289adf6c2d9739d1ce091af3774f (patch)
treef3b9a9b5cbd63896434af98c63c1ebfbdf1c0663
parent784e0c199e8b083865ac96930c3b55d709a2bec5 (diff)
downloadsamba-421191a4433e289adf6c2d9739d1ce091af3774f.tar.gz
samba-421191a4433e289adf6c2d9739d1ce091af3774f.tar.bz2
samba-421191a4433e289adf6c2d9739d1ce091af3774f.zip
s4/drs(tort): prefixMap unit test initial implementatoin
-rw-r--r--source4/torture/drs/config.mk3
-rw-r--r--source4/torture/drs/drs_init.c2
-rw-r--r--source4/torture/drs/internal/prefixmap_tests.c80
3 files changed, 84 insertions, 1 deletions
diff --git a/source4/torture/drs/config.mk b/source4/torture/drs/config.mk
index a03034b5eb..14f673ec7a 100644
--- a/source4/torture/drs/config.mk
+++ b/source4/torture/drs/config.mk
@@ -18,6 +18,7 @@ PRIVATE_DEPENDENCIES = \
TORTURE_DRS_OBJ_FILES = \
$(torturesrcdir)/drs/drs_init.o \
- $(torturesrcdir)/drs/drs_util.o
+ $(torturesrcdir)/drs/drs_util.o \
+ $(torturesrcdir)/drs/internal/prefixmap_tests.o
$(eval $(call proto_header_template,$(torturesrcdir)/drs/proto.h,$(TORTURE_DRS_OBJ_FILES:.o=.c)))
diff --git a/source4/torture/drs/drs_init.c b/source4/torture/drs/drs_init.c
index 7c7581326f..081565fc57 100644
--- a/source4/torture/drs/drs_init.c
+++ b/source4/torture/drs/drs_init.c
@@ -45,6 +45,8 @@ static struct torture_suite * torture_drs_unit_suite(TALLOC_CTX *mem_ctx)
talloc_autofree_context(),
"UNIT");
+ torture_drs_unit_prefixmap(suite);
+
return suite;
}
diff --git a/source4/torture/drs/internal/prefixmap_tests.c b/source4/torture/drs/internal/prefixmap_tests.c
new file mode 100644
index 0000000000..00a4312d56
--- /dev/null
+++ b/source4/torture/drs/internal/prefixmap_tests.c
@@ -0,0 +1,80 @@
+/*
+ Unix SMB/CIFS implementation.
+
+ DRSUAPI prefixMap unit tests
+
+ Copyright (C) Kamen Mazdrashki <kamen.mazdrashki@postpath.com> 2009
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "includes.h"
+#include "torture/smbtorture.h"
+#include "torture/rpc/drsuapi.h"
+#include "torture/drs/proto.h"
+#include "dsdb/samdb/samdb.h"
+#include "dsdb/schema/prefixmap.h"
+
+
+/**
+ * Private data to be shared among all test in Test case
+ */
+struct drsut_prefixmap_data {
+ struct dsdb_schema_prefixmap *prefixmap;
+};
+
+
+/**
+ * Initial prefix map creation function
+ *
+ */
+static struct dsdb_schema_prefixmap * _drsut_prefixmap_new(struct torture_context *tctx)
+{
+ return NULL;
+}
+
+/*
+ * Setup/Teardown for test case
+ */
+static bool torture_drs_unit_prefixmap_setup(struct torture_context *tctx, struct drsut_prefixmap_data **priv)
+{
+ *priv = talloc_zero(tctx, struct drsut_prefixmap_data);
+ (*priv)->prefixmap = _drsut_prefixmap_new(tctx);
+ return true;
+}
+
+static bool torture_drs_unit_prefixmap_teardown(struct torture_context *tctx, struct drsut_prefixmap_data *priv)
+{
+ return true;
+}
+
+/**
+ * Test case initialization for
+ * DRS-UNIT.prefixMap
+ */
+struct torture_tcase * torture_drs_unit_prefixmap(struct torture_suite *suite)
+{
+ typedef bool (*pfn_setup)(struct torture_context *, void **);
+ typedef bool (*pfn_teardown)(struct torture_context *, void *);
+
+ struct torture_tcase * tc = torture_suite_add_tcase(suite, "prefixMap");
+
+ torture_tcase_set_fixture(tc,
+ (pfn_setup)torture_drs_unit_prefixmap_setup,
+ (pfn_teardown)torture_drs_unit_prefixmap_teardown);
+
+ tc->description = talloc_strdup(tc, "Unit tests for DRSUAPI::prefixMap implementation");
+
+ return tc;
+}