Skip to content

Commit 35a5524

Browse files
Brandon Castellanocopybara-github
authored andcommitted
[roll] Roll fuchsia [package-directory] Rework tests to use VFS connections
Ensure package directory tests serve a connection to the directories being tested, and all child nodes are opened through fuchsia.io. This ensures that the VFS connection logic (including hierarchal rights enforcement and path handling) is also tested. This results in a few test-only changes: * Hierarchal rights are now enforced, so in cases where NOT_SUPPORTED was being checked before, we now need ACCESS_DENIED. * The VFS handles checking certain flags already reducing the verbosity of these tests. This includes attempts to create new nodes, which requires the parent connection to be served as writable. This is not possible with how the nodes are implemented, so these tests have been removed in lieu of assertions that guarantee we cannot create new files, and tests that ensure we cannot create mutable connections * Callers of the fuchsia.io/Directory.DeprecatedOpen method now reject requests to open files where the path ends with a trailing slash, since the VFS adds OpenFlags.DIRECTORY in these cases. This is NOT done for the new fuchsia.io/Directory.Open method, so that is still allowed for those tests. As we are now testing through a DirectoryProxy instead of calling the VFS Node trait methods directly, we can simplify a lot of test code by using the helpers in the fuchsia-fs crate. This improves test readability significantly in some cases, and also ensures that we test end-to-end behavior that clients will encounter. There should be no change to code coverage with these tests, but there is a small functional change: in certain cases when calling fuchsia.io/Directory.DeprecatedOpen, the APPEND flag was erroneously allowed. We cannot easily fix this without disabling the old CTF tests, so for now we just update them going forwards and leave the old behavior. We need to address this as part of the io2 migration soon. Remove redundant test cases where the VFS already enforces certain checks, and instead add assertions which ensure no regressions in behavior can occur. Original-Bug: 324111518 Test: fx test package-directory-tests Original-Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/1234244 Original-Revision: 04768696b0579249beddb7546ed23e03b4ceff69 GitOrigin-RevId: 2b64a68b95ee8843e8eb72d3a54ed75cc51fafe9 Change-Id: If488a31e111580fb2e470e8bf2d4abb2f6a02504
1 parent 42977a7 commit 35a5524

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

stem

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
githooks="integration/git-hooks"
1212
remote="https://fuchsia.googlesource.com/fuchsia"
1313
gerrithost="https://fuchsia-review.googlesource.com"
14-
revision="35d6b311ecd1683a9d2210639f3a65acc738c93c"/>
14+
revision="04768696b0579249beddb7546ed23e03b4ceff69"/>
1515
</projects>
1616
<hooks>
1717
<hook name="install-environment"

0 commit comments

Comments
 (0)