diff options
author | Jeremy Allison <jra@samba.org> | 2006-07-19 16:44:50 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:10:14 -0500 |
commit | 8de86d192a93ab7981741121281ae7ddcb79279d (patch) | |
tree | d597e4ad8aa6e0faafb3985da4efb77de43553a6 /source4/torture/util_smb.c | |
parent | 3ff21a0cd7cff222a835f4cc09f4f9ebb66926df (diff) | |
download | samba-8de86d192a93ab7981741121281ae7ddcb79279d.tar.gz samba-8de86d192a93ab7981741121281ae7ddcb79279d.tar.bz2 samba-8de86d192a93ab7981741121281ae7ddcb79279d.zip |
r17139: Checking in Volker's extended oplock test.
Jeremy
(This used to be commit 720c425af167373aaedf739d1d7794ada3fcddf6)
Diffstat (limited to 'source4/torture/util_smb.c')
-rw-r--r-- | source4/torture/util_smb.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/source4/torture/util_smb.c b/source4/torture/util_smb.c index a4e8e198bb..f292165a0c 100644 --- a/source4/torture/util_smb.c +++ b/source4/torture/util_smb.c @@ -512,11 +512,35 @@ _PUBLIC_ BOOL torture_open_connection(struct smbcli_state **c, int conn_index) return torture_open_connection_share(NULL, c, host, share, NULL); } -_PUBLIC_ BOOL torture_open_connection_ev(struct smbcli_state **c, +_PUBLIC_ BOOL torture_open_connection_ev(struct smbcli_state **c, + int conn_index, struct event_context *ev) { const char *host = lp_parm_string(-1, "torture", "host"); const char *share = lp_parm_string(-1, "torture", "share"); + char **unc_list = NULL; + int num_unc_names = 0; + const char *p; + + p = lp_parm_string(-1, "torture", "unclist"); + if (p) { + char *h, *s; + unc_list = file_lines_load(p, &num_unc_names, NULL); + if (!unc_list || num_unc_names <= 0) { + printf("Failed to load unc names list from '%s'\n", p); + exit(1); + } + + if (!smbcli_parse_unc(unc_list[conn_index % num_unc_names], + NULL, &h, &s)) { + printf("Failed to parse UNC name %s\n", + unc_list[conn_index % num_unc_names]); + exit(1); + } + host = h; + share = s; + } + return torture_open_connection_share(NULL, c, host, share, ev); } |