You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[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.
Bug: 324111518
Test: fx test package-directory-tests
Change-Id: Idac8441d889ffdec3a3f93dc92ab0c7b0aaff036
Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/1234244
Reviewed-by: Ben Keller <[email protected]>
Commit-Queue: Brandon Castellano <[email protected]>
0 commit comments