diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2016-02-13 19:47:14 +0100 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2016-02-13 19:47:14 +0100 |
commit | 883b93e983f6666d620cb884317c2d0eab05198d (patch) | |
tree | 436a4ecbdcd6c63305925bc8ee5814912f1ce956 /clients/ssh | |
parent | c4c55c0fa591b2e354dbb085e0e1c83bb3bce210 (diff) | |
download | go-git-883b93e983f6666d620cb884317c2d0eab05198d.tar.gz |
clients: skip ssh test when SSH_AUTH_SOCK is not present
Diffstat (limited to 'clients/ssh')
-rw-r--r-- | clients/ssh/auth_method_test.go | 20 | ||||
-rw-r--r-- | clients/ssh/git_upload_pack_test.go | 6 |
2 files changed, 16 insertions, 10 deletions
diff --git a/clients/ssh/auth_method_test.go b/clients/ssh/auth_method_test.go index ca4558d..a87c950 100644 --- a/clients/ssh/auth_method_test.go +++ b/clients/ssh/auth_method_test.go @@ -13,7 +13,7 @@ type SuiteCommon struct{} var _ = Suite(&SuiteCommon{}) -func (s *SuiteRemote) TestKeyboardInteractiveName(c *C) { +func (s *SuiteCommon) TestKeyboardInteractiveName(c *C) { a := &KeyboardInteractive{ User: "test", Challenge: nil, @@ -21,7 +21,7 @@ func (s *SuiteRemote) TestKeyboardInteractiveName(c *C) { c.Assert(a.Name(), Equals, KeyboardInteractiveName) } -func (s *SuiteRemote) TestKeyboardInteractiveString(c *C) { +func (s *SuiteCommon) TestKeyboardInteractiveString(c *C) { a := &KeyboardInteractive{ User: "test", Challenge: nil, @@ -29,7 +29,7 @@ func (s *SuiteRemote) TestKeyboardInteractiveString(c *C) { c.Assert(a.String(), Equals, fmt.Sprintf("user: test, name: %s", KeyboardInteractiveName)) } -func (s *SuiteRemote) TestPasswordName(c *C) { +func (s *SuiteCommon) TestPasswordName(c *C) { a := &Password{ User: "test", Pass: "", @@ -37,7 +37,7 @@ func (s *SuiteRemote) TestPasswordName(c *C) { c.Assert(a.Name(), Equals, PasswordName) } -func (s *SuiteRemote) TestPasswordString(c *C) { +func (s *SuiteCommon) TestPasswordString(c *C) { a := &Password{ User: "test", Pass: "", @@ -45,7 +45,7 @@ func (s *SuiteRemote) TestPasswordString(c *C) { c.Assert(a.String(), Equals, fmt.Sprintf("user: test, name: %s", PasswordName)) } -func (s *SuiteRemote) TestPasswordCallbackName(c *C) { +func (s *SuiteCommon) TestPasswordCallbackName(c *C) { a := &PasswordCallback{ User: "test", Callback: nil, @@ -53,7 +53,7 @@ func (s *SuiteRemote) TestPasswordCallbackName(c *C) { c.Assert(a.Name(), Equals, PasswordCallbackName) } -func (s *SuiteRemote) TestPasswordCallbackString(c *C) { +func (s *SuiteCommon) TestPasswordCallbackString(c *C) { a := &PasswordCallback{ User: "test", Callback: nil, @@ -61,7 +61,7 @@ func (s *SuiteRemote) TestPasswordCallbackString(c *C) { c.Assert(a.String(), Equals, fmt.Sprintf("user: test, name: %s", PasswordCallbackName)) } -func (s *SuiteRemote) TestPublicKeysName(c *C) { +func (s *SuiteCommon) TestPublicKeysName(c *C) { a := &PublicKeys{ User: "test", Signer: nil, @@ -69,7 +69,7 @@ func (s *SuiteRemote) TestPublicKeysName(c *C) { c.Assert(a.Name(), Equals, PublicKeysName) } -func (s *SuiteRemote) TestPublicKeysString(c *C) { +func (s *SuiteCommon) TestPublicKeysString(c *C) { a := &PublicKeys{ User: "test", Signer: nil, @@ -77,7 +77,7 @@ func (s *SuiteRemote) TestPublicKeysString(c *C) { c.Assert(a.String(), Equals, fmt.Sprintf("user: test, name: %s", PublicKeysName)) } -func (s *SuiteRemote) TestPublicKeysCallbackName(c *C) { +func (s *SuiteCommon) TestPublicKeysCallbackName(c *C) { a := &PublicKeysCallback{ User: "test", Callback: nil, @@ -85,7 +85,7 @@ func (s *SuiteRemote) TestPublicKeysCallbackName(c *C) { c.Assert(a.Name(), Equals, PublicKeysCallbackName) } -func (s *SuiteRemote) TestPublicKeysCallbackString(c *C) { +func (s *SuiteCommon) TestPublicKeysCallbackString(c *C) { a := &PublicKeysCallback{ User: "test", Callback: nil, diff --git a/clients/ssh/git_upload_pack_test.go b/clients/ssh/git_upload_pack_test.go index 66ac306..673e0fc 100644 --- a/clients/ssh/git_upload_pack_test.go +++ b/clients/ssh/git_upload_pack_test.go @@ -57,6 +57,12 @@ func (c *sshAgentConn) close() error { return c.pipe.Close() } +func (s *SuiteRemote) SetUpSuite(c *C) { + if os.Getenv("SSH_AUTH_SOCK") == "" { + c.Skip("SSH_AUTH_SOCK is not set") + } +} + func (s *SuiteRemote) TestConnectWithPublicKeysCallback(c *C) { agent, err := newSSHAgentConn() c.Assert(err, IsNil) |