Skip to content

Commit ecb6fe5

Browse files
Merge pull request labgrid-project#1044 from krevsbech/ssh-example
examples/ssh: add simple ssh example
2 parents 7c13fe5 + f9d10d9 commit ecb6fe5

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)