...
1
2
3
4
5
6
7 package test
8
9 import (
10 "testing"
11 )
12
13 func TestBannerCallbackAgainstOpenSSH(t *testing.T) {
14 server := newServer(t)
15
16 clientConf := clientConfig()
17
18 var receivedBanner string
19 clientConf.BannerCallback = func(message string) error {
20 receivedBanner = message
21 return nil
22 }
23
24 conn := server.Dial(clientConf)
25 defer conn.Close()
26
27 expected := "Server Banner"
28 if receivedBanner != expected {
29 t.Fatalf("got %v; want %v", receivedBanner, expected)
30 }
31 }
32
View as plain text