Device test core library for running tests against a device using a generic interface, e.g. SSH, Docker, or some other custom type.
This library can be used to build plugins for different test frameworks such as pytest and Robot Framework.
The project's goal is to create a common interface for interacting with devices under test. The adapter normalize the interface enabling you to write tests which are independent of the device interface being used (e.g. docker, ssh, local etc.).
The device-test-core package includes several device adapters, each with their own dependencies.
Below shows how to either install all adapters, or just the adapters you are interested in. This allows you to keep the dependencies to a minimum.
pip3 install "device-test-core[all] @ git+https://github.com/reubenmiller/device-test-core.git"
pip3 install "device-test-core[docker] @ git+https://github.com/reubenmiller/device-test-core.git"
pip3 install "device-test-core[ssh] @ git+https://github.com/reubenmiller/device-test-core.git"
pip3 install "device-test-core[local] @ git+https://github.com/reubenmiller/device-test-core.git"
-
Add the target device's hostname and username
echo "SSH_CONFIG_HOSTNAME=mydevice.local" >> .env echo "SSH_CONFIG_USERNAME=root" >> .env
-
Start the ssh-agent (if not already done by default in your shell profile)
eval $(ssh-agent)
-
Import your SSH key that you want to the ssh-agent (so the test can access it)
ssh-add ~/.ssh/<mysshkey>
-
Run the tests
just test