Skip to content

Commit f9d10d9

Browse files
krevsbechBastian-Krause
authored andcommitted
examples/ssh: add simple ssh example
Signed-off-by: Kasper Revsbech <mail@krevsbech.dk> [bst: use username/password from SSHDriver, use run_check() in tests, rename test, minor linting changes, drop command protocol usage] Signed-off-by: Bastian Krause <bst@pengutronix.de>
1 parent 7c13fe5 commit f9d10d9

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

examples/ssh/local.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
targets:
2+
main:
3+
resources:
4+
NetworkService:
5+
address: "dut.address"
6+
drivers:
7+
SSHDriver:
8+
username: "root"
9+
password: "pass"
10+
#keyfile: "/path/to/keyfile"

examples/ssh/test_ssh.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
def test_ssh(target):
2+
"""Simple test with SSHDriver directly executing a command on the DUT"""
3+
ssh_driver = target.get_driver("SSHDriver")
4+
stdout = ssh_driver.run_check("cat /proc/version")
5+
assert stdout

0 commit comments

Comments
 (0)