コード例 #1
0
def test_sshmanager_add_new(sshmanager_fix):
    host = 'other_host'
    con = SSHConnection(host)
    sshmanager_fix.add_connection(con)
    con_now = sshmanager_fix._connections[host]

    assert con_now == con
コード例 #2
0
def test_sshmanager_add_duplicate(sshmanager_fix):
    host = 'localhost'
    con = SSHConnection(host)
    sshmanager_fix.add_connection(con)
    con_there = sshmanager_fix._connections[host]
    sshmanager_fix.add_connection(con)
    con_now = sshmanager_fix._connections[host]

    assert con_now == con_there
コード例 #3
0
def test_sshconnection_inactive_raise():
    from labgrid.util.ssh import SSHConnection
    con = SSHConnection("localhost")
    with pytest.raises(ExecutionError):
        con.run_check("echo Hallo")
コード例 #4
0
def test_sshconnection_get():
    from labgrid.util.ssh import SSHConnection
    SSHConnection("localhost")
コード例 #5
0
def test_sshmanager_invalid_host_raise():
    con = SSHConnection("nosuchhost.notavailable")
    with pytest.raises(ExecutionError):
        con.connect()
コード例 #6
0
def connection_localhost():
    con = SSHConnection("localhost")
    con.connect()
    yield con
    con.disconnect()
コード例 #7
0
ファイル: test_util.py プロジェクト: labgrid-project/labgrid
def connection_localhost_no_cleanup():
    con = SSHConnection("localhost")
    con.connect()
    return con