sapling/eden/integration
Xavier Deguillard a935fc38b4 inodes: fix casing issue on Windows
Summary:
On Windows, paths are case insensitive (but the filesystem is case preserving),
and thus `open("FILE.TXT")` and `open("file.txt")` refer to the same file. When
that file is not materialized and its parent directory isn't yet enumerated,
PrjFS will call the PRJ_GET_PLACEHOLDER_INFO_CB with the file name passed in to
the `open` call. In this callback, if the passed in name refers to a valid
file, it needs to call PrjWritePlaceholderInfo to populate the directory entry.
Here is what the documentation for that function states:

"For example, if the PRJ_GET_PLACEHOLDER_INFO_CB callback specifies
dir1\dir1\FILE.TXT in callbackData->FilePathName, and the provider's backing
store contains a file called File.txt in the dir1\dir2 directory, and
PrjFileNameCompare returns 0 when comparing the names FILE.TXT and
File.txt, then the provider specifies dir1\dir2\File.txt as the value of
this parameter."

While the documentation doesn't state how that name is used internally, we can
infer (and test) that the returned case will be used as the canonical
representation of that file, ie: the one that a directory listing will see.

Since the PathMap code already does a case insensitive search, we just need to
make sure to use what it returns instead of re-using the name used for the search.

The only caveat to all of this is the original comment that describe that
`metadata.name` can't be used as it causes crashes. From what I can tell, this
was written in later 2018, and I believe is no longer relevant: the
`metadata.name` field was simply not populated.

Reviewed By: wez

Differential Revision: D21799627

fbshipit-source-id: aee877cc2d5f057944fcd39b1d59f0e97de6315c
2020-06-24 18:59:16 -07:00
..
fsck Move eden.cli namespace to eden.fs.cli 2020-03-25 11:46:56 -07:00
helpers move UserInfo to eden/fs/utils/ 2020-04-29 17:21:12 -07:00
hg Custom pyre upgrade for eden 2020-05-04 21:19:20 -07:00
lib integration: rename blacklist.py 2020-06-19 18:13:20 -07:00
snapshot Convert type check targets in eden to use configuration 2020-05-02 21:16:55 -07:00
basic_test.py integration: write files to the repo in binary mode 2020-06-15 15:10:20 -07:00
casing_test.py inodes: fix casing issue on Windows 2020-06-24 18:59:16 -07:00
chown_test.py replace a bunch of pyre-fixme comments with pyre-ignoree 2020-02-24 18:55:19 -08:00
clone_test.py avoid running systemd-related tests when systemd is not supported 2020-04-23 15:06:32 -07:00
CMakeLists.txt enable all integration test sources in CMake builds 2020-05-04 11:46:09 -07:00
config_test.py rename eden.thrift Python module to eden.thrift.legacy 2020-06-10 19:29:42 -07:00
corrupt_overlay_test.py Tidy up license headers 2019-10-11 05:28:23 -07:00
debug_getpath_test.py Tidy up license headers 2019-10-11 05:28:23 -07:00
debug_test.py add a (failing) test of binary blob contents over thrift 2020-06-10 19:29:42 -07:00
doteden_test.py Update pyre version for eden 2020-02-23 15:25:23 -08:00
edenclient_test.py remove the "edenfsctl repository" subcommand 2020-04-10 13:57:52 -07:00
fsck_test.py remove the "edenfsctl repository" subcommand 2020-04-10 13:57:52 -07:00
glob_test.py add EdenErrorType to EdenError 2019-10-29 09:23:03 -07:00
health_test.py update the usage of pexpect to work on Windows 2020-04-24 14:48:05 -07:00
help_test.py apply the integration test case blacklist to some more tests 2020-05-04 11:46:09 -07:00
info_test.py remove some internal uses of the term 'client' 2020-05-07 22:08:10 -07:00
linux_cgroup_test.py apply the integration test case blacklist to some more tests 2020-05-04 11:46:09 -07:00
materialized_query_test.py add EdenErrorType to EdenError 2019-10-29 09:23:03 -07:00
mmap_test.py suppress errors in eden - batch 1 2020-05-21 19:32:35 -07:00
mount_test.py disallow warnings in integration tests 2020-06-10 23:23:34 -07:00
oexcl_test.py Tidy up license headers 2019-10-11 05:28:23 -07:00
patch_test.py Tidy up license headers 2019-10-11 05:28:23 -07:00
persistence_test.py eden/integration/persistence_test.py 2020-02-24 15:42:45 -08:00
rage_test.py update edenfsctl to report the compile-time version 2020-04-22 12:48:48 -07:00
rc_test.py remove the "edenfsctl repository" subcommand 2020-04-10 13:57:52 -07:00
redirect_test.py remove support for repo configs from edenfsctl clone 2020-04-10 13:57:52 -07:00
remount_test.py remove the "edenfsctl repository" subcommand 2020-04-10 13:57:52 -07:00
rename_test.py Tidy up license headers 2019-10-11 05:28:23 -07:00
restart_test.py store force restart action as its own flag 2020-06-11 17:40:51 -07:00
rocksdb_store_test.py fix flaky integration tests 2020-05-29 11:49:37 -07:00
sed_test.py Tidy up license headers 2019-10-11 05:28:23 -07:00
service_log_test.py clean up parts of the start and clone integration tests 2020-04-22 15:02:42 -07:00
setattr_test.py disallow setting suid, sgid, and sticky bits 2020-04-30 15:18:35 -07:00
stale_test.py update some of the integration test code to use the eden.config module 2020-04-22 12:48:48 -07:00
start_test.py unify the EdenMain code on Windows 2020-05-28 09:01:03 -07:00
stats_test.py fix flaky integration tests 2020-05-29 11:49:37 -07:00
stop_test.py update the usage of pexpect to work on Windows 2020-04-24 14:48:05 -07:00
systemd_fixture_test.py fix test 2020-06-15 18:37:01 -07:00
systemd_test.py update the usage of pexpect to work on Windows 2020-04-24 14:48:05 -07:00
takeover_test.py rename eden.thrift Python module to eden.thrift.legacy 2020-06-10 19:29:42 -07:00
thrift_test.py add a new column FUSE FETCH to eden top to display fetchCounts 2020-06-24 15:56:14 -07:00
unixsocket_test.py Tidy up license headers 2019-10-11 05:28:23 -07:00
unlink_test.py tests: enable unlink_test on Windows 2020-06-19 18:13:20 -07:00
userinfo_test.py apply the integration test case blacklist to some more tests 2020-05-04 11:46:09 -07:00
xattr_test.py disallow warnings in integration tests 2020-06-10 23:23:34 -07:00