Testing Infrastructure¶
Helpers and utilities for various Bakeneko tests
- class bakeneko.support.test.BakenekoRemoteTestCase(*args, **kwargs)¶
Run
unitestbased test cases that interact with a remote host over SSH.- Attributes:
REMOTE_HOST (str | None) – The remote host to connect to. If not overloaded it reads the value from the
BAKENEKO_REMOTE_TEST_HOSTenvironment variable if it exists, otherwise the value isNone.REMOTE_USER (str | None) – The user on the remote host to connect as. If not overloaded it reads the value from the
BAKENEKO_REMOTE_TEST_USERenvironment variable if it exits, otherwise the value isNone.REMOTE_KEY (str | None) – The private key file to use for remote authentication. If not overloaded it reads the value from the
BAKENEKO_REMOTE_TEST_KEYenvironment variable if it exits, otherwise the value isNone.LONG_LIVED (bool) – If the remote connection is long-lived. If set to true, the connection will be established on construction of the test class and live for every single test case run. Otherwise, the connection is established prior to each
test_case and torn down after. (default: True)
- remote_put_file(file: Path | IOBase, dest: str)¶
Send a file to the remote system
- Parameters:
file (Path | IOBase) – The file to upload.
dest (str) – The destination for the file.
- Returns:
fabric.transfer.Result – If the connection is active and valid, the result of the file transfer.
None – If there is no remote connection.
- Raises:
AssertionError – If the put on the remote connection fails for any reason.
- remote_run_cmd(cmd: str, **kwargs)¶
Run a command on the remote system.
- Parameters:
cmd (str) – The command to run on the remote system.
- Returns:
invoke.runners.Result – If the connection is active and valid, the result of the command.
None – If there is no remote connection.
- Raises:
AssertionError – If the run on the remote connection fails for any reason.
- assertRemoteConnected()¶
Assert that we are connected to the remote session
- class bakeneko.support.test.BakenekoSerialTestCase(methodName: str = 'runTest', **kwargs) None¶
Run
unitestbased test cases that interact with a DUT over serial- Attributes:
SERIAL_PORT (str | None) – The serial port to connect to. If not overloaded it reads the value from the
BAKENEKO_SERIAL_TEST_PORTenvironment variable if it exists, otherwise the value isNone.REMOTE_USER (int) – The user on the remote host to connect as. If not overloaded it reads the value from the
BAKENEKO_SERIAL_TEST_BAUDenvironment variable if it exists. (default: 115200)
- LONG_LIVEDbool
If the serial connection is long-lived. If set to true, the connection will be established on construction of the test class and live for every single test case run. Otherwise, the connection is established prior to each
test_case and torn down after. (default: True)
- class bakeneko.support.test.PCIeGatewareTestCase(*args, **kwargs) None¶
A specialization of the
torii.test.ToriiTestCasefor the Bakeneko PCIe gateware.It primarily provides helper asserts for various things related to PCIe traffic and symbols.