Skip to content

Instantly share code, notes, and snippets.

@anarazel
Created October 19, 2022 03:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anarazel/dd41c300be9fd0aeb0e5086d515df965 to your computer and use it in GitHub Desktop.
Save anarazel/dd41c300be9fd0aeb0e5086d515df965 to your computer and use it in GitHub Desktop.
ok 1 - traditional Windows unlink semantics detected: O_EXCL -> EEXIST
ok 2 - symlink fails on missing parent
ok 3 - errno == ENOENT
could not set junction for "\??\z:\testdata\dir1\my_subdir": Access is denied.
not ok 4 - create symlink (at ../src/port/t/001_filesystem.c:214), error: Permission denied
not ok 5 - readlink succeeds (at ../src/port/t/001_filesystem.c:217), error: No such file or directory
not ok 6 - readlink reports expected size: -1 != 26 (at ../src/port/t/001_filesystem.c:218)
not ok 7 - readlink reports expected target: "z:\testdata\dir1\my_subdir" vs "" (at ../src/port/t/001_filesystem.c:224)
ok 8 - readlink fails on missing path
ok 9 - errno == ENOENT
could not set junction for "\??\c:\foo": Access is denied.
not ok 10 - symlink("c:\\foo", path2) == 0 (at ../src/port/t/001_filesystem.c:240), error: Permission denied
not ok 11 - readlink succeeds (at ../src/port/t/001_filesystem.c:242), error: No such file or directory
not ok 12 - size == 6: -1 != 6 (at ../src/port/t/001_filesystem.c:243)
not ok 13 - path3 matches "c:\\foo": "" vs "c:\foo" (at ../src/port/t/001_filesystem.c:245)
not ok 14 - unlink(path2) == 0 (at ../src/port/t/001_filesystem.c:246), error: No such file or directory
could not set junction for "\??\c:\foo": Access is denied.
not ok 15 - symlink("\\??\\c:\\foo", path2) == 0 (at ../src/port/t/001_filesystem.c:253), error: Permission denied
not ok 16 - readlink succeeds (at ../src/port/t/001_filesystem.c:255), error: No such file or directory
not ok 17 - size == 6: -1 != 6 (at ../src/port/t/001_filesystem.c:258)
not ok 18 - path3 matches "c:\\foo": "" vs "c:\foo" (at ../src/port/t/001_filesystem.c:259)
not ok 19 - unlink(path2) == 0 (at ../src/port/t/001_filesystem.c:264), error: No such file or directory
could not set junction for "\??\Volume1234": Access is denied.
not ok 20 - symlink("\\??\\Volume1234", path2) == 0 (at ../src/port/t/001_filesystem.c:272), error: Permission denied
not ok 21 - readlink succeeds (at ../src/port/t/001_filesystem.c:274), error: No such file or directory
not ok 22 - size == 14: -1 != 14 (at ../src/port/t/001_filesystem.c:275)
not ok 23 - path3 matches "\\??\\Volume1234": "" vs "\??\Volume1234" (at ../src/port/t/001_filesystem.c:277)
not ok 24 - unlink(path2) == 0 (at ../src/port/t/001_filesystem.c:278), error: No such file or directory
ok 25 - fstat regular file
ok 26 - S_ISREG(statbuf.st_mode)
ok 27 - statbuf.st_size == 12
ok 28 - statbuf.st_nlink == 1
ok 29 - stat missing file fails
ok 30 - errno == ENOENT
ok 31 - stat regular file
ok 32 - S_ISREG(statbuf.st_mode)
ok 33 - statbuf.st_size == 12
ok 34 - statbuf.st_nlink == 1
ok 35 - stat directory
ok 36 - S_ISDIR(statbuf.st_mode)
not ok 37 - stat symlink (at ../src/port/t/001_filesystem.c:311)
not ok 38 - S_ISDIR(statbuf.st_mode) (at ../src/port/t/001_filesystem.c:312)
could not set junction for "\??\z:\testdata\dir1": Access is denied.
not ok 39 - sym001 -> dir1 (at ../src/port/t/001_filesystem.c:317), error: Permission denied
could not set junction for "\??\z:\testdata\sym001": Access is denied.
not ok 40 - sym002 -> sym001 (at ../src/port/t/001_filesystem.c:320), error: Permission denied
could not set junction for "\??\z:\testdata\sym002": Access is denied.
not ok 41 - sym003 -> sym002 (at ../src/port/t/001_filesystem.c:323), error: Permission denied
could not set junction for "\??\z:\testdata\sym003": Access is denied.
not ok 42 - sym004 -> sym003 (at ../src/port/t/001_filesystem.c:326), error: Permission denied
could not set junction for "\??\z:\testdata\sym004": Access is denied.
not ok 43 - sym005 -> sym004 (at ../src/port/t/001_filesystem.c:329), error: Permission denied
could not set junction for "\??\z:\testdata\sym005": Access is denied.
not ok 44 - sym006 -> sym005 (at ../src/port/t/001_filesystem.c:332), error: Permission denied
could not set junction for "\??\z:\testdata\sym006": Access is denied.
not ok 45 - sym007 -> sym006 (at ../src/port/t/001_filesystem.c:335), error: Permission denied
could not set junction for "\??\z:\testdata\sym007": Access is denied.
not ok 46 - sym008 -> sym007 (at ../src/port/t/001_filesystem.c:338), error: Permission denied
could not set junction for "\??\z:\testdata\sym008": Access is denied.
not ok 47 - sym009 -> sym008 (at ../src/port/t/001_filesystem.c:341), error: Permission denied
not ok 48 - stat sym008 (at ../src/port/t/001_filesystem.c:346), error: No such file or directory
not ok 49 - S_ISDIR(statbuf.st_mode) (at ../src/port/t/001_filesystem.c:347)
ok 50 - Windows: stat sym009 fails
not ok 51 - errno == ELOOP: 2 != 114 (at ../src/port/t/001_filesystem.c:358)
not ok 52 - unlink(path) == 0 (at ../src/port/t/001_filesystem.c:363), error: No such file or directory
ok 53 - stat broken symlink chain fails
ok 54 - errno == ENOENT
ok 55 - lstat missing file fails
ok 56 - errno == ENOENT
ok 57 - lstat regular file
ok 58 - S_ISREG(statbuf.st_mode)
ok 59 - statbuf.st_size == 12
ok 60 - statbuf.st_nlink == 1
ok 61 - lstat directory
ok 62 - S_ISDIR(statbuf.st_mode)
not ok 63 - lstat symlink (at ../src/port/t/001_filesystem.c:388)
not ok 64 - S_ISLNK(statbuf.st_mode) (at ../src/port/t/001_filesystem.c:389)
not ok 65 - got expected symlink size: 0 != 26 (at ../src/port/t/001_filesystem.c:390)
could not set junction for "\??\z:\testdata\does-not-exist": Access is denied.
not ok 66 - make a broken symlink (at ../src/port/t/001_filesystem.c:394), error: Permission denied
not ok 67 - lstat broken symlink (at ../src/port/t/001_filesystem.c:395), error: No such file or directory
not ok 68 - S_ISLNK(statbuf.st_mode) (at ../src/port/t/001_filesystem.c:396)
not ok 69 - unlink(path) == 0 (at ../src/port/t/001_filesystem.c:397), error: No such file or directory
ok 70 - link missing file fails
ok 71 - errno == ENOENT
ok 72 - link succeeds
ok 73 - lstat link 1 succeeds
ok 74 - S_ISREG(statbuf.st_mode)
ok 75 - statbuf.st_size == 12
ok 76 - statbuf.st_nlink == 2
ok 77 - lstat link 2 succeeds
ok 78 - S_ISREG(statbuf.st_mode)
ok 79 - statbuf.st_size == 12
ok 80 - statbuf.st_nlink == 2
ok 81 - unlink succeeds
ok 82 - lstat link 1 succeeds
ok 83 - S_ISREG(statbuf.st_mode)
ok 84 - statbuf.st_size == 12
ok 85 - statbuf.st_nlink == 1
ok 86 - lstat link 2 fails
ok 87 - errno == ENOENT
could not set junction for "\??\z:\testdata\dir1": Access is denied.
not ok 88 - create symlink (at ../src/port/t/001_filesystem.c:437), error: Permission denied
not ok 89 - unlink symlink (at ../src/port/t/001_filesystem.c:438), error: No such file or directory
ok 90 - Windows: can't unlink() a directory
ok 91 - errno == EPERM
ok 92 - touch name1.txt
ok 93 - Windows: can't unlink file while non-shared handle exists
ok 94 - errno == EACCES
ok 95 - Windows: can rename file after non-shared handle asynchronously closed
ok 96 - mkdir(path, 0777) == 0
ok 97 - open dir2/test-file
ok 98 - unlink file while it's open, once
ok 99 - can't unlink again
ok 100 - Windows non-POSIX: we expect EACCES (delete already pending)
ok 101 - Windows non-POSIX: trying again fails
ok 102 - Windows non-POSIX: ... but blocked until ENOENT was reached due to asynchronous close
ok 103 - now we can remove the directory
ok 104 - touch name1.txt
not ok 105 - rename name1.txt -> name2.txt (at ../src/port/t/001_filesystem.c:529), error: Invalid argument
not ok 106 - can't open name1.txt anymore: 3 != -1 (at ../src/port/t/001_filesystem.c:531)
not ok 107 - errno == ENOENT: 22 != 2 (at ../src/port/t/001_filesystem.c:532)
not ok 108 - touch name1.txt (at ../src/port/t/001_filesystem.c:535), error: File exists
not ok 109 - rename name1.txt -> name2.txt, replacing it (at ../src/port/t/001_filesystem.c:539), error: Invalid argument
not ok 110 - touch name1.txt (at ../src/port/t/001_filesystem.c:542), error: File exists
not ok 111 - open name2.txt (at ../src/port/t/001_filesystem.c:546), error: No such file or directory
ok 112 - Windows non-POSIX: can't rename name1.txt -> name2.txt while name2.txt is open
not ok 113 - errno == EACCES: 22 != 13 (at ../src/port/t/001_filesystem.c:556)
ok 114 - unlink name1.txt
ok 115 - fd < 0 || close(fd) == 0
not ok 116 - touch name1.txt (at ../src/port/t/001_filesystem.c:568), error: File exists
not ok 117 - can rename name1.txt -> name2.txt while name1.txt is open (at ../src/port/t/001_filesystem.c:572), error: Permission denied
not ok 118 - touch name1.txt (at ../src/port/t/001_filesystem.c:577), error: File exists
not ok 119 - open name2.txt (at ../src/port/t/001_filesystem.c:581), error: No such file or directory
not ok 120 - unlink name2.txt while it is still open (at ../src/port/t/001_filesystem.c:582), error: No such file or directory
ok 121 - Windows non-POSIX: cannot rename name1.txt -> name2.txt while unlinked file is still open
ok 122 - errno == EACCES
not ok 123 - unlink(path) == 0 (at ../src/port/t/001_filesystem.c:594), error: Permission denied
not ok 124 - touch name1.txt (at ../src/port/t/001_filesystem.c:610), error: File exists
ok 125 - Windows: can't rename file while non-shared handle exists for name1
ok 126 - errno == EACCES
closing handle asynchronously
closed handle asynchronously
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment