Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

Commit 883b93e

Browse files
committed
clients: skip ssh test when SSH_AUTH_SOCK is not present
1 parent c4c55c0 commit 883b93e

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

clients/ssh/auth_method_test.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,79 +13,79 @@ type SuiteCommon struct{}
1313

1414
var _ = Suite(&SuiteCommon{})
1515

16-
func (s *SuiteRemote) TestKeyboardInteractiveName(c *C) {
16+
func (s *SuiteCommon) TestKeyboardInteractiveName(c *C) {
1717
a := &KeyboardInteractive{
1818
User: "test",
1919
Challenge: nil,
2020
}
2121
c.Assert(a.Name(), Equals, KeyboardInteractiveName)
2222
}
2323

24-
func (s *SuiteRemote) TestKeyboardInteractiveString(c *C) {
24+
func (s *SuiteCommon) TestKeyboardInteractiveString(c *C) {
2525
a := &KeyboardInteractive{
2626
User: "test",
2727
Challenge: nil,
2828
}
2929
c.Assert(a.String(), Equals, fmt.Sprintf("user: test, name: %s", KeyboardInteractiveName))
3030
}
3131

32-
func (s *SuiteRemote) TestPasswordName(c *C) {
32+
func (s *SuiteCommon) TestPasswordName(c *C) {
3333
a := &Password{
3434
User: "test",
3535
Pass: "",
3636
}
3737
c.Assert(a.Name(), Equals, PasswordName)
3838
}
3939

40-
func (s *SuiteRemote) TestPasswordString(c *C) {
40+
func (s *SuiteCommon) TestPasswordString(c *C) {
4141
a := &Password{
4242
User: "test",
4343
Pass: "",
4444
}
4545
c.Assert(a.String(), Equals, fmt.Sprintf("user: test, name: %s", PasswordName))
4646
}
4747

48-
func (s *SuiteRemote) TestPasswordCallbackName(c *C) {
48+
func (s *SuiteCommon) TestPasswordCallbackName(c *C) {
4949
a := &PasswordCallback{
5050
User: "test",
5151
Callback: nil,
5252
}
5353
c.Assert(a.Name(), Equals, PasswordCallbackName)
5454
}
5555

56-
func (s *SuiteRemote) TestPasswordCallbackString(c *C) {
56+
func (s *SuiteCommon) TestPasswordCallbackString(c *C) {
5757
a := &PasswordCallback{
5858
User: "test",
5959
Callback: nil,
6060
}
6161
c.Assert(a.String(), Equals, fmt.Sprintf("user: test, name: %s", PasswordCallbackName))
6262
}
6363

64-
func (s *SuiteRemote) TestPublicKeysName(c *C) {
64+
func (s *SuiteCommon) TestPublicKeysName(c *C) {
6565
a := &PublicKeys{
6666
User: "test",
6767
Signer: nil,
6868
}
6969
c.Assert(a.Name(), Equals, PublicKeysName)
7070
}
7171

72-
func (s *SuiteRemote) TestPublicKeysString(c *C) {
72+
func (s *SuiteCommon) TestPublicKeysString(c *C) {
7373
a := &PublicKeys{
7474
User: "test",
7575
Signer: nil,
7676
}
7777
c.Assert(a.String(), Equals, fmt.Sprintf("user: test, name: %s", PublicKeysName))
7878
}
7979

80-
func (s *SuiteRemote) TestPublicKeysCallbackName(c *C) {
80+
func (s *SuiteCommon) TestPublicKeysCallbackName(c *C) {
8181
a := &PublicKeysCallback{
8282
User: "test",
8383
Callback: nil,
8484
}
8585
c.Assert(a.Name(), Equals, PublicKeysCallbackName)
8686
}
8787

88-
func (s *SuiteRemote) TestPublicKeysCallbackString(c *C) {
88+
func (s *SuiteCommon) TestPublicKeysCallbackString(c *C) {
8989
a := &PublicKeysCallback{
9090
User: "test",
9191
Callback: nil,

clients/ssh/git_upload_pack_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ func (c *sshAgentConn) close() error {
5757
return c.pipe.Close()
5858
}
5959

60+
func (s *SuiteRemote) SetUpSuite(c *C) {
61+
if os.Getenv("SSH_AUTH_SOCK") == "" {
62+
c.Skip("SSH_AUTH_SOCK is not set")
63+
}
64+
}
65+
6066
func (s *SuiteRemote) TestConnectWithPublicKeysCallback(c *C) {
6167
agent, err := newSSHAgentConn()
6268
c.Assert(err, IsNil)

0 commit comments

Comments
 (0)