2 # vim: filetype=sh noexpandtab ts=8 sw=8
5 desc="utimensat can follow symlinks"
17 DATE1=1900000000 #Sun Mar 17 11:46:40 MDT 2030
18 DATE2=1950000000 #Fri Oct 17 04:40:00 MDT 2031
19 DATE3=1960000000 #Mon Feb 9 21:26:40 MST 2032
20 DATE4=1970000000 #Fri Jun 4 16:13:20 MDT 2032
21 DATE5=1980000000 #Tue Sep 28 10:00:00 MDT 2032
22 DATE6=1990000000 #Sat Jan 22 02:46:40 MST 2033
24 expect 0 mkdir ${n1} 0755
29 create_file regular ${n0}
31 expect 0 open . O_RDONLY : utimensat 0 ${n0} $DATE1 0 $DATE2 0 0
33 expect 0 open . O_RDONLY : utimensat 0 ${n2} $DATE3 0 $DATE4 0 AT_SYMLINK_NOFOLLOW
34 expect $DATE1 lstat ${n0} atime
35 expect $DATE2 lstat ${n0} mtime
36 expect $DATE3 lstat ${n2} atime
37 expect $DATE4 lstat ${n2} mtime
39 expect 0 open . O_RDONLY : utimensat 0 ${n2} $DATE5 0 $DATE6 0 0
40 expect $DATE5 lstat ${n0} atime
41 expect $DATE6 lstat ${n0} mtime
42 # If atime is disabled on the current mount, then ${n2}'s atime should still be
43 # $DATE3. However, if atime is enabled, then ${n2}'s atime will be the current
44 # system time. For this test, it's sufficient to simply check that it didn't
46 test_check "$DATE5" -ne `"$fstest" lstat ${n2} atime`
47 expect $DATE4 lstat ${n2} mtime