diff options
author | Andrew Bartlett <abartlet@samba.org> | 2003-04-22 07:30:38 +0000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2003-04-22 07:30:38 +0000 |
commit | cf86f85b088be7c6ddb8d060e93a7f3040efe342 (patch) | |
tree | 89eef2b264ecf4da408868ab4047dba56c1376d9 /source3 | |
parent | 186824a96777e9998fbb82c58e8e0ad848a9353a (diff) | |
download | samba-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')
-rw-r--r-- | source3/torture/torture.c | 9 |
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; |