summaryrefslogtreecommitdiff
path: root/source4/torture/locktest.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2008-02-15 15:33:10 +1100
committerAndrew Tridgell <tridge@samba.org>2008-02-15 15:33:10 +1100
commitc09f70608c97c5df87818f0c6297e85cf8827862 (patch)
tree9ee804daa71d71114b45b72f3dc7ca21af2e110a /source4/torture/locktest.c
parentd48dc5b2e6e45b5a0daa96b32f0b45cdf35a80e5 (diff)
downloadsamba-c09f70608c97c5df87818f0c6297e85cf8827862.tar.gz
added a blackbox test for masktest
(This used to be commit 05a110123df2372418e2ef2fd8f269b92054069c)
Diffstat (limited to 'source4/torture/locktest.c')
-rw-r--r--source4/torture/locktest.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/source4/torture/locktest.c b/source4/torture/locktest.c
index ebc325fe2b3..fb2430f8819 100644
--- a/source4/torture/locktest.c
+++ b/source4/torture/locktest.c
@@ -396,7 +396,7 @@ static int retest(struct smbcli_state *cli[NSERVERS][NCONNECTIONS],
we then do random locking ops in tamdem on the 4 fnums from each
server and ensure that the results match
*/
-static void test_locks(struct loadparm_context *lp_ctx, char *share[NSERVERS])
+static int test_locks(struct loadparm_context *lp_ctx, char *share[NSERVERS])
{
struct smbcli_state *cli[NSERVERS][NCONNECTIONS];
int fnum[NSERVERS][NCONNECTIONS][NFILES];
@@ -451,7 +451,12 @@ static void test_locks(struct loadparm_context *lp_ctx, char *share[NSERVERS])
open_files(cli, fnum);
n = retest(cli, fnum, numops);
- if (n == numops || !analyze) return;
+ if (n == numops || !analyze) {
+ if (n != numops) {
+ return 1;
+ }
+ return 0;
+ }
n++;
skip = n/2;
@@ -517,6 +522,8 @@ static void test_locks(struct loadparm_context *lp_ctx, char *share[NSERVERS])
(double)recorded[i].len,
recorded[i].needed);
}
+
+ return 1;
}
@@ -632,8 +639,6 @@ _NORETURN_ static void usage(poptContext pc)
seed, lock_base, lock_range, min_length));
srandom(seed);
- test_locks(lp_ctx, share);
-
- return(0);
+ return test_locks(lp_ctx, share);
}