mirror of
https://github.com/samba-team/samba.git
synced 2025-03-08 04:58:40 +03:00
s4/torture: use time_mono for delta time
This commit is contained in:
parent
d4d34bddd7
commit
478ac36b9c
@ -106,14 +106,14 @@ static bool torture_locktest1(struct torture_context *tctx,
|
|||||||
lock_timeout = (6 + (random() % 20));
|
lock_timeout = (6 + (random() % 20));
|
||||||
torture_comment(tctx, "Testing lock timeout with timeout=%u\n",
|
torture_comment(tctx, "Testing lock timeout with timeout=%u\n",
|
||||||
lock_timeout);
|
lock_timeout);
|
||||||
t1 = time(NULL);
|
t1 = time_mono(NULL);
|
||||||
torture_assert(tctx,
|
torture_assert(tctx,
|
||||||
!NT_STATUS_IS_OK(smbcli_lock(cli2->tree, fnum3, 0, 4, lock_timeout * 1000, WRITE_LOCK)),
|
!NT_STATUS_IS_OK(smbcli_lock(cli2->tree, fnum3, 0, 4, lock_timeout * 1000, WRITE_LOCK)),
|
||||||
"lock3 succeeded! This is a locking bug\n");
|
"lock3 succeeded! This is a locking bug\n");
|
||||||
|
|
||||||
if (!check_error(__location__, cli2, ERRDOS, ERRlock,
|
if (!check_error(__location__, cli2, ERRDOS, ERRlock,
|
||||||
NT_STATUS_FILE_LOCK_CONFLICT)) return false;
|
NT_STATUS_FILE_LOCK_CONFLICT)) return false;
|
||||||
t2 = time(NULL);
|
t2 = time_mono(NULL);
|
||||||
|
|
||||||
if (t2 - t1 < 5) {
|
if (t2 - t1 < 5) {
|
||||||
torture_fail(tctx,
|
torture_fail(tctx,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user