diff options
author | Michael Adam <obnox@samba.org> | 2008-04-08 12:07:35 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2008-04-10 01:28:57 +0200 |
commit | e251327b5b871e5887fc1c4c4605b92bf09a5840 (patch) | |
tree | 99562cd1945e9448a7513f01e5a1373ef9634efa /source3/lib/smbconf | |
parent | b7377c33a3a43900a092b8cf9c406f4f5bc03c80 (diff) | |
download | samba-e251327b5b871e5887fc1c4c4605b92bf09a5840.tar.gz samba-e251327b5b871e5887fc1c4c4605b92bf09a5840.tar.bz2 samba-e251327b5b871e5887fc1c4c4605b92bf09a5840.zip |
libsmbconf: testsuite: add support for "--configfile" option.
Michael
(This used to be commit 9f6c909f465df5fc64e2bec88acf272be9cd574e)
Diffstat (limited to 'source3/lib/smbconf')
-rw-r--r-- | source3/lib/smbconf/testsuite.c | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/source3/lib/smbconf/testsuite.c b/source3/lib/smbconf/testsuite.c index 16f3532cec..faf4cb9e15 100644 --- a/source3/lib/smbconf/testsuite.c +++ b/source3/lib/smbconf/testsuite.c @@ -89,6 +89,37 @@ static bool torture_smbconf(void) int main(int argc, const char **argv) { - bool ret = torture_smbconf(); + bool ret; + poptContext pc; + + struct poptOption long_options[] = { + POPT_COMMON_CONFIGFILE + {0, 0, 0, 0} + }; + + load_case_tables(); + + /* parse options */ + pc = poptGetContext("smbconftort", argc, (const char **)argv, + long_options, 0); + + while(poptGetNextOpt(pc) != -1) { } + + poptFreeContext(pc); + + ret = lp_load(get_dyn_CONFIGFILE(), + true, /* globals_only */ + false, /* save_defaults */ + false, /* add_ipc */ + true /* initialize globals */); + + if (!ret) { + printf("failure: error loading the configuration\n"); + goto done; + } + + ret = torture_smbconf(); + +done: return ret ? 0 : -1; } |