summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-09-07 10:32:53 +0200
committerStefan Metzmacher <metze@samba.org>2011-09-07 10:38:02 +0200
commitfce8ef69d352c16a5a9781c7a3288d153da3b32b (patch)
treed1e9e370b5cbaa0e56bed4f20bffac5453e2c1a3
parent674f9cc1d9f45a955802571936ff275e0444b2ea (diff)
downloadsamba-fce8ef69d352c16a5a9781c7a3288d153da3b32b.tar.gz
samba-fce8ef69d352c16a5a9781c7a3288d153da3b32b.tar.bz2
samba-fce8ef69d352c16a5a9781c7a3288d153da3b32b.zip
s4:torture/basic: relax base.trans2 midmight time checking
It's possible that the test runs on a full hour, e.g. Tue Sep 6 03:00:00 2011. So better check that the a_time is different from the current time. metze
-rw-r--r--source4/torture/basic/base.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source4/torture/basic/base.c b/source4/torture/basic/base.c
index 3e405f7d09..10dc892333 100644
--- a/source4/torture/basic/base.c
+++ b/source4/torture/basic/base.c
@@ -274,18 +274,20 @@ static bool run_trans2test(struct torture_context *tctx,
torture_comment(tctx, "ERROR: qpathinfo failed (%s)\n", smbcli_errstr(cli->tree));
correct = false;
} else {
+ time_t t = time(NULL);
+
if (c_time != m_time) {
torture_comment(tctx, "create time=%s", ctime(&c_time));
torture_comment(tctx, "modify time=%s", ctime(&m_time));
torture_comment(tctx, "This system appears to have sticky create times\n");
}
- if (a_time % (60*60) == 0) {
+ if ((abs(a_time - t) > 60) && (a_time % (60*60) == 0)) {
torture_comment(tctx, "access time=%s", ctime(&a_time));
torture_comment(tctx, "This system appears to set a midnight access time\n");
correct = false;
}
- if (abs(m_time - time(NULL)) > 60*60*24*7) {
+ if (abs(m_time - t) > 60*60*24*7) {
torture_comment(tctx, "ERROR: totally incorrect times - maybe word reversed? mtime=%s", ctime(&m_time));
correct = false;
}