removed uber zap from vendor and switched to dep from glide (#6)

This commit is contained in:
Steve Brunton
2017-11-29 22:48:49 -05:00
committed by GitHub
parent be3ca4608c
commit c37abb638f
514 changed files with 25671 additions and 44097 deletions

32
vendor/golang.org/x/crypto/ssh/test/banner_test.go generated vendored Normal file
View File

@@ -0,0 +1,32 @@
// 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.
// +build 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)
}
}

View File

@@ -2,6 +2,6 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// This package contains integration tests for the
// Package test contains integration tests for the
// golang.org/x/crypto/ssh package.
package test // import "golang.org/x/crypto/ssh/test"

View File

@@ -25,8 +25,9 @@ import (
"golang.org/x/crypto/ssh/testdata"
)
const sshd_config = `
const sshdConfig = `
Protocol 2
Banner {{.Dir}}/banner
HostKey {{.Dir}}/id_rsa
HostKey {{.Dir}}/id_dsa
HostKey {{.Dir}}/id_ecdsa
@@ -50,7 +51,7 @@ HostbasedAuthentication no
PubkeyAcceptedKeyTypes=*
`
var configTmpl = template.Must(template.New("").Parse(sshd_config))
var configTmpl = template.Must(template.New("").Parse(sshdConfig))
type server struct {
t *testing.T
@@ -256,6 +257,8 @@ func newServer(t *testing.T) *server {
}
f.Close()
writeFile(filepath.Join(dir, "banner"), []byte("Server Banner"))
for k, v := range testdata.PEMBytes {
filename := "id_" + k
writeFile(filepath.Join(dir, filename), v)
@@ -268,7 +271,7 @@ func newServer(t *testing.T) *server {
}
var authkeys bytes.Buffer
for k, _ := range testdata.PEMBytes {
for k := range testdata.PEMBytes {
authkeys.Write(ssh.MarshalAuthorizedKey(testPublicKeys[k]))
}
writeFile(filepath.Join(dir, "authorized_keys"), authkeys.Bytes())