freifunkmanager/ssh/manager_test.go

23 lines
432 B
Go

package ssh
import (
"net"
"testing"
"time"
"github.com/stretchr/testify/assert"
)
func TestManager(t *testing.T) {
assert := assert.New(t)
mgmt := NewManager("~/.ssh/id_rsa", 5*time.Second)
assert.NotNil(mgmt, "no new manager created")
client, _ := mgmt.ConnectTo(net.TCPAddr{IP: net.ParseIP("fd2f:5119:f2c::127"), Port: 22})
assert.NotNil(client, "no connection to client")
if client == nil {
client.Close()
}
}