tcp-proxy/pkg/common/common_test.go

34 lines
587 B
Go
Raw Normal View History

2020-01-13 10:05:18 +00:00
package common
import "testing"
func TestCheckRemoteSSH(t *testing.T) {
type args struct {
host string
port int
timeout int
}
tests := []struct {
name string
args args
want bool
}{
{
name: "test check localhost ssh port",
args: args{
host: "localhost",
port: 22,
timeout: 5,
},
want: true,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := CheckRemoteSSH(tt.args.host, tt.args.port, tt.args.timeout); got != tt.want {
t.Errorf("CheckRemoteSSH() = %v, want %v", got, tt.want)
}
})
}
}