diff options
-rw-r--r-- | source3/torture/torture.c | 39 |
1 files changed, 34 insertions, 5 deletions
diff --git a/source3/torture/torture.c b/source3/torture/torture.c index fcf48e0560..c1eb4371f6 100644 --- a/source3/torture/torture.c +++ b/source3/torture/torture.c @@ -566,10 +566,10 @@ static BOOL run_readwritelarge(int dummy) } if (fsize == sizeof(buf)) - printf("readwritelarge test succeeded (size = %x)\n", fsize); + printf("readwritelarge test 1 succeeded (size = %x)\n", fsize); else { - printf("readwritelarge test failed (size = %x)\n", fsize); - correct = False; + printf("readwritelarge test 1 failed (size = %x)\n", fsize); + correct = False; } if (!cli_unlink(&cli1, lockfname)) { @@ -577,11 +577,24 @@ static BOOL run_readwritelarge(int dummy) correct = False; } + fnum1 = cli_open(&cli1, lockfname, O_RDWR | O_CREAT | O_EXCL, DENY_NONE); + if (fnum1 == -1) { + printf("open read/write of %s failed (%s)\n", lockfname, cli_errstr(&cli1)); + return False; + } + + cli_smbwrite(&cli1, fnum1, buf, 0, sizeof(buf)); + + if (!cli_close(&cli1, fnum1)) { + printf("close failed (%s)\n", cli_errstr(&cli1)); + correct = False; + } + if (!close_connection(&cli1)) { correct = False; } return correct; -} + } int line_count = 0; @@ -981,11 +994,27 @@ static BOOL run_locktest2(int dummy) if (!check_error(&cli, ERRDOS, ERRlock, 0)) return False; } + if (!cli_lock(&cli, fnum1, 100, 4, 0, WRITE_LOCK)) { + printf("lock at 100 failed (%s)\n", cli_errstr(&cli)); + } cli_setpid(&cli, 2); + if (cli_unlock(&cli, fnum1, 100, 4)) { + printf("unlock at 100 succeeded! This is a locking bug\n"); + correct = False; + } - if (cli_unlock(&cli, fnum1, 0, 8)) { + if (cli_unlock(&cli, fnum1, 0, 4)) { printf("unlock1 succeeded! This is a locking bug\n"); correct = False; + } else { + if (!check_error(&cli, ERRDOS, ERRnotlocked, 0)) return False; + } + + if (cli_unlock(&cli, fnum1, 0, 8)) { + printf("unlock2 succeeded! This is a locking bug\n"); + correct = False; + } else { + if (!check_error(&cli, ERRDOS, ERRnotlocked, 0)) return False; } if (cli_lock(&cli, fnum3, 0, 4, 0, WRITE_LOCK)) { |