summaryrefslogtreecommitdiff
path: root/source3/torture
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2003-04-22 07:30:38 +0000
committerAndrew Bartlett <abartlet@samba.org>2003-04-22 07:30:38 +0000
commitcf86f85b088be7c6ddb8d060e93a7f3040efe342 (patch)
tree89eef2b264ecf4da408868ab4047dba56c1376d9 /source3/torture
parent186824a96777e9998fbb82c58e8e0ad848a9353a (diff)
downloadsamba-cf86f85b088be7c6ddb8d060e93a7f3040efe342.tar.gz
samba-cf86f85b088be7c6ddb8d060e93a7f3040efe342.tar.bz2
samba-cf86f85b088be7c6ddb8d060e93a7f3040efe342.zip
Bail out early when we fail on the rw_torture test.
Andrew Bartlett (This used to be commit 65855d2ce920053a43882919a6ae509bbd86e54b)
Diffstat (limited to 'source3/torture')
-rw-r--r--source3/torture/torture.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index e4af6e9fcf..f85569b2af 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -499,18 +499,21 @@ static BOOL rw_torture2(struct cli_state *c1, struct cli_state *c2)
if (cli_write(c1, fnum1, 0, buf, 0, buf_size) != buf_size) {
printf("write failed (%s)\n", cli_errstr(c1));
correct = False;
+ break;
}
if ((bytes_read = cli_read(c2, fnum2, buf_rd, 0, buf_size)) != buf_size) {
printf("read failed (%s)\n", cli_errstr(c2));
printf("read %d, expected %d\n", bytes_read, buf_size);
correct = False;
+ break;
}
if (memcmp(buf_rd, buf, buf_size) != 0)
{
printf("read/write compare failed\n");
correct = False;
+ break;
}
}
@@ -547,8 +550,10 @@ static BOOL run_readwritetest(int dummy)
test1 = rw_torture2(cli1, cli2);
printf("Passed readwritetest v1: %s\n", BOOLSTR(test1));
- test2 = rw_torture2(cli1, cli1);
- printf("Passed readwritetest v2: %s\n", BOOLSTR(test2));
+ if (test1) {
+ test2 = rw_torture2(cli1, cli1);
+ printf("Passed readwritetest v2: %s\n", BOOLSTR(test2));
+ }
if (!torture_close_connection(cli1)) {
test1 = False;