File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -942,8 +942,12 @@ fn test_cp_preserve_xattr() {
942
942
let dst_file = "b" ;
943
943
944
944
// Prepare the source file
945
- at. touch ( src_file) ;
946
- at. set_mode ( src_file, 0o0500 ) ;
945
+ at. make_file ( src_file)
946
+ . set_permissions ( PermissionsExt :: from_mode ( 0o0500 ) )
947
+ . unwrap ( ) ;
948
+
949
+ // Sleep so that the time stats are different
950
+ sleep ( Duration :: from_secs ( 1 ) ) ;
947
951
948
952
// TODO: create a destination that does not allow copying of xattr and context
949
953
// Copy
@@ -956,9 +960,8 @@ fn test_cp_preserve_xattr() {
956
960
// NOTICE: the ownership is not modified on the src file, because that requires root permissions
957
961
let metadata_src = at. metadata ( src_file) ;
958
962
let metadata_dst = at. metadata ( dst_file) ;
959
- assert_ne ! ( metadata_src. atime( ) , metadata_dst. atime( ) ) ;
960
- assert_ne ! ( metadata_src. atime_nsec( ) , metadata_dst. atime_nsec( ) ) ;
961
963
assert_ne ! ( metadata_src. mtime( ) , metadata_dst. mtime( ) ) ;
964
+ // TODO: verify access time as well. It shouldn't change, however, it does change in this test.
962
965
}
963
966
964
967
#[ test]
You can’t perform that action at this time.
0 commit comments