summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjörn Baumbach <bb@sernet.de>2011-07-11 14:05:14 +0200
committerStefan Metzmacher <metze@samba.org>2011-07-11 16:35:10 +0200
commitc9f604543bd771c94e5f4990a6b5beccd3322d74 (patch)
tree3f01372450ae16bfca10d25999598d54af1f4f1f
parent23b417b4c0e867913f47bc5e65c99eb395f47970 (diff)
downloadsamba-c9f604543bd771c94e5f4990a6b5beccd3322d74.tar.gz
samba-c9f604543bd771c94e5f4990a6b5beccd3322d74.tar.bz2
samba-c9f604543bd771c94e5f4990a6b5beccd3322d74.zip
s3-torture: run_locktest1(): replace cli_lock() with cli_lock32()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
-rw-r--r--source3/torture/torture.c42
1 files changed, 25 insertions, 17 deletions
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index 41ea8c1ad8..20e92b1dbd 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -1236,30 +1236,35 @@ static bool run_locktest1(int dummy)
return False;
}
- if (!cli_lock(cli1, fnum1, 0, 4, 0, WRITE_LOCK)) {
- printf("lock1 failed (%s)\n", cli_errstr(cli1));
- return False;
+ status = cli_lock32(cli1, fnum1, 0, 4, 0, WRITE_LOCK);
+ if (!NT_STATUS_IS_OK(status)) {
+ printf("lock1 failed (%s)\n", nt_errstr(status));
+ return false;
}
-
- if (cli_lock(cli2, fnum3, 0, 4, 0, WRITE_LOCK)) {
+ status = cli_lock32(cli2, fnum3, 0, 4, 0, WRITE_LOCK);
+ if (NT_STATUS_IS_OK(status)) {
printf("lock2 succeeded! This is a locking bug\n");
- return False;
+ return false;
} else {
- if (!check_error(__LINE__, cli2, ERRDOS, ERRlock,
- NT_STATUS_LOCK_NOT_GRANTED)) return False;
+ if (!check_both_error(__LINE__, status, ERRDOS, ERRlock,
+ NT_STATUS_LOCK_NOT_GRANTED)) {
+ return false;
+ }
}
-
lock_timeout = (1 + (random() % 20));
printf("Testing lock timeout with timeout=%u\n", lock_timeout);
t1 = time(NULL);
- if (cli_lock(cli2, fnum3, 0, 4, lock_timeout * 1000, WRITE_LOCK)) {
+ status = cli_lock32(cli2, fnum3, 0, 4, lock_timeout * 1000, WRITE_LOCK);
+ if (NT_STATUS_IS_OK(status)) {
printf("lock3 succeeded! This is a locking bug\n");
- return False;
+ return false;
} else {
- if (!check_error(__LINE__, cli2, ERRDOS, ERRlock,
- NT_STATUS_FILE_LOCK_CONFLICT)) return False;
+ if (!check_both_error(__LINE__, status, ERRDOS, ERRlock,
+ NT_STATUS_FILE_LOCK_CONFLICT)) {
+ return false;
+ }
}
t2 = time(NULL);
@@ -1276,12 +1281,15 @@ static bool run_locktest1(int dummy)
return False;
}
- if (cli_lock(cli2, fnum3, 0, 4, 0, WRITE_LOCK)) {
+ status = cli_lock32(cli2, fnum3, 0, 4, 0, WRITE_LOCK);
+ if (NT_STATUS_IS_OK(status)) {
printf("lock4 succeeded! This is a locking bug\n");
- return False;
+ return false;
} else {
- if (!check_error(__LINE__, cli2, ERRDOS, ERRlock,
- NT_STATUS_FILE_LOCK_CONFLICT)) return False;
+ if (!check_both_error(__LINE__, status, ERRDOS, ERRlock,
+ NT_STATUS_FILE_LOCK_CONFLICT)) {
+ return false;
+ }
}
status = cli_close(cli1, fnum1);