summaryrefslogtreecommitdiff
path: root/source3/torture
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
commitfcd0c0e19ea039edb968d9ddaf6c1350dca596b8 (patch)
tree52f3f07bcb9b76ecfea69f128f9c30a6cc08560b /source3/torture
parentfce8ef69d352c16a5a9781c7a3288d153da3b32b (diff)
downloadsamba-fcd0c0e19ea039edb968d9ddaf6c1350dca596b8.tar.gz
samba-fcd0c0e19ea039edb968d9ddaf6c1350dca596b8.tar.bz2
samba-fcd0c0e19ea039edb968d9ddaf6c1350dca596b8.zip
s3:torture: relax 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
Diffstat (limited to 'source3/torture')
-rw-r--r--source3/torture/torture.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index 888bcb1c86..f07026d17a 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -3323,18 +3323,20 @@ static bool run_trans2test(int dummy)
printf("ERROR: qpathinfo failed (%s)\n", nt_errstr(status));
correct = False;
} else {
+ time_t t = time(NULL);
+
if (c_time != m_time) {
printf("create time=%s", ctime(&c_time));
printf("modify time=%s", ctime(&m_time));
printf("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)) {
printf("access time=%s", ctime(&a_time));
printf("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) {
printf("ERROR: totally incorrect times - maybe word reversed? mtime=%s", ctime(&m_time));
correct = False;
}