Skip to content

Commit fe1bd71

Browse files
committed
s/wercker/travis
1 parent 739c35a commit fe1bd71

File tree

4 files changed

+37
-49
lines changed

4 files changed

+37
-49
lines changed

.travis.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
language: go
2+
go_import_path: github.com/pkg/sftp
3+
go:
4+
- 1.5.2
5+
- 1.4.3
6+
- tip
7+
8+
sudo: false
9+
10+
addons:
11+
ssh_known_hosts:
12+
- bitbucket.org
13+
14+
install:
15+
- go get -t -v ./...
16+
- ssh-keygen -t rsa -q -P "" -f /home/travis/.ssh/id_rsa
17+
18+
script:
19+
- go test -integration -v ./...

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ sftp
33

44
The `sftp` package provides support for file system operations on remote ssh servers using the SFTP subsystem.
55

6-
[![wercker status](https://app.wercker.com/status/7d3e9b916954ac3a7ed15a457938bac4/s/master "wercker status")](https://app.wercker.com/project/bykey/7d3e9b916954ac3a7ed15a457938bac4)
6+
[!"unix status")](https://travis-ci.org/pkg/sftp.svg)
77

88
usage and examples
99
------------------

server_integration_test.go

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,6 @@ const (
3636
OPENSSH_SFTP = false
3737
)
3838

39-
/***********************************************************************************************
40-
41-
42-
SSH server scaffolding; very simple, no strict auth. This is for unit testing, not real servers
43-
44-
45-
***********************************************************************************************/
46-
4739
var (
4840
hostPrivateKeySigner ssh.Signer
4941
privKey = []byte(`
@@ -350,15 +342,16 @@ func testServer(t *testing.T, useSubsystem bool, readonly bool) (net.Listener, s
350342
for {
351343
conn, err := listener.Accept()
352344
if err != nil {
353-
fmt.Fprintf(sshServerDebugStream, "ssh server socket closed\n")
345+
fmt.Fprintf(sshServerDebugStream, "ssh server socket closed: %v\n", err)
354346
break
355347
}
356348

357349
go func() {
358350
defer conn.Close()
359351
sshSvr, err := sshServerFromConn(conn, useSubsystem, basicServerConfig())
360352
if err != nil {
361-
t.Fatal(err)
353+
t.Error(err)
354+
return
362355
}
363356
err = sshSvr.Wait()
364357
fmt.Fprintf(sshServerDebugStream, "ssh server finished, err: %v\n", err)
@@ -374,10 +367,18 @@ func runSftpClient(t *testing.T, script string, path string, host string, port i
374367
if _, err := os.Stat(*testSftpClientBin); err != nil {
375368
t.Skip("sftp client binary unavailable")
376369
}
377-
cmd := exec.Command(*testSftpClientBin /*"-vvvv",*/, "-b", "-", "-o", "StrictHostKeyChecking=no", "-o", "LogLevel=ERROR", "-o", "UserKnownHostsFile /dev/null", "-P", fmt.Sprintf("%d", port), fmt.Sprintf("%s:%s", host, path))
378-
stdout := &bytes.Buffer{}
370+
args := []string{
371+
// "-vvvv",
372+
"-b", "-",
373+
"-o", "StrictHostKeyChecking=no",
374+
"-o", "LogLevel=ERROR",
375+
"-o", "UserKnownHostsFile /dev/null",
376+
"-P", fmt.Sprintf("%d", port), fmt.Sprintf("%s:%s", host, path),
377+
}
378+
cmd := exec.Command(*testSftpClientBin, args...)
379+
var stdout bytes.Buffer
379380
cmd.Stdin = bytes.NewBufferString(script)
380-
cmd.Stdout = stdout
381+
cmd.Stdout = &stdout
381382
cmd.Stderr = sftpClientDebugStream
382383
if err := cmd.Start(); err != nil {
383384
return "", err
@@ -426,12 +427,14 @@ ls -l /usr/bin/
426427
goWords := spaceRegex.Split(goLine, -1)
427428
opWords := spaceRegex.Split(opLine, -1)
428429
// allow words[2] and [3] to be different as these are users & groups
430+
// also allow words[1] to differ as the link count for directories like
431+
// proc is unstable during testing as processes are created/destroyed.
429432
for j, goWord := range goWords {
430433
if j > len(opWords) {
431434
bad = true
432435
}
433436
opWord := opWords[j]
434-
if goWord != opWord && j != 2 && j != 3 {
437+
if goWord != opWord && j != 1 && j != 2 && j != 3 {
435438
bad = true
436439
}
437440
}

wercker.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)