Module utils

Source
Expand description

Provides utility functions used by multiple fixture files.

Enums§

CommandError

Constants§

DEFAULT_BLOCK_SIZE

Traits§

ChildExt
Extension trait for utilities on std::process::Child
CommandExt
Extension trait for utilities on std::process::Command

Functions§

create_vu_block_config
create_vu_console_multiport_config
find_crosvm_binary
Returns the path to the crosvm binary to be tested.
prepare_disk_img
Prepare a temporary ext4 disk file.
retry
Calls the closure until it returns a non-error Result. If it has been re-tried retries times, the last result is returned.
retry_with_delay
Calls the closure until it returns a non-error Result. If it has been re-tried retries times, the last result is returned. Waits delay between attempts.
run_with_status_check
Run the provided closure in a separate thread and return it’s result. If the closure does not finish, continue_fn is called periodically with interval while continue_fn return true. Once continue_fn return false, an Error is returned instead.
run_with_timeout
Run the provided closure in a separate thread and return it’s result. If the closure does not finish before the timeout is reached, an Error is returned instead.