summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2000-06-13 09:33:43 +0000
committerAndrew Tridgell <tridge@samba.org>2000-06-13 09:33:43 +0000
commitec33db96d510ab483989df13d4bd4e63c9d0b6b2 (patch)
treeaa09f7c51dd65fc8cbac8c06374cb3fd955f06b6 /source3
parentbf575bf2839fe795af59ddd24b1ab3451aea5699 (diff)
downloadsamba-ec33db96d510ab483989df13d4bd4e63c9d0b6b2.tar.gz
samba-ec33db96d510ab483989df13d4bd4e63c9d0b6b2.tar.bz2
samba-ec33db96d510ab483989df13d4bd4e63c9d0b6b2.zip
added -L switch to tell smbtorture to use oplocks
(This used to be commit 73033d0803317c7de017cac7f7669f4afb08e7c0)
Diffstat (limited to 'source3')
-rw-r--r--source3/utils/nbio.c2
-rw-r--r--source3/utils/torture.c9
2 files changed, 7 insertions, 4 deletions
diff --git a/source3/utils/nbio.c b/source3/utils/nbio.c
index f72be36842..973f7d0628 100644
--- a/source3/utils/nbio.c
+++ b/source3/utils/nbio.c
@@ -50,8 +50,6 @@ static void sigsegv(int sig)
void nb_setup(struct cli_state *cli)
{
signal(SIGSEGV, sigsegv);
- /* to be like a true Windows client we need to negotiate oplocks */
- cli->use_oplocks = True;
c = cli;
}
diff --git a/source3/utils/torture.c b/source3/utils/torture.c
index aa2737af30..a53ba1ce60 100644
--- a/source3/utils/torture.c
+++ b/source3/utils/torture.c
@@ -32,6 +32,7 @@ static int nprocs=1, numops=100;
static int procnum; /* records process count number when forking */
static struct cli_state current_cli;
static fstring randomfname;
+static BOOL use_oplocks;
static double create_procs(void (*fn)(int));
@@ -107,6 +108,7 @@ static BOOL open_connection(struct cli_state *c)
}
c->timeout = 120000; /* set a really long timeout (2 minutes) */
+ if (use_oplocks) c->use_oplocks = True;
if (!cli_session_request(c, &calling, &called)) {
printf("%s rejected the session\n",host);
@@ -1565,7 +1567,6 @@ static void run_maxfidtest(int dummy)
fstring fname;
int fnum;
int retries=4;
- int n = numops;
cli = current_cli;
@@ -2109,6 +2110,7 @@ static void usage(void)
printf("\t-o num_operations\n");
printf("\t-O socket_options\n");
printf("\t-m maximum protocol\n");
+ printf("\t-L use oplocks\n");
printf("\n\n");
printf("tests are:");
@@ -2180,7 +2182,7 @@ static void usage(void)
fstrcpy(workgroup, lp_workgroup());
- while ((opt = getopt(argc, argv, "hW:U:n:N:O:o:m:")) != EOF) {
+ while ((opt = getopt(argc, argv, "hW:U:n:N:O:o:m:L")) != EOF) {
switch (opt) {
case 'W':
fstrcpy(workgroup,optarg);
@@ -2197,6 +2199,9 @@ static void usage(void)
case 'O':
sockops = optarg;
break;
+ case 'L':
+ use_oplocks = True;
+ break;
case 'n':
fstrcpy(myname, optarg);
break;