github.com/loggregator/cli@v6.33.1-0.20180224010324-82334f081791+incompatible/cf/ssh/ssh_suite_test.go (about)

     1  package sshCmd_test
     2  
     3  import (
     4  	"io/ioutil"
     5  	"path/filepath"
     6  
     7  	. "github.com/onsi/ginkgo"
     8  	. "github.com/onsi/gomega"
     9  	"golang.org/x/crypto/ssh"
    10  
    11  	"testing"
    12  )
    13  
    14  var (
    15  	TestHostKey    ssh.Signer
    16  	TestPrivateKey ssh.Signer
    17  )
    18  
    19  func TestCmd(t *testing.T) {
    20  	RegisterFailHandler(Fail)
    21  	RunSpecs(t, "SSH Suite")
    22  }
    23  
    24  var _ = BeforeSuite(func() {
    25  	hostKeyBytes, err := ioutil.ReadFile(filepath.Join("..", "..", "fixtures", "host-key"))
    26  	Expect(err).NotTo(HaveOccurred())
    27  	hostKey, err := ssh.ParsePrivateKey(hostKeyBytes)
    28  	Expect(err).NotTo(HaveOccurred())
    29  
    30  	privateKeyBytes, err := ioutil.ReadFile(filepath.Join("..", "..", "fixtures", "private-key"))
    31  	Expect(err).NotTo(HaveOccurred())
    32  	privateKey, err := ssh.ParsePrivateKey(privateKeyBytes)
    33  	Expect(err).NotTo(HaveOccurred())
    34  
    35  	TestHostKey = hostKey
    36  	TestPrivateKey = privateKey
    37  })