s4/torture: fix timeval wrap in torture_libsmbclient_utimes() test
authorRalph Boehme <slow@samba.org>
Fri, 10 Apr 2020 11:51:39 +0000 (13:51 +0200)
committerRalph Boehme <slow@samba.org>
Sat, 11 Apr 2020 12:23:59 +0000 (12:23 +0000)
Fixes the following flapping test:

UNEXPECTED(failure): samba4.libsmbclient.utimes.SMB3.utimes(nt4_dc)
REASON: Exception: Exception: ../../source4/torture/libsmbclient/libsmbclient.c:1249:
    st.st_mtim.tv_nsec / 1000 was 98181 (0x17F85),
    expected 1098181 (0x10C1C5): smbc_utimes did not update msec

https://gitlab.com/samba-team/devel/samba/-/jobs/506361470

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Sat Apr 11 12:24:00 UTC 2020 on sn-devel-184

source4/torture/libsmbclient/libsmbclient.c

index b09dde23c327bdb17522ee9af4d2b8533d09e581..18a1af3164b037f313f87952d89a58bbd1806665 100644 (file)
@@ -1234,7 +1234,7 @@ static bool torture_libsmbclient_utimes(struct torture_context *tctx)
        tbuf[0] = convert_timespec_to_timeval(st.st_atim);
        tbuf[1] = convert_timespec_to_timeval(st.st_mtim);
 
-       tbuf[1].tv_usec += 100000; /* 100 msec */
+       tbuf[1] = timeval_add(&tbuf[1], 0, 100000); /* 100 msec */
 
        ret = smbc_utimes(smburl, tbuf);
        torture_assert_int_not_equal(tctx, ret, -1, "smbc_utimes failed");