Crate io_conformance_util

Source
Expand description

Crate to provide fidl logging and test setup helpers for conformance tests for fuchsia.io.

Modules§

flags
Utility functions for getting combinations of flags.
test_harness
Test harness helper struct.

Constants§

EMPTY_NODE_ATTRS
A default value for NodeAttributes, with zeros set for all fields.
TEST_FILE
A common name for a file to create in a conformance test.
TEST_FILE_CONTENTS
A common set of file contents to write into a test file in a conformance test.

Traits§

DirectoryProxyExt
Extension trait for fio::DirectoryProxy to make interactions with the fuchsia.io protocol less verbose.

Functions§

assert_file_not_found
Attempts to open the given file, and checks the status is NOT_FOUND.
assert_on_open_not_received
Asserts that no fio::NodeEvent::OnOpen_ event is sent on an opened proxy.
convert_node_proxy
Converts a generic fio::NodeProxy to either fio::FileProxy or fio::DirectoryProxy. WARNING: This function does not verify that the conversion is valid.
create_file_and_get_backing_memory
Creates a directory with the given DirectoryEntry, opening the file with the given file flags, and returning a Buffer object initialized with the given vmo_flags.
deprecated_open_dir_with_flags
Helper function to open a sub-directory with the given flags. Only use this if testing something other than the open call directly.
deprecated_open_file_with_flags
Helper function to open a file with the given flags. Only use this if testing something other than the open call directly.
deprecated_open_node
Helper function to open the desired node in the root folder. Asserts that deprecated_open_node_status succeeds.
deprecated_open_node_status
Helper function to open the desired node in the root folder.
deprecated_open_rw_dir
Helper function to open a sub-directory as readable and writable. Only use this if testing something other than the open call directly.
directory
Makes a directory with a name and set of entries.
executable_file
Makes an executable file to be placed in the test directory.
file
Makes a file to be placed in the test directory.
get_directory_entry_name
Returns the .name field from a given DirectoryEntry, otherwise panics.
get_open_status
Wait for fio::NodeEvent::OnOpen_ to be sent via node_proxy and returns its zx::Status.
get_token
Helper function to call get_token on a directory. Only use this if testing something other than the get_token call directly.
read_file
Helper function to read a file and return its contents. Only use this if testing something other than the read call directly.
remote_directory
Makes a remote directory with a name, which forwards the requests to the given directory proxy.
validate_vmo_rights
Asserts that the given vmo_rights align with the expected_vmo_rights passed to a get_backing_memory call. We check that the returned rights align with and do not exceed those in the given flags, that we have at least basic VMO rights, and that the flags align with the expected sharing mode.