1.1.4.1.3. test_automation.utils.io_utils
1.1.4.1.3.1. Attributes
1.1.4.1.3.2. Functions
|
Write a value to a file using shell redirection. |
|
Read the contents of a file using the |
|
Write value to file over a specific port. |
|
Read file content using cat command over a specific port. |
|
Check if a file exists on the target. |
|
Read integer value from file using cat command. |
1.1.4.1.3.3. Module Contents
- test_automation.utils.io_utils.write_file(platform_base_obj, path, value, timeout=DEFAULT_TIMEOUT)[source]
Write a value to a file using shell redirection.
- Parameters:
platform_base_obj – Platform base object providing console access.
path (str) – Path to the file to write to.
value (Union[str, int]) – Value to write to the file.
timeout (int) – Command timeout in seconds.
- Returns:
output of the command execution
- test_automation.utils.io_utils.read_file(platform_base_obj, path, timeout=DEFAULT_TIMEOUT)[source]
Read the contents of a file using the
catcommand.- Parameters:
platform_base_obj – Platform base object providing console access.
path (str) – Path to the file to read from.
timeout (int) – Command timeout in seconds.
- Returns:
Contents of the file
- Return type:
str
- test_automation.utils.io_utils.write_to_port(mgr, port, path, value)[source]
Write value to file over a specific port.
- Parameters:
mgr – Manager object to run command
port – Console port to use
path (str) – File path to write to
value (Union[str, int]) – Value to write
- Returns:
output of the command execution
- test_automation.utils.io_utils.read_file_from_port(mgr, port, path, timeout=120)[source]
Read file content using cat command over a specific port.
- Parameters:
mgr – Manager object to run command
port – Console port to use
path (str) – File path to read from
timeout (int) – Command timeout in seconds
- Returns:
Contents of the file
- Return type:
str