Beispiel #1
0
	"golang.org/x/crypto/ssh"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

var _ = Describe("Diego SSH Plugin", func() {
	var (
		fakeTerminalHelper  *terminal_helper_fakes.FakeTerminalHelper
		fakeListenerFactory *fakes.FakeListenerFactory
		fakeAppFactory      *app_fakes.FakeAppFactory
		fakeInfoFactory     *info_fakes.FakeInfoFactory
		fakeCredFactory     *credential_fakes.FakeCredentialFactory

		fakeConnection    *fake_ssh.FakeConn
		fakeSecureClient  *fakes.FakeSecureClient
		fakeSecureDialer  *fakes.FakeSecureDialer
		fakeSecureSession *fakes.FakeSecureSession

		terminalHelper    terminal.TerminalHelper
		keepAliveDuration time.Duration
		secureShell       cmd.SecureShell

		stdinPipe *fake_io.FakeWriteCloser
	)

	BeforeEach(func() {
		fakeTerminalHelper = &terminal_helper_fakes.FakeTerminalHelper{}
		terminalHelper = terminal.DefaultHelper()

		fakeListenerFactory = &fakes.FakeListenerFactory{}
		fakeListenerFactory.ListenStub = net.Listen
Beispiel #2
0
	"net/url"

	"github.com/cloudfoundry-incubator/diego-ssh/cf-plugin/models/credential"
	"github.com/cloudfoundry-incubator/diego-ssh/cf-plugin/models/info"
	"github.com/cloudfoundry-incubator/diego-ssh/cf-plugin/models/info/info_fakes"
	"github.com/cloudfoundry/cli/plugin/fakes"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
	"github.com/onsi/gomega/ghttp"
)

var _ = Describe("Credential", func() {
	var (
		fakeCliConnection *fakes.FakeCliConnection
		fakeInfoFactory   *info_fakes.FakeInfoFactory
		credFactory       credential.CredentialFactory
	)

	BeforeEach(func() {
		fakeCliConnection = &fakes.FakeCliConnection{}
		fakeCliConnection.IsSSLDisabledReturns(true, nil)
		fakeInfoFactory = &info_fakes.FakeInfoFactory{}
	})

	JustBeforeEach(func() {
		credFactory = credential.NewCredentialFactory(fakeCliConnection, fakeInfoFactory)
	})

	Describe("AuthorizationCode", func() {
		var v2Info info.Info