Make all our package sources use Go 1.17 gofmt format (adding //go:build lines). Not strictly necessary but will avoid spurious changes as files are edited. Part of //go:build change (#41184). See https://golang.org/design/draft-gobuild Change-Id: I70526bf588bf4078887e567795867ece785d666b Reviewed-on: https://go-review.googlesource.com/c/crypto/+/294415 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Jason A. Donenfeld <Jason@zx2c4.com> Reviewed-by: Ian Lance Taylor <iant@golang.org>
34 lines
778 B
Go
34 lines
778 B
Go
// Copyright 2014 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd
|
|
// +build aix darwin dragonfly freebsd linux netbsd openbsd
|
|
|
|
package test
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestBannerCallbackAgainstOpenSSH(t *testing.T) {
|
|
server := newServer(t)
|
|
defer server.Shutdown()
|
|
|
|
clientConf := clientConfig()
|
|
|
|
var receivedBanner string
|
|
clientConf.BannerCallback = func(message string) error {
|
|
receivedBanner = message
|
|
return nil
|
|
}
|
|
|
|
conn := server.Dial(clientConf)
|
|
defer conn.Close()
|
|
|
|
expected := "Server Banner"
|
|
if receivedBanner != expected {
|
|
t.Fatalf("got %v; want %v", receivedBanner, expected)
|
|
}
|
|
}
|