Skip to content

Instantly share code, notes, and snippets.

@anarazel
Created October 19, 2022 03:20
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/0048d5b411a506fef89ad17de27e602e to your computer and use it in GitHub Desktop.
Save anarazel/0048d5b411a506fef89ad17de27e602e 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:204), error: Permission denied
not ok 5 - readlink succeeds (at ../src/port/t/001_filesystem.c:207), error: No such file or directory
not ok 6 - readlink reports expected size: -1 != 26 (at ../src/port/t/001_filesystem.c:208)
not ok 7 - readlink reports expected target: "z:\testdata\dir1\my_subdir" vs "" (at ../src/port/t/001_filesystem.c:214)
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:230), error: Permission denied
not ok 11 - readlink succeeds (at ../src/port/t/001_filesystem.c:232), error: No such file or directory
not ok 12 - size == 6: -1 != 6 (at ../src/port/t/001_filesystem.c:233)
not ok 13 - path3 matches "c:\\foo": "" vs "c:\foo" (at ../src/port/t/001_filesystem.c:235)
not ok 14 - unlink(path2) == 0 (at ../src/port/t/001_filesystem.c:236), 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:243), error: Permission denied
not ok 16 - readlink succeeds (at ../src/port/t/001_filesystem.c:245), error: No such file or directory
not ok 17 - size == 6: -1 != 6 (at ../src/port/t/001_filesystem.c:248)
not ok 18 - path3 matches "c:\\foo": "" vs "c:\foo" (at ../src/port/t/001_filesystem.c:249)
not ok 19 - unlink(path2) == 0 (at ../src/port/t/001_filesystem.c:254), 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:262), error: Permission denied
not ok 21 - readlink succeeds (at ../src/port/t/001_filesystem.c:264), error: No such file or directory
not ok 22 - size == 14: -1 != 14 (at ../src/port/t/001_filesystem.c:265)
not ok 23 - path3 matches "\\??\\Volume1234": "" vs "\??\Volume1234" (at ../src/port/t/001_filesystem.c:267)
not ok 24 - unlink(path2) == 0 (at ../src/port/t/001_filesystem.c:268), 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:301)
not ok 38 - S_ISDIR(statbuf.st_mode) (at ../src/port/t/001_filesystem.c:302)
could not set junction for "\??\z:\testdata\dir1": Access is denied.
not ok 39 - sym001 -> dir1 (at ../src/port/t/001_filesystem.c:307), 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:310), 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:313), 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:316), 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:319), 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:322), 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:325), 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:328), 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:331), error: Permission denied
not ok 48 - stat sym008 (at ../src/port/t/001_filesystem.c:336), error: No such file or directory
not ok 49 - S_ISDIR(statbuf.st_mode) (at ../src/port/t/001_filesystem.c:337)
ok 50 - Windows: stat sym009 fails
not ok 51 - errno == ELOOP: 2 != 114 (at ../src/port/t/001_filesystem.c:348)
not ok 52 - unlink(path) == 0 (at ../src/port/t/001_filesystem.c:353), 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:378)
not ok 64 - S_ISLNK(statbuf.st_mode) (at ../src/port/t/001_filesystem.c:379)
not ok 65 - got expected symlink size: 0 != 26 (at ../src/port/t/001_filesystem.c:380)
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:384), error: Permission denied
not ok 67 - lstat broken symlink (at ../src/port/t/001_filesystem.c:385), error: No such file or directory
not ok 68 - S_ISLNK(statbuf.st_mode) (at ../src/port/t/001_filesystem.c:386)
not ok 69 - unlink(path) == 0 (at ../src/port/t/001_filesystem.c:387), 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:427), error: Permission denied
not ok 89 - unlink symlink (at ../src/port/t/001_filesystem.c:428), 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 - close(fd) == 0
ok 94 - Windows: can't unlink file while non-shared handle exists
ok 95 - errno == EACCES
ok 96 - Windows: can rename file after non-shared handle asynchronously closed
ok 97 - mkdir(path, 0777) == 0
ok 98 - open dir2/test-file
ok 99 - unlink file while it's open, once
ok 100 - can't unlink again
ok 101 - Windows non-POSIX: we expect EACCES (delete already pending)
ok 102 - Windows non-POSIX: trying again fails
ok 103 - Windows non-POSIX: ... but blocked until ENOENT was reached due to asynchronous close
ok 104 - now we can remove the directory
ok 105 - touch name1.txt
ok 106 - close(fd) == 0
not ok 107 - rename name1.txt -> name2.txt (at ../src/port/t/001_filesystem.c:519), error: Invalid argument
not ok 108 - can't open name1.txt anymore: 3 != -1 (at ../src/port/t/001_filesystem.c:521)
not ok 109 - errno == ENOENT: 22 != 2 (at ../src/port/t/001_filesystem.c:522)
not ok 110 - touch name1.txt (at ../src/port/t/001_filesystem.c:525), error: File exists
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment