summaryrefslogtreecommitdiff
path: root/source3/torture
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2001-07-07 06:21:32 +0000
committerAndrew Bartlett <abartlet@samba.org>2001-07-07 06:21:32 +0000
commitcd41846aa541ed19b5809c5de311426069e60605 (patch)
treecaa589b8a3b40caac70f945b46ba2716288bea15 /source3/torture
parent429b3c3cc5ea810d03716a1efd81140c772c15ee (diff)
downloadsamba-cd41846aa541ed19b5809c5de311426069e60605.tar.gz
samba-cd41846aa541ed19b5809c5de311426069e60605.tar.bz2
samba-cd41846aa541ed19b5809c5de311426069e60605.zip
Update smbtorture in line with SAMBA_2_2
Andrew Bartlett (This used to be commit dc588ee87ae16e207324d42f926d7889b70362de)
Diffstat (limited to 'source3/torture')
-rw-r--r--source3/torture/torture.c39
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)) {