summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2008-01-25 15:45:18 +0100
committerStefan Metzmacher <metze@samba.org>2008-01-25 15:47:00 +0100
commit20f5e6ad9b6d6afe0ea74de722ae46c4627e68ee (patch)
tree69bfe6324c389f0ec8166efb5b212027b65fee5a /source4/torture
parentd1ed962897b0b0c20cdbcc5b25df1f2be4171067 (diff)
downloadsamba-20f5e6ad9b6d6afe0ea74de722ae46c4627e68ee.tar.gz
samba-20f5e6ad9b6d6afe0ea74de722ae46c4627e68ee.tar.bz2
samba-20f5e6ad9b6d6afe0ea74de722ae46c4627e68ee.zip
NET-BECOME-DC: always try to build ejs and python code
We let getenv("PROVISION_PYTHON") decide what we want at runtime. metze (This used to be commit acb5661f61ad62c02b5ec83d0f1f0c969f356c9f)
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/libnet/libnet_BecomeDC.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/source4/torture/libnet/libnet_BecomeDC.c b/source4/torture/libnet/libnet_BecomeDC.c
index d9645356e8..0ef6a03a6a 100644
--- a/source4/torture/libnet/libnet_BecomeDC.c
+++ b/source4/torture/libnet/libnet_BecomeDC.c
@@ -90,7 +90,6 @@ static NTSTATUS test_become_dc_check_options(void *private_data,
return NT_STATUS_OK;
}
-#ifndef PROVISION_PYTHON
#include "lib/appweb/ejs/ejs.h"
#include "lib/appweb/ejs/ejsInternal.h"
#include "scripting/ejs/smbcalls.h"
@@ -148,14 +147,16 @@ failed:
return ejs_error;
}
-static NTSTATUS test_become_dc_prepare_db(void *private_data,
- const struct libnet_BecomeDC_PrepareDB *p)
+static NTSTATUS test_become_dc_prepare_db_ejs(void *private_data,
+ const struct libnet_BecomeDC_PrepareDB *p)
{
struct test_become_dc_state *s = talloc_get_type(private_data, struct test_become_dc_state);
char *ejs;
int ret;
bool ok;
+ DEBUG(0,("Provision for Become-DC test using EJS\n"));
+
DEBUG(0,("New Server[%s] in Site[%s]\n",
p->dest_dsa->dns_name, p->dest_dsa->site_name));
@@ -274,18 +275,20 @@ static NTSTATUS test_become_dc_prepare_db(void *private_data,
return NT_STATUS_OK;
}
-#else
+#ifdef HAVE_WORKING_PYTHON
#include "param/param.h"
#include <Python.h>
#include "scripting/python/modules.h"
-static NTSTATUS test_become_dc_prepare_db(void *private_data,
- const struct libnet_BecomeDC_PrepareDB *p)
+static NTSTATUS test_become_dc_prepare_db_py(void *private_data,
+ const struct libnet_BecomeDC_PrepareDB *p)
{
struct test_become_dc_state *s = talloc_get_type(private_data, struct test_become_dc_state);
bool ok;
PyObject *provision_fn, *result, *parameters;
+ DEBUG(0,("Provision for Become-DC test using PYTHON\n"));
+
py_load_samba_modules();
Py_Initialize();
@@ -378,8 +381,7 @@ static NTSTATUS test_become_dc_prepare_db(void *private_data,
return NT_STATUS_OK;
}
-
-#endif
+#endif /* HAVE_WORKING_PYTHON */
static NTSTATUS test_apply_schema(struct test_become_dc_state *s,
const struct libnet_BecomeDC_StoreChunk *c)
@@ -876,7 +878,12 @@ bool torture_net_become_dc(struct torture_context *torture)
b.in.callbacks.private_data = s;
b.in.callbacks.check_options = test_become_dc_check_options;
- b.in.callbacks.prepare_db = test_become_dc_prepare_db;
+ b.in.callbacks.prepare_db = test_become_dc_prepare_db_ejs;
+#ifdef HAVE_WORKING_PYTHON
+ if (getenv("PROVISION_PYTHON")) {
+ b.in.callbacks.prepare_db = test_become_dc_prepare_db_py;
+ }
+#endif
b.in.callbacks.schema_chunk = test_become_dc_schema_chunk;
b.in.callbacks.config_chunk = test_become_dc_store_chunk;
b.in.callbacks.domain_chunk = test_become_dc_store_chunk;