1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

r19680: Allow specifying basedir for test data.

Create temporary directories in base directory.
(This used to be commit f111feb1d2)
This commit is contained in:
Jelmer Vernooij 2006-11-12 03:40:38 +00:00 committed by Gerald (Jerry) Carter
parent cbbe5be832
commit 9d7856122e
3 changed files with 10 additions and 2 deletions

View File

@ -110,6 +110,7 @@ cat >$CONFFILE<<EOF
notify:inotify = false
ldb:nosync = true
torture:subunitdir = $SRCDIR/bin/torture
torture:basedir = $TEST_DATA_PREFIX
system:anonymous = true
#We don't want to pass our self-tests if the PAC code is wrong

View File

@ -519,12 +519,13 @@ int main(int argc,char *argv[])
int shell = False;
static const char *ui_ops_name = "simple";
enum {OPT_LOADFILE=1000,OPT_UNCLIST,OPT_TIMELIMIT,OPT_DNS,
OPT_DANGEROUS,OPT_SMB_PORTS,OPT_ASYNC,OPT_NUMPROGS};
OPT_DANGEROUS,OPT_SMB_PORTS,OPT_ASYNC,OPT_NUMPROGS, OPT_BASEDIR};
struct poptOption long_options[] = {
POPT_AUTOHELP
{"format", 0, POPT_ARG_STRING, &ui_ops_name, 0, "Output format (one of: simple, subunit, harness)", NULL },
{"smb-ports", 'p', POPT_ARG_STRING, NULL, OPT_SMB_PORTS, "SMB ports", NULL},
{"basedir", 0, POPT_ARG_STRING, NULL, OPT_BASEDIR, "base directory", "BSAEDIR" },
{"seed", 0, POPT_ARG_INT, &torture_seed, 0, "seed", NULL},
{"num-progs", 0, POPT_ARG_INT, NULL, OPT_NUMPROGS, "num progs", NULL},
{"num-ops", 0, POPT_ARG_INT, &torture_numops, 0, "num ops", NULL},
@ -575,6 +576,9 @@ int main(int argc,char *argv[])
case OPT_NUMPROGS:
lp_set_cmdline("torture:nprocs", poptGetOptArg(pc));
break;
case OPT_BASEDIR:
lp_set_cmdline("torture:basedir", poptGetOptArg(pc));
break;
case OPT_DNS:
parse_dns(poptGetOptArg(pc));
break;

View File

@ -31,7 +31,10 @@
_PUBLIC_ NTSTATUS torture_temp_dir(TALLOC_CTX *mem_ctx, const char *prefix,
char **tempdir)
{
*tempdir = talloc_asprintf(mem_ctx, "torture.tmp-%s.XXXXXX", prefix);
const char *basedir = lp_parm_string(-1, "torture", "basedir");
if (basedir == NULL) basedir = ".";
*tempdir = talloc_asprintf(mem_ctx, "%s/torture.tmp-%s.XXXXXX",
basedir, prefix);
if (mkdtemp(*tempdir) == NULL)
return NT_STATUS_UNSUCCESSFUL;